chore: import upstream snapshot with attribution
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TLExpressionGroupModel+DetailRequest.h
|
||||
// TLChat
|
||||
//
|
||||
// Created by 李伯坤 on 2018/1/2.
|
||||
// Copyright © 2018年 李伯坤. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TLExpressionGroupModel.h"
|
||||
|
||||
@interface TLExpressionGroupModel (DetailRequest)
|
||||
|
||||
/**
|
||||
* 表情详情
|
||||
*/
|
||||
- (TLBaseRequest *)requestExpressionGroupDetailByPageIndex:(NSInteger)pageIndex success:(TLRequestSuccessBlock)success failure:(TLRequestFailureBlock)failure;
|
||||
|
||||
@end
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// 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
|
||||
Reference in New Issue
Block a user