Files
peko-ios/YuMi/Modules/YMMine/Presenter/XPMineFootPrintPresenter.m
2023-07-14 18:50:55 +08:00

50 lines
1.7 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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