Commit 3fa3487c39832bf936c64bcf0b32107ef4c6507f
1 parent
27df797e
添加查询多条用户信息接口
Showing
12 changed files
with
84 additions
and
10 deletions
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserInfo.h
| ... | ... | @@ -27,6 +27,11 @@ |
| 27 | 27 | - (void)queryUserInfoWithAppId:(NSString *)appId appKey:(NSString *)appKey uid:(NSString *)uid srcUid:(NSString *)srcUid token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSDictionary *errorDic))failure; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | + * 查询多条用户信息 | |
| 31 | + */ | |
| 32 | +- (void)queryMoreUserInfoWithAppId:(NSString *)appId appKey:(NSString *)appKey uid:(NSString *)uid srcUids:(NSArray *)srcUids token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSDictionary *errorDic))failure; | |
| 33 | + | |
| 34 | +/** | |
| 30 | 35 | * 修改用户单项信息 |
| 31 | 36 | */ |
| 32 | 37 | - (void)modifyUserInfoWithAppId:(NSString *)appId appKey:(NSString *)appKey type:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSDictionary *errorDic))failure; | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserInfo.m
| ... | ... | @@ -17,6 +17,9 @@ static NSString *updateMobileURL = @"https://api.cnlive.com/open/api2/use |
| 17 | 17 | //查询用户信息 |
| 18 | 18 | static NSString *queryUserInfoURL = @"https://api.cnlive.com/open/api2/user/readUserById"; |
| 19 | 19 | |
| 20 | +//查询多条用户信息 | |
| 21 | +static NSString *queryMoreUserInfoURL = @"https://api.cnlive.com/open/api2/user/readUsersById4server"; | |
| 22 | + | |
| 20 | 23 | //修改用户单项信息 |
| 21 | 24 | static NSString *updateUserByIdURL = @"https://api.cnlive.com/open/api2/user/updateUserById"; |
| 22 | 25 | |
| ... | ... | @@ -112,6 +115,33 @@ static NSString *BindingThirdURL = @"https://api.cnlive.com/open/api2/use |
| 112 | 115 | } |
| 113 | 116 | |
| 114 | 117 | /** |
| 118 | + * 查询多个用户信息 | |
| 119 | + */ | |
| 120 | +- (void)queryMoreUserInfoWithAppId:(NSString *)appId appKey:(NSString *)appKey uid:(NSString *)uid srcUids:(NSArray *)srcUids token:(NSString *)token success:(void (^)(id))success failure:(void (^)(NSDictionary *))failure | |
| 121 | +{ | |
| 122 | + NSDate *date = [NSDate date]; | |
| 123 | + NSInteger time = [date timeIntervalSince1970]; | |
| 124 | + NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time]; | |
| 125 | + | |
| 126 | + NSString *uids = [srcUids componentsJoinedByString:@","]; | |
| 127 | + | |
| 128 | + NSDictionary *params = @{@"appId":[CNLiveUserSystemTools verify:appId], | |
| 129 | + @"uid":[CNLiveUserSystemTools verify:uid], | |
| 130 | + @"srcUids":[CNLiveUserSystemTools verify:uids], | |
| 131 | + @"clientPlat":@"i", | |
| 132 | + @"token":[CNLiveUserSystemTools verify:token], | |
| 133 | + @"platform_id":[NSBundle mainBundle].bundleIdentifier, | |
| 134 | + @"timestamp": timeString}; | |
| 135 | + | |
| 136 | + NSMutableDictionary *parameter = [NSMutableDictionary dictionaryWithDictionary:params]; | |
| 137 | + NSString *string = [NSString stringWithFormat:@"%@&key=%@", [CNLiveUserSystemTools signvalue:parameter], [CNLiveUserSystemTools verify:appKey]]; | |
| 138 | + NSString *signString = [[CNLiveUserSystemTools sha1:string] uppercaseString]; | |
| 139 | + | |
| 140 | + [parameter setObject:signString forKey:@"sign"]; | |
| 141 | + [self requestWithURL:queryMoreUserInfoURL parameter:parameter success:success failure:failure]; | |
| 142 | +} | |
| 143 | + | |
| 144 | +/** | |
| 115 | 145 | * 修改用户单项信息 |
| 116 | 146 | */ |
| 117 | 147 | - (void)modifyUserInfoWithAppId:(NSString *)appId appKey:(NSString *)appKey type:(UserInfoType)type uid:(NSString *)uid modifyInfo:(NSString *)info token:(NSString *)token success:(void (^)(id result))success failure :(void (^)(NSDictionary *error))failure | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.h
| ... | ... | @@ -158,6 +158,16 @@ |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | + @abstract 查询多条用户信息 | |
| 162 | + @param uid 用户ID | |
| 163 | + @param srcUids 被查询用户IDs | |
| 164 | + @param success 成功回调 | |
| 165 | + @param failure 失败回调 | |
| 166 | + */ | |
| 167 | ++ (void)queryMoreUserInfosWithUid:(NSString *)uid srcUids:(NSArray *)srcUids success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure; | |
| 168 | + | |
| 169 | + | |
| 170 | +/** | |
| 161 | 171 | @abstract 用户反馈 |
| 162 | 172 | @param contentId 举报内容ID |
| 163 | 173 | @param message 举报内容(app自己组织-不能带特殊字符&号等) | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.m
| ... | ... | @@ -150,6 +150,16 @@ |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | + * 查询多条用户信息 | |
| 154 | + */ | |
| 155 | ++ (void)queryMoreUserInfosWithUid:(NSString *)uid srcUids:(NSArray *)srcUids success:(void (^)(id))success failure:(void (^)(NSDictionary *))failure | |
| 156 | +{ | |
| 157 | + CNLiveUserInfo *userInfo = [[CNLiveUserInfo alloc] init]; | |
| 158 | + | |
| 159 | + [userInfo queryMoreUserInfoWithAppId:[CNLiveUserManager manager].appId appKey:[CNLiveUserManager manager].appKey uid:uid srcUids:srcUids token:[[self class] getToken] success:success failure:failure]; | |
| 160 | +} | |
| 161 | + | |
| 162 | +/** | |
| 153 | 163 | * 用户反馈 |
| 154 | 164 | */ |
| 155 | 165 | + (void)feedbackWithContentId:(NSString *)contentId message:(NSString *)message success:(void (^)(id))success failure :(void (^)(NSDictionary *errorDic))failure | ... | ... |
CNLiveUserSystemDemo/CNLiveUserSystemSDK/Common.h
| ... | ... | @@ -11,6 +11,6 @@ |
| 11 | 11 | |
| 12 | 12 | #define kSVer @"4.0" //探针版本 |
| 13 | 13 | #define StatAppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"]) |
| 14 | -#define SDKVersion @"1.1.3" //SDK版本 | |
| 14 | +#define SDKVersion @"1.1.4" //SDK版本 | |
| 15 | 15 | |
| 16 | 16 | #endif /* Common_h */ | ... | ... |
CNLiveUserSystemDemo/Conreollers/ViewController.m
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | [self.view addSubview:self.loginBtn]; |
| 48 | 48 | [self.view addSubview:self.thirPartydView]; |
| 49 | 49 | |
| 50 | - _dataArr = @[@"通过手机号修改密码",@"更新附加信息",@"修改用户信息",@"查询用户信息",@"反馈",@"绑定第三方账号"]; | |
| 50 | + _dataArr = @[@"通过手机号修改密码",@"更新附加信息",@"修改用户信息",@"查询用户信息",@"查询多条用户信息",@"反馈",@"绑定第三方账号"]; | |
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
| ... | ... | @@ -160,13 +160,13 @@ |
| 160 | 160 | { |
| 161 | 161 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; |
| 162 | 162 | |
| 163 | - if (indexPath.row == 1) { | |
| 163 | + if (indexPath.row == 1) { //修改密码 | |
| 164 | 164 | RegisterViewController *regVC = [[RegisterViewController alloc] init]; |
| 165 | 165 | regVC.type = @"forgetPwd"; |
| 166 | 166 | [self.navigationController pushViewController:regVC animated:YES]; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if (indexPath.row == 2) { | |
| 169 | + if (indexPath.row == 2) { //更新附加信息 | |
| 170 | 170 | |
| 171 | 171 | [SVProgressHUD show]; |
| 172 | 172 | |
| ... | ... | @@ -185,12 +185,12 @@ |
| 185 | 185 | }]; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if (indexPath.row == 3) { | |
| 188 | + if (indexPath.row == 3) { //修改用户信息 | |
| 189 | 189 | UserInfoViewController *userInfo = [[UserInfoViewController alloc] init]; |
| 190 | 190 | [self.navigationController pushViewController:userInfo animated:YES]; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - if (indexPath.row == 4) { | |
| 193 | + if (indexPath.row == 4) { //查询用户信息 | |
| 194 | 194 | UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; |
| 195 | 195 | |
| 196 | 196 | [CNLiveUserSystemCenter queryUserInfoWithUid:model.uid srcUid:model.uid success:^(id result) { |
| ... | ... | @@ -209,7 +209,16 @@ |
| 209 | 209 | }]; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - if (indexPath.row == 5) { | |
| 212 | + if (indexPath.row == 5) { //查询多条用户信息 | |
| 213 | + UserInfoModel *model = [UserInfoModel modelWithKeyValues:[Tools getLocalUserInfo]]; | |
| 214 | + [CNLiveUserSystemCenter queryMoreUserInfosWithUid:model.uid srcUids:@[@"498122",@"10000098",@"10451544"] success:^(id result) { | |
| 215 | + NSLog(@"查询多条用户信息-----%@",result); | |
| 216 | + } failure:^(NSDictionary *errorDic) { | |
| 217 | + [Tools toast:[NSString stringWithFormat:@"errorCode : %@ \n errorMessage : %@", errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; | |
| 218 | + }]; | |
| 219 | + } | |
| 220 | + | |
| 221 | + if (indexPath.row == 6) { //反馈 | |
| 213 | 222 | |
| 214 | 223 | [CNLiveUserSystemCenter feedbackWithContentId:@"11" message:@"fhsjhifkncznshfu" success:^(id result) { |
| 215 | 224 | [Tools toast:[NSString stringWithFormat:@"反馈--%@",result[@"errorMessage"]]]; |
| ... | ... | @@ -219,7 +228,7 @@ |
| 219 | 228 | }]; |
| 220 | 229 | } |
| 221 | 230 | |
| 222 | - if (indexPath.row == 6) { | |
| 231 | + if (indexPath.row == 7) { //绑定第三方 | |
| 223 | 232 | |
| 224 | 233 | [UIView animateWithDuration:0.25 animations:^{ |
| 225 | 234 | _thirPartydView.frame = CGRectMake(0, KScreenHeight-160, KScreenWidth, 160); | ... | ... |
CNLiveUserSystemSDK.xcodeproj/project.xcworkspace/xcuserdata/iOS.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
CNLiveUserSystemSDK/Info.plist
| ... | ... | @@ -15,9 +15,9 @@ |
| 15 | 15 | <key>CFBundlePackageType</key> |
| 16 | 16 | <string>FMWK</string> |
| 17 | 17 | <key>CFBundleShortVersionString</key> |
| 18 | - <string>1.1.3</string> | |
| 18 | + <string>1.1.4</string> | |
| 19 | 19 | <key>CFBundleVersion</key> |
| 20 | - <string>1.1.3.121214</string> | |
| 20 | + <string>1.1.3.17032316</string> | |
| 21 | 21 | <key>NSPrincipalClass</key> |
| 22 | 22 | <string></string> |
| 23 | 23 | </dict> | ... | ... |
Products/CNLiveUserSystemSDK.framework/CNLiveUserSystemSDK
No preview for this file type
Products/CNLiveUserSystemSDK.framework/Headers/CNLiveUserSystemCenter.h
| ... | ... | @@ -158,6 +158,16 @@ |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | + @abstract 查询多条用户信息 | |
| 162 | + @param uid 用户ID | |
| 163 | + @param srcUids 被查询用户IDs | |
| 164 | + @param success 成功回调 | |
| 165 | + @param failure 失败回调 | |
| 166 | + */ | |
| 167 | ++ (void)queryMoreUserInfosWithUid:(NSString *)uid srcUids:(NSArray *)srcUids success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure; | |
| 168 | + | |
| 169 | + | |
| 170 | +/** | |
| 161 | 171 | @abstract 用户反馈 |
| 162 | 172 | @param contentId 举报内容ID |
| 163 | 173 | @param message 举报内容(app自己组织-不能带特殊字符&号等) | ... | ... |
Products/CNLiveUserSystemSDK.framework/Info.plist
No preview for this file type
iOS用户SDK.docx
0 → 100644
No preview for this file type