diff --git a/CHANGELOG.md b/CHANGELOG.md index c2c603d..23a2353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 5.4.2 +- 修复了返回数组类型的属性,如果数组内容只有一个时候会解析失败的问题。 + # 5.4.1 - 修复了 XML 中以 / 结尾的 Object 会403的的问题。 diff --git a/QCloudCOSXML.podspec b/QCloudCOSXML.podspec index ce66e60..47f3cb5 100644 --- a/QCloudCOSXML.podspec +++ b/QCloudCOSXML.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "QCloudCOSXML" -s.version = "5.4.1" +s.version = "5.4.2" s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件" s.homepage = "https://cloud.tencent.com/" @@ -9,10 +9,10 @@ s.version = "5.4.1" s.source = { :git => "https://github.com/tencentyun/qcloud-sdk-ios.git", :tag => s.version.to_s } s.ios.deployment_target = '8.0' s.source_files = 'QCloudCOSXML/Classes/**/*' - s.dependency "QCloudCore",'5.4.1' + s.dependency "QCloudCore",'5.4.2' s.subspec 'Transfer' do |sbt| sbt.source_files = 'QCloudCOSXML/Classes/Transfer/*','QCloudCOSXML/Classes/Base/*' - sbt.dependency "QCloudCore",'5.4.1' + sbt.dependency "QCloudCore",'5.4.2' end end diff --git a/QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.m b/QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.m index 2c77c3d..70333a2 100644 --- a/QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.m +++ b/QCloudCOSXML/Classes/Base/QCloudCOSXMLEndPoint.m @@ -61,4 +61,11 @@ - (NSURL*) serverURLWithBucket:(NSString *)bucket appID:(NSString *)appID NSURL* serverURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@-%@.%@.%@",scheme,formattedBucketName,appID,formattedRegionName,self.serviceName]]; return serverURL; } + +- (id)copyWithZone:(NSZone *)zone { + QCloudCOSXMLEndPoint* endpoint = [[QCloudCOSXMLEndPoint alloc] init]; + endpoint.regionName = self.regionName; + endpoint.serviceName = self.serviceName; + return endpoint; +} @end diff --git a/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.h b/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.h index 68db7cc..6bd6796 100644 --- a/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.h +++ b/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.h @@ -38,6 +38,15 @@ #pragma Factory + (QCloudCOSXMLService*) defaultCOSXML; + (QCloudCOSXMLService*) cosxmlServiceForKey:(NSString*)key; + +/** + 检查是否存在key对应的service + + @param key key + @return 存在与否 + + */ ++ (BOOL) hasServiceForKey:(NSString*)key; + (QCloudCOSXMLService*) registerDefaultCOSXMLWithConfiguration:(QCloudServiceConfiguration*)configuration; + (QCloudCOSXMLService*) registerCOSXMLWithConfiguration:(QCloudServiceConfiguration*)configuration withKey:(NSString*)key; + (void) removeCOSXMLWithKey:(NSString*)key; diff --git a/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.m b/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.m index de4f196..352f856 100644 --- a/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.m +++ b/QCloudCOSXML/Classes/Base/QCloudCOSXMLService.m @@ -104,5 +104,13 @@ - (NSString*)getURLWithBucket:(NSString *)bucket object:(NSString *)object withA return [resultURL copy]; } ++ (BOOL)hasServiceForKey:(NSString *)key { + if (nil == [QCloudCOSXMLServiceCache() objectForKey:key]) { + return NO; + } else { + return YES; + } +} + @end diff --git a/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.h b/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.h index 5a20b1e..1347cb7 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.h +++ b/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.h @@ -28,7 +28,7 @@ #import #import #import "QCloudACLOwner.h" -#import "QCloudACLGrant.h" +#import "QCloudAccessControlList.h" NS_ASSUME_NONNULL_BEGIN @interface QCloudACLPolicy : NSObject @@ -39,6 +39,6 @@ NS_ASSUME_NONNULL_BEGIN /** 被授权者与权限的信息 */ -@property (strong, nonatomic) NSArray *accessControlList; +@property (strong, nonatomic) QCloudAccessControlList *accessControlList; @end NS_ASSUME_NONNULL_END diff --git a/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.m b/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.m index 37a4b3a..c71b987 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.m +++ b/QCloudCOSXML/Classes/Manager/QCloudACLPolicy.m @@ -27,19 +27,12 @@ #import "QCloudACLPolicy.h" #import "QCloudACLOwner.h" -#import "QCloudACLGrant.h" +#import "QCloudAccessControlList.h" -@class QCloudACLGrant; NS_ASSUME_NONNULL_BEGIN @implementation QCloudACLPolicy -+ (NSDictionary *)modelContainerPropertyGenericClass -{ - return @ { - @"accessControlList":[QCloudACLGrant class], - }; -} + (NSDictionary *)modelCustomPropertyMapper @@ -53,22 +46,6 @@ + (NSDictionary *)modelCustomPropertyMapper - (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic { -void(^TransformDictionary)(NSString* originKey, NSString* aimKey) = ^(NSString* originKey, NSString* aimKey) { - id object = [dic objectForKey:originKey]; - if (!object) { - return; - } - if ([object isKindOfClass:[NSNull class]]) { - return; - } - if ([object isKindOfClass:[NSArray class]]) { - NSArray* objects = (NSArray*)object; - [dic removeObjectForKey:originKey]; - NSMutableDictionary* transferDic = [@{aimKey:objects} mutableCopy]; - [dic setObject:transferDic forKey:originKey]; - } -}; - TransformDictionary(@"AccessControlList", @"Grant"); return YES; @@ -80,31 +57,6 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic return dic; } NSMutableDictionary* transfromDic = [NSMutableDictionary dictionaryWithDictionary:dic]; - NSArray* transformArrayKeypaths = @[ - @"AccessControlList", - ]; - - for (NSString* keyPath in transformArrayKeypaths) { - id object = [dic valueForKeyPath:keyPath]; - if (!object) { - continue; - } - if ([object isKindOfClass:[NSNull class]]) { - continue; - } - if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } - } - } return transfromDic; } diff --git a/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.h b/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.h new file mode 100644 index 0000000..e9d9309 --- /dev/null +++ b/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.h @@ -0,0 +1,39 @@ +// +// QCloudAccessControlList.h +// QCloudAccessControlList +// +// Created by tencent +// Copyright (c) 2015年 tencent. All rights reserved. +// +// ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ +// ██╔═══██╗██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ ██║ ██╔══██╗██╔══██╗ +// ██║ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ ██║ ███████║██████╔╝ +// ██║▄▄ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ ██║ ██╔══██║██╔══██╗ +// ╚██████╔╝╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗ ███████╗██║ ██║██████╔╝ +// ╚══▀▀═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═════╝ +// +// +// _ __ _ _ +// (_) / _| | | | | +// ___ ___ _ ____ ___ ___ ___ | |_ ___ _ __ __| | _____ _____| | ___ _ __ ___ _ __ ___ +// / __|/ _ \ '__\ \ / / |/ __/ _ \ | _/ _ \| '__| / _` |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __| +// \__ \ __/ | \ V /| | (_| __/ | || (_) | | | (_| | __/\ V / __/ | (_) | |_) | __/ | \__ +// |___/\___|_| \_/ |_|\___\___| |_| \___/|_| \__,_|\___| \_/ \___|_|\___/| .__/ \___|_| |___/ +// ______ ______ ______ ______ ______ ______ ______ ______ | | +// |______|______|______|______|______|______|______|______| |_| +// + + + +#import +#import +#import "QCloudACLGrant.h" + +NS_ASSUME_NONNULL_BEGIN +@interface QCloudAccessControlList : NSObject +/** +存放被授权者信息的数组 +*/ +@property (strong, nonatomic) NSArray *ACLGrants; +@end +NS_ASSUME_NONNULL_END diff --git a/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.m b/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.m new file mode 100644 index 0000000..0f66b13 --- /dev/null +++ b/QCloudCOSXML/Classes/Manager/QCloudAccessControlList.m @@ -0,0 +1,88 @@ +// +// QCloudAccessControlList.m +// QCloudAccessControlList +// +// Created by tencent +// Copyright (c) 2015年 tencent. All rights reserved. +// +// ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ +// ██╔═══██╗██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ ██║ ██╔══██╗██╔══██╗ +// ██║ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ ██║ ███████║██████╔╝ +// ██║▄▄ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ ██║ ██╔══██║██╔══██╗ +// ╚██████╔╝╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗ ███████╗██║ ██║██████╔╝ +// ╚══▀▀═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═════╝ +// +// +// _ __ _ _ +// (_) / _| | | | | +// ___ ___ _ ____ ___ ___ ___ | |_ ___ _ __ __| | _____ _____| | ___ _ __ ___ _ __ ___ +// / __|/ _ \ '__\ \ / / |/ __/ _ \ | _/ _ \| '__| / _` |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __| +// \__ \ __/ | \ V /| | (_| __/ | || (_) | | | (_| | __/\ V / __/ | (_) | |_) | __/ | \__ +// |___/\___|_| \_/ |_|\___\___| |_| \___/|_| \__,_|\___| \_/ \___|_|\___/| .__/ \___|_| |___/ +// ______ ______ ______ ______ ______ ______ ______ ______ | | +// |______|______|______|______|______|______|______|______| |_| +// + + +#import "QCloudAccessControlList.h" + +#import "QCloudACLGrant.h" + +@class QCloudACLGrant; + +NS_ASSUME_NONNULL_BEGIN +@implementation QCloudAccessControlList + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + return @ { + @"ACLGrants":[QCloudACLGrant class], + }; +} + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + return @{ + @"ACLGrants" :@"Grant", + }; +} + + +- (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic +{ + + + return YES; +} + +- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic +{ + if (!dic) { + return dic; + } + NSMutableDictionary* transfromDic = [NSMutableDictionary dictionaryWithDictionary:dic]; + NSArray* transformArrayKeypaths = @[ + @"Grant", + ]; + + for (NSString* keyPath in transformArrayKeypaths) { + id object = [dic valueForKeyPath:keyPath]; + if (!object) { + continue; + } + if ([object isKindOfClass:[NSNull class]]) { + continue; + } + if (![object isKindOfClass:[NSArray class]]) { + [transfromDic setValue:@[object] forKeyPath:keyPath]; + } + } + + return transfromDic; +} + +@end + + +NS_ASSUME_NONNULL_END diff --git a/QCloudCOSXML/Classes/Manager/QCloudBucketReplicationConfiguation.m b/QCloudCOSXML/Classes/Manager/QCloudBucketReplicationConfiguation.m index cf9405b..dc3eaf0 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudBucketReplicationConfiguation.m +++ b/QCloudCOSXML/Classes/Manager/QCloudBucketReplicationConfiguation.m @@ -76,16 +76,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudCORSConfiguration.m b/QCloudCOSXML/Classes/Manager/QCloudCORSConfiguration.m index 7178e48..17afe94 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudCORSConfiguration.m +++ b/QCloudCOSXML/Classes/Manager/QCloudCORSConfiguration.m @@ -75,16 +75,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudCORSRule.m b/QCloudCOSXML/Classes/Manager/QCloudCORSRule.m index 9c97af3..3b1d6a9 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudCORSRule.m +++ b/QCloudCOSXML/Classes/Manager/QCloudCORSRule.m @@ -78,16 +78,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudDeleteInfo.m b/QCloudCOSXML/Classes/Manager/QCloudDeleteInfo.m index a070706..eb557c2 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudDeleteInfo.m +++ b/QCloudCOSXML/Classes/Manager/QCloudDeleteInfo.m @@ -88,16 +88,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudDeleteResult.m b/QCloudCOSXML/Classes/Manager/QCloudDeleteResult.m index 709d804..11854ff 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudDeleteResult.m +++ b/QCloudCOSXML/Classes/Manager/QCloudDeleteResult.m @@ -75,16 +75,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudLifecycleConfiguration.m b/QCloudCOSXML/Classes/Manager/QCloudLifecycleConfiguration.m index 27b795f..85ff70a 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudLifecycleConfiguration.m +++ b/QCloudCOSXML/Classes/Manager/QCloudLifecycleConfiguration.m @@ -75,16 +75,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudListAllMyBucketsResult.m b/QCloudCOSXML/Classes/Manager/QCloudListAllMyBucketsResult.m index 35febe5..301ac30 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudListAllMyBucketsResult.m +++ b/QCloudCOSXML/Classes/Manager/QCloudListAllMyBucketsResult.m @@ -77,16 +77,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudListBucketResult.m b/QCloudCOSXML/Classes/Manager/QCloudListBucketResult.m index 2c108ad..52b9f66 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudListBucketResult.m +++ b/QCloudCOSXML/Classes/Manager/QCloudListBucketResult.m @@ -98,16 +98,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudListMultipartUploadsResult.m b/QCloudCOSXML/Classes/Manager/QCloudListMultipartUploadsResult.m index 993da92..85a87a7 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudListMultipartUploadsResult.m +++ b/QCloudCOSXML/Classes/Manager/QCloudListMultipartUploadsResult.m @@ -82,16 +82,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Manager/QCloudListVersionsResult.m b/QCloudCOSXML/Classes/Manager/QCloudListVersionsResult.m index 40dbab2..a545807 100644 --- a/QCloudCOSXML/Classes/Manager/QCloudListVersionsResult.m +++ b/QCloudCOSXML/Classes/Manager/QCloudListVersionsResult.m @@ -85,16 +85,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/QCloudCOSXMLVersion.h b/QCloudCOSXML/Classes/QCloudCOSXMLVersion.h index 35f51c8..7292089 100644 --- a/QCloudCOSXML/Classes/QCloudCOSXMLVersion.h +++ b/QCloudCOSXML/Classes/QCloudCOSXMLVersion.h @@ -6,11 +6,11 @@ #ifndef QCloudCOSXMLModuleVersion_h #define QCloudCOSXMLModuleVersion_h -#define QCloudCOSXMLModuleVersionNumber 504001 +#define QCloudCOSXMLModuleVersionNumber 504002 //dependency -#if QCloudCoreModuleVersionNumber != 504001 - #error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.1,当前引入的QCloudCore版本号过低,请及时升级后使用" +#if QCloudCoreModuleVersionNumber != 504002 + #error "库QCloudCOSXML依赖QCloudCore最小版本号为5.4.2,当前引入的QCloudCore版本号过低,请及时升级后使用" #endif // diff --git a/QCloudCOSXML/Classes/QCloudCOSXMLVersion.m b/QCloudCOSXML/Classes/QCloudCOSXMLVersion.m index 7df8a84..5c01d76 100644 --- a/QCloudCOSXML/Classes/QCloudCOSXMLVersion.m +++ b/QCloudCOSXML/Classes/QCloudCOSXMLVersion.m @@ -1,5 +1,5 @@ #import "QCloudCOSXMLVersion.h" -NSString * const QCloudCOSXMLModuleVersion = @"5.4.1"; +NSString * const QCloudCOSXMLModuleVersion = @"5.4.2"; NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML"; @interface QCloudQCloudCOSXMLLoad : NSObject @end diff --git a/QCloudCOSXML/Classes/Transfer/QCloudCompleteMultipartUploadInfo.m b/QCloudCOSXML/Classes/Transfer/QCloudCompleteMultipartUploadInfo.m index 4b7dc41..70a3e0e 100644 --- a/QCloudCOSXML/Classes/Transfer/QCloudCompleteMultipartUploadInfo.m +++ b/QCloudCOSXML/Classes/Transfer/QCloudCompleteMultipartUploadInfo.m @@ -75,16 +75,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCOSXML/Classes/Transfer/QCloudListPartsResult.m b/QCloudCOSXML/Classes/Transfer/QCloudListPartsResult.m index 9c4c5fd..94a6273 100644 --- a/QCloudCOSXML/Classes/Transfer/QCloudListPartsResult.m +++ b/QCloudCOSXML/Classes/Transfer/QCloudListPartsResult.m @@ -95,16 +95,7 @@ - (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic continue; } if (![object isKindOfClass:[NSArray class]]) { - if ([object isKindOfClass:[NSDictionary class]] && [(NSDictionary*)object count] == 1) { - id value = [[object allValues] firstObject]; - if ([value isKindOfClass:[NSArray class]]) { - [transfromDic setValue:value forKey:keyPath]; - } else { - [transfromDic setValue:@[value] forKey:keyPath]; - } - } else { - [transfromDic setValue:@[object] forKeyPath:keyPath]; - } + [transfromDic setValue:@[object] forKeyPath:keyPath]; } } diff --git a/QCloudCore.podspec b/QCloudCore.podspec index dbaf38e..2947bfd 100644 --- a/QCloudCore.podspec +++ b/QCloudCore.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "QCloudCore" -s.version = "5.4.1" +s.version = "5.4.2" s.summary = "QCloudCore--腾讯云iOS-SDK Foundation" # This description is used to generate tags and improve search results. diff --git a/QCloudCore/Classes/QCloudCoreVersion.h b/QCloudCore/Classes/QCloudCoreVersion.h index b7457e7..5900351 100644 --- a/QCloudCore/Classes/QCloudCoreVersion.h +++ b/QCloudCore/Classes/QCloudCoreVersion.h @@ -5,7 +5,7 @@ #ifndef QCloudCoreModuleVersion_h #define QCloudCoreModuleVersion_h -#define QCloudCoreModuleVersionNumber 504001 +#define QCloudCoreModuleVersionNumber 504002 //dependency diff --git a/QCloudCore/Classes/QCloudCoreVersion.m b/QCloudCore/Classes/QCloudCoreVersion.m index 2e3cc3b..5c6e117 100644 --- a/QCloudCore/Classes/QCloudCoreVersion.m +++ b/QCloudCore/Classes/QCloudCoreVersion.m @@ -1,5 +1,5 @@ #import "QCloudCoreVersion.h" -NSString * const QCloudCoreModuleVersion = @"5.4.1"; +NSString * const QCloudCoreModuleVersion = @"5.4.2"; NSString * const QCloudCoreModuleName = @"QCloudCore"; @interface QCloudQCloudCoreLoad : NSObject @end