39 lines
1.4 KiB
Objective-C
39 lines
1.4 KiB
Objective-C
//
|
|
// XPHomeLittleGamePesenter.m
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2022/3/24.
|
|
//
|
|
|
|
#import "XPHomeLittleGamePesenter.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "XPHomeLittleGameProtocol.h"
|
|
#import "Api+Home.h"
|
|
#import "HomeLittleGameRoomModel.h"
|
|
|
|
@implementation XPHomeLittleGamePesenter
|
|
|
|
- (void)getHomeLittleGameRoomList:(int)pageNum pageSize:(int)pageSize state:(int)state {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * pageNumStr = [NSString stringWithFormat:@"%d", pageNum];
|
|
NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize];
|
|
[Api homeLittleGameRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
NSArray * array = [HomeLittleGameRoomModel modelsWithArray:data.data];
|
|
[[self getView] getHomeLittleGameRoomListSuccess:array state:state];
|
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
|
[[self getView] getHomeLittleGameRoomListFail:msg state:state];
|
|
}] pageSize:pageSizeStr pageNum:pageNumStr uid:uid];
|
|
}
|
|
|
|
|
|
- (void)quickMatchLittleGameRoom {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
[Api homeQuickMatchLittleGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
HomeLittleGameRoomModel * gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data];
|
|
NSString * uid = gameRoom.uid;
|
|
[[self getView] quickMatchLittleGameRoomSuccess:uid];
|
|
} showLoading:YES] uid:uid];
|
|
}
|
|
|
|
@end
|