
- Removed YuMi/Library/ (138 MB, not tracked) - Removed YuMi/Resources/ (23 MB, not tracked) - Removed old version assets (566 files, not tracked) - Excluded Pods/, xcuserdata/ and other build artifacts - Clean repository optimized for company server deployment
106 lines
4.1 KiB
Objective-C
106 lines
4.1 KiB
Objective-C
//
|
|
// YMMonentDetailPresenter.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2022/6/23.
|
|
//
|
|
|
|
#import "XPMonentDetailPresenter.h"
|
|
#import "Api+Moments.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "XPMonentsDetailProtocol.h"
|
|
#import "MomentsInfoModel.h"
|
|
#import "MonentsCommentModel.h"
|
|
#import "MonentsCommentReplyModel.h"
|
|
@implementation XPMonentDetailPresenter
|
|
|
|
/// 获取动态详情
|
|
/// @param dynamicId 动态ID
|
|
- (void)getMonentsDetail:(NSString *)dynamicId {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api momentsDetail:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
MomentsInfoModel * monentsInfo = [MomentsInfoModel modelWithDictionary:data.data];
|
|
[[self getView] getMonentsDetailSuccess:monentsInfo];
|
|
} showLoading:YES] dynamicId:dynamicId worldId:@"" uid:uid];
|
|
}
|
|
|
|
|
|
/// 获取评论列表
|
|
/// @param dynamicId 动态id
|
|
/// @param timestamp 上一条的时间戳
|
|
/// @param state 状态
|
|
- (void)getMonentsCommentList:(NSString *)dynamicId timestamp:(NSString *)timestamp status:(int)state{
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api momentsCommentList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
MonentsCommentListModel * info = [MonentsCommentListModel modelWithDictionary:data.data];
|
|
[[self getView] getMonentsCommentListSuccess:info state:state];
|
|
}] dynamicId:dynamicId uid:uid pageSize:@"10" timestamp:timestamp];
|
|
}
|
|
|
|
|
|
/// 获取评论的回复列表
|
|
/// @param dynamicId 动态id
|
|
/// @param commentId 评论id
|
|
/// @param timestamp 最后一条评论的时间戳
|
|
- (void)getMonentsCommentReplyList:(NSString *)dynamicId commentId:(NSString *)commentId timestamp:(NSString *)timestamp {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api momentsCommentReplyList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
MonentsCommentReplyModel * replyInfo = [MonentsCommentReplyModel modelWithDictionary:data.data];
|
|
[[self getView] getMonentsCommentReplyListSuccess:replyInfo commentId:commentId];
|
|
}] dynamicId:dynamicId uid:uid pageSize:@"5" commentId:commentId timestamp:timestamp];
|
|
}
|
|
|
|
/// 动态点赞
|
|
/// @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 momentsLike:[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 momentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
[[self getView] deleteMonentsSuccess:dynamicId];
|
|
} uid:uid dynamicId:dynamicId worldId:worldId];
|
|
}
|
|
|
|
|
|
/// 评论动态
|
|
/// @param dynamicId 动态的id
|
|
/// @param content 评论的内容
|
|
- (void)commontMonents:(NSString *)dynamicId content:(NSString *)content {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api momentDetailCommon:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] commonMonentsSuccess];
|
|
} showLoading:YES] uid:uid dynamicId:dynamicId content:content];
|
|
}
|
|
|
|
/// 评论回复
|
|
/// @param commonId 评论的id
|
|
/// @param dynamicId 动态的id
|
|
/// @param content 评论的内容
|
|
- (void)replayCommon:(NSString *)commonId dynamicId:(NSString *)dynamicId content:(NSString *)content {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api replyMomentsDetailCommon:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] replyMonentsSuccess];
|
|
}] uid:uid dynamicId:dynamicId content:content commentId:commonId];
|
|
}
|
|
- (void)requesstShieldingWtihType:(NSString *)type objId:(NSString *)objId{
|
|
[Api requestShielding:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] requesstShieldingSuccess:objId];
|
|
}] type:type objId:objId];
|
|
}
|
|
|
|
|
|
|
|
@end
|