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

41 lines
1.3 KiB
Objective-C

//
// XPMonentsInteractivePresenter.m
// xplan-ios
//
// Created by 冯硕 on 2022/5/18.
//
#import "XPMonentsInteractivePresenter.h"
#import "Api+Monents.h"
#import "XPMonentsInteractiveProtocol.h"
#import "AccountInfoStorage.h"
#import "MonentsInteractiveModel.h"
@implementation XPMonentsInteractivePresenter
/// 获取互动消息
/// @param dynamicId 动态的id
/// @param pageSize 一页的个数
/// @param state 状态
- (void)getMonentsInteractiveList:(NSString *)dynamicId pageSize:(int)pageSize state:(int)state{
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
NSString * uid = [AccountInfoStorage instance].getUid;
[Api monentsInteractiveList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MonentsInteractiveModel modelsWithArray:data.data];
[[self getView] getMonentsInteractiveListSueccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getMonentsInteractiveListFail:msg state:state];
}] dynamicId:dynamicId pageSize:pageSizeStr uid:uid];
}
///清空互动消息
- (void)clearInteractiveMessage {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api monentsInteractiveClear:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] clearInteractiveMessageSuccess];
} showLoading:YES] uid:uid];
}
@end