44 lines
1.4 KiB
Objective-C
44 lines
1.4 KiB
Objective-C
//
|
|
// XPHomeLikePresenter.m
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2022/3/2.
|
|
//
|
|
|
|
#import "XPHomeLikePresenter.h"
|
|
#import "Api+Home.h"
|
|
#import "XPHomeLikeProtocol.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "HomePlayRoomModel.h"
|
|
#import "HomeLiveRoomModel.h"
|
|
#import "HomeCollectRoomModel.h"
|
|
@implementation XPHomeLikePresenter
|
|
|
|
|
|
/// 获取关注房间列表
|
|
- (void)getHomeAttectionList {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api homeAttentionList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeLiveRoomModel modelsWithArray:data.data];
|
|
[[self getView] getHomeAttentionListSuccess:array];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
[[self getView] getHomeAttentionListFail:msg];
|
|
}] uid:uid];
|
|
}
|
|
|
|
|
|
/// 获取收藏房间列表
|
|
/// @param page 当前页数
|
|
- (void)getHomeCollectRoomList:(int)page state:(int)state{
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
|
[Api homeCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]];
|
|
[[self getView] getHomeCollectRoomListSuccess:array state:state];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
[[self getView] getHomeCollectRoomListFail:msg state:state];
|
|
}] uid:uid page:pageStr pageSize:@"20"];
|
|
}
|
|
|
|
@end
|