53 lines
2.2 KiB
Objective-C
53 lines
2.2 KiB
Objective-C
//
|
|
// YMMonentsTopicLatestPresenter.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2022/8/18.
|
|
//
|
|
|
|
#import "XPMonentsTopicLatestPresenter.h"
|
|
#import "Api+Monents.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "MonentsListInfoModel.h"
|
|
#import "XPMonentsTopicLatestProtocol.h"
|
|
@implementation XPMonentsTopicLatestPresenter
|
|
|
|
- (void)getMonentsTopicLatestList:(NSString *)dynamicId worldId:(NSString *)worldId state:(int)state {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api monentsTopicLatestList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
MonentsListInfoModel * model = [MonentsListInfoModel modelWithDictionary:data.data];
|
|
[[self getView] getMonentsTopicLatestListSuccess:model state:state];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
[[self getView] getMonentsTopicLatestListFail:msg state:state];
|
|
} showLoading:YES] uid:uid dynamicId:dynamicId types:@"0,2" worldId:worldId pageSize:@"20"];
|
|
}
|
|
|
|
/// 动态点赞
|
|
/// @param dynamicId 动态id
|
|
/// @param status yes 点赞 NO 取消
|
|
/// @param likedUid 点赞人的uid
|
|
/// @param worldId 话题的id
|
|
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * statusStr = status ? @"1" : @"0";
|
|
[Api monentsLike:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] likeMonentsSuccess:dynamicId status:status];
|
|
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
|
}
|
|
|
|
/// 删除动态
|
|
/// @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];
|
|
}
|
|
- (void)requesstShieldingWtihType:(NSString *)type objId:(NSString *)objId{
|
|
[Api requesstShielding:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] requesstShieldingSuccess:objId];
|
|
}] type:type objId:objId];
|
|
}
|
|
@end
|