50 lines
1.7 KiB
Objective-C
50 lines
1.7 KiB
Objective-C
//
|
||
// YMMineFootPrintPresenter.m
|
||
// YUMI
|
||
//
|
||
// Created by YUMI on 2022/7/26.
|
||
//
|
||
|
||
#import "XPMineFootPrintPresenter.h"
|
||
#import "Api+Mine.h"
|
||
#import "Api+Room.h"
|
||
#import "XPMineFootPrintProtocol.h"
|
||
#import "AccountInfoStorage.h"
|
||
#import "XPMineFootPrintModel.h"
|
||
|
||
@implementation XPMineFootPrintPresenter
|
||
|
||
///获取进房记录
|
||
/// @param page 当前页码
|
||
/// @param pageSize 每页数量
|
||
/// @param state 0:刷新, 1:加载更多
|
||
- (void)getFootPrintListWithPage:(int)page pageSize:(int)pageSize state:(int)state {
|
||
NSString *uid = [AccountInfoStorage instance].getUid;
|
||
[Api requestFootPrint:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||
NSArray *array = [XPMineFootPrintModel modelsWithArray:data.data];
|
||
[[self getView] getFootPrintListSuccess:array state:state];
|
||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||
[[self getView] getFootPrintListFail:state];
|
||
}] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize]];
|
||
}
|
||
|
||
/// 清除进房记录
|
||
/// @param roomUid 不传则清空所有
|
||
- (void)cleanFootPrint:(NSString *)roomUid {
|
||
NSString *uid = [AccountInfoStorage instance].getUid;
|
||
[Api requestCleanFootPrint:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||
[[self getView] cleanFootPrintSuccess];
|
||
}] uid:uid roomUid:roomUid.length ? roomUid : NULL];
|
||
}
|
||
|
||
///收藏房间
|
||
- (void)collectRoomWithRoomUid:(NSString *)roomUid {
|
||
NSString * type = @"1";
|
||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||
[Api collectRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||
[[self getView] collectRoomSuccess];
|
||
}] roomUid:roomUid uid:uid type:type roomUids:NULL];
|
||
}
|
||
|
||
@end
|