44 lines
1.4 KiB
Objective-C
44 lines
1.4 KiB
Objective-C
//
|
|
// TLExpressionGroupModel+DetailRequest.m
|
|
// TLChat
|
|
//
|
|
// Created by 李伯坤 on 2018/1/2.
|
|
// Copyright © 2018年 李伯坤. All rights reserved.
|
|
//
|
|
|
|
#import "TLExpressionGroupModel+DetailRequest.h"
|
|
#import "TLNetworking.h"
|
|
|
|
#define IEXPRESSION_DETAIL_URL [IEXPRESSION_HOST_URL stringByAppendingString:@"expre/getByeId.do?pageNumber=%ld&eId=%@"]
|
|
|
|
@implementation TLExpressionGroupModel (DetailRequest)
|
|
|
|
- (TLBaseRequest *)requestExpressionGroupDetailByPageIndex:(NSInteger)pageIndex success:(TLRequestSuccessBlock)success failure:(TLRequestFailureBlock)failure
|
|
{
|
|
NSString *urlString = [NSString stringWithFormat:IEXPRESSION_DETAIL_URL, (long)pageIndex, self.gId];
|
|
[TLNetworking postUrl:urlString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
|
|
NSArray *respArray = [responseObject mj_JSONObject];
|
|
NSString *status = respArray[0];
|
|
if ([status isEqualToString:@"OK"]) {
|
|
NSArray *infoArray = respArray[2];
|
|
NSMutableArray *data = [TLExpressionModel mj_objectArrayWithKeyValuesArray:infoArray];
|
|
if (success) {
|
|
success(data);
|
|
}
|
|
}
|
|
else {
|
|
if (failure) {
|
|
failure(status);
|
|
}
|
|
}
|
|
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
|
if (failure) {
|
|
failure(TLNetworkErrorTip);
|
|
}
|
|
}];
|
|
|
|
return nil;
|
|
}
|
|
|
|
@end
|