Files
yinmeng-ios/xplan-ios/Main/Monents/Presenter/XPMonentsTopicListPresenter.m
2022-08-26 21:47:28 +08:00

40 lines
1.3 KiB
Objective-C

//
// XPMonentsTopicListPresenter.m
// xplan-ios
//
// Created by 冯硕 on 2022/8/18.
//
#import "XPMonentsTopicListPresenter.h"
#import "Api+Monents.h"
#import "AccountInfoStorage.h"
#import "MonentsTopicModel.h"
#import "XPMonentsTopicListProtocol.h"
@implementation XPMonentsTopicListPresenter
- (void)getMoentsTopicList:(int)page pageSize:(int)pageSize state:(int)state {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
[Api moentsTopicList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MonentsTopicModel modelsWithArray:data.data[@"records"]];
[[self getView] getMonentsTopicListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getMoentsTopicFail:msg state:state];
}] uid:uid page:pageStr pageSize:pageSizeStr worldTypeId:@"0"];
}
/// 删除动态
/// @param dynamicId 动态id
/// @param worldId 话题id
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
[[self getView] deleteMonentsSuccess:dynamicId];
} uid:uid dynamicId:dynamicId worldId:worldId];
}
@end