46 lines
1.7 KiB
Objective-C
46 lines
1.7 KiB
Objective-C
//
|
|
// YMHomePresenter.m
|
|
// mew-ios
|
|
//
|
|
// Created by 触海 on 2023/11/19.
|
|
//
|
|
|
|
#import "YMHomePresenter.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "HomeRecommendRoomModel.h"
|
|
#import "Api+Home.h"
|
|
#import "YMHomeProtocol.h"
|
|
|
|
@implementation YMHomePresenter
|
|
|
|
/// 请求首页
|
|
/// @param tabId id
|
|
/// @param page 当前的页数
|
|
/// @param pageSize 一页有多少个
|
|
- (void)getRecommendRoomList:(NSString *)tabId page:(int)page pageSize:(int)pageSize state:(BOOL)state {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
|
|
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
|
[Api getRecommendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
|
|
[[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
|
|
}showLoading:NO] uid:uid tabId:tabId pageNum:pageStr pageSize:pageSizeStr];
|
|
}
|
|
|
|
|
|
/// 请求推荐房间列表
|
|
- (void)homeRecommendRoomList {
|
|
NSString *uid = [AccountInfoStorage instance].getUid;
|
|
[Api homeRecommendRoomListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeRecommendRoomModel mewModelsWithArray:data.data];
|
|
[[self getView] homeRecommendRoomListSuccess:array];
|
|
// [[self getView] getHomeRecommendRoomListSuccess:array state:state];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
// [[self getView] getHomeRecommendRoomListFail:msg state:state];
|
|
}] uid:uid];
|
|
}
|
|
|
|
@end
|