12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // XYPublicAPIManager.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2019/12/31.
- // Copyright © 2019 翟玉磊. All rights reserved.
- //
- #import "XYPublicAPIManager.h"
- /// 搜索用户
- static NSString * const COMMON_SEARCH_CONTENT = @"api-common/v1/search/searchContent";
- @implementation XYPublicAPIManager
- /// 搜索用户
- /// @param content 搜索框的值(支持ID、靓号、主播姓名搜索)
- /// @param pageNum 当前页码
- /// @param pageSize 分页大小
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)searchContentWithContent:(NSString *)content pageNum:(NSInteger)pageNum pageSize:(NSInteger)pageSize successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [COMMON_SEARCH_CONTENT copy];
- config.instructions = @"搜索用户";
- if (pageSize == 0) {
- config.requestParameters = @{@"content":content, @"pageNum":@(pageNum)};
- }else {
- config.requestParameters = @{@"content":content, @"pageNum":@(pageNum), @"pageSize":@(pageSize)};
- }
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- @end
|