Files
yinmeng-ios/xplan-ios/Main/Message/Presenter/MessagePresenter.m

66 lines
2.3 KiB
Mathematica
Raw Normal View History

2021-12-08 18:53:19 +08:00
//
// MessagePresenter.m
// xplan-ios
//
// Created by zu on 2021/12/8.
//
#import "MessagePresenter.h"
#import "Api+Message.h"
#import "ChatLimitModel.h"
#import "MessageProtocol.h"
2022-03-11 16:25:10 +08:00
#import "Api+Mine.h"
#import "UserInfoModel.h"
2022-04-25 16:32:46 +08:00
#import "AccountInfoStorage.h"
2023-08-24 17:03:32 +08:00
#import "UserGameInfoVo.h"
2021-12-08 18:53:19 +08:00
@implementation MessagePresenter
- (void)getChatLimitReceiverUid:(NSString *)receiverUid {
2021-12-08 18:53:19 +08:00
[Api getChatLimit:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
ChatLimitModel *chatLimit = [ChatLimitModel modelWithJSON:data.data];
[[self getView] onGetLimitChat:chatLimit];
} showLoading:NO errorToast:NO] receiverUid:receiverUid];
2021-12-08 18:53:19 +08:00
}
2022-03-11 16:25:10 +08:00
///
/// @param uid uid
- (void)getUserInfo:(NSString *)uid {
[Api userDetailInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
[[self getView] onGetSessionUserInfoSuccess:infoModel];
}] uid:uid page:@"1" pageSize:@"20"];
}
2022-04-25 16:32:46 +08:00
///
- (void)getFansLike:(NSString *)likeUid {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api attentionStatusCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
BOOL isLike = [data.data boolValue];
[[self getView] getFansLikeSuccess:isLike];
}] uid:uid isLikeUid:likeUid];
}
///
/// @param targetUid uid
- (void)attentionUser:(NSString *)targetUid {
NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSString * type = @"1";
[Api attentionCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] attentionUserSuccess:targetUid];
2023-08-29 17:54:23 +08:00
[[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil];
2022-04-25 16:32:46 +08:00
} showLoading:YES] uid:uid likedUid:targetUid ticket:ticket type:type];
}
2023-08-24 17:03:32 +08:00
///
-(void)getGamePartnerInfoListWithUid:(NSString *)uid{
if(uid.length == 0)return;
[Api requestGamePartnerInfoList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *list = [UserGameInfoVo modelsWithArray:data.data];
[[self getView]getGamePartnerInfoList:list];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:uid];
}
2021-12-08 18:53:19 +08:00
@end