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

41 lines
1.5 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.

//
// YMMineCollectRoomListPresenter.m
// YUMI
//
// Created by YUMI on 2022/7/27.
//
#import "XPMineCollectRoomListPresenter.h"
#import "Api+Mine.h"
#import "Api+Room.h"
#import "XPMineCollectRoomListProtocol.h"
#import "AccountInfoStorage.h"
#import "HomeCollectRoomModel.h"
@implementation XPMineCollectRoomListPresenter
/// 获取收藏房间列表
/// @param page 当前的页数
/// @param pageSize 一页多少个
/// @param type 类型4个播房其他派对房不传所有房间
- (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api requestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]];
[[self getView] onGetCollectRoomListSuccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getCollectRoomListFail:state];
}] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize] roomType:type.length ? type : NULL];
}
///批量删除收藏的房间
- (void)deletecollectRoomWithRoomUids:(NSString *)roomUids {
NSString * type = @"3";
NSString * uid = [AccountInfoStorage instance].getUid;
[Api collectRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] deleteCollectRoomSuccess];
}] roomUid:@"" uid:uid type:type roomUids:roomUids];
}
@end