// // YMMonentsInteractivePresenter.m // YUMI // // Created by YUMI on 2022/5/18. // #import "XPMonentsInteractivePresenter.h" #import "Api+Moments.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 momentsInteractiveList:[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 momentsInteractiveClear:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] clearInteractiveMessageSuccess]; } showLoading:YES] uid:uid]; } @end