123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- //
- // XYChatRoomInfoManager.h
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/7/8.
- // Copyright © 2020 翟玉磊. All rights reserved.
- // 管理聊天室内部信息 聊天室内接口请求和数据逻辑
- #import <Foundation/Foundation.h>
- #import "XYChatRoomInfoModel.h"
- #import "XYChatRoomMenuItemModel.h"
- #import "XYLiveRoomActivityInfo.h"
- #import "XYLiveRoomVCInfo.h"
- #import "XYChatRoomMVPModel.h"
- #import "XYPKProceedInfo.h"
- NS_ASSUME_NONNULL_BEGIN
- @class XYChatRoomBattleRoomInModel, XYChatRoomKFBattleRoomInModel, XYChatRoomAuctionRankItemModel, XYChatRoomAuctionInfoModel;
- @protocol XYChatRoomInfoManagerDelegate <NSObject>
- @end
- @interface XYChatRoomInfoManager : NSObject
- @property (nonatomic, strong) XYLiveRoomVCInfo *liveRoomVcInfo;
- @property (nonatomic, weak) id<XYChatRoomInfoManagerDelegate>delegate;
- @property (nonatomic, strong) XYChatRoomInfoModel *roomInfoModel;
- /// 麦位数组
- @property (nonatomic, strong) NSMutableArray <XYChatRoomSeatsModel *>*seatsArray;
- /// 当前麦位用户数组 根据麦位信息进行更新 XYChatRoomSeatsUserModel
- @property (nonatomic, strong) NSMutableArray *seatUserArray;
- /// rtc的认证信息
- @property (nonatomic, strong) XYChatRoomRTCAuthInfoModel *rtcAuthInfo;
- /// 当前用户房间角色 1.观众 2房管 3支持人 4房主 5超管
- @property (nonatomic, assign) XYVoiceRoomRole role;
- /// 相亲模式下当前相亲进程
- @property (nonatomic, assign) XYVoiceRoomLoveStage stage;
- /// 房间是否收藏
- @property (nonatomic, assign) BOOL isFav;
- /// 当前麦序队列用户数量
- @property (nonatomic, assign) NSInteger queueUsersCount;
- /// 当前用户是否加入了麦序队列
- @property (nonatomic, assign) BOOL isJoinQueue;
- /// 菜单model数组
- @property (nonatomic, strong) NSMutableArray *menuItemModelArray;
- /// 当前用户是否上麦
- @property (nonatomic, assign) BOOL isCurrentOnMicrophone;
- /// 当前用户是否在主持人麦
- @property (nonatomic, assign) BOOL isCurrentHost;
- @property (nonatomic, copy) dispatch_block_t currentHostStateUpdateBlock;
- /// 是否关闭听筒 默认是NO 不关闭
- @property (nonatomic, assign) BOOL receiverSwitches;
- /// 音频输出为听筒还是扬声器 默认是YES 扬声器
- @property (nonatomic, assign) BOOL enableSpeakerphone;
- @property (nonatomic, strong) NSMutableArray *personDetailItemTitleArray;
- /// 房间贡献榜数组
- @property (nonatomic, strong) NSMutableArray *diamondRankArray;
- /// 所有活动的数组
- @property (nonatomic, strong) NSMutableArray <XYLiveRoomActivityInfo *>*allActivityArrs;
- /// 昨日榜单MVP model
- @property (nonatomic, strong) XYChatRoomMVPModel *roomYesterdayMVPModel;
- @property (nonatomic, copy) void(^reloadChatRoomGiftSelectBlock)(BOOL success);
- /// 个人资料卡用户信息
- @property (nonatomic, strong) XYUserModel *__nullable personDetailUserInfo;
- /// 消息体用户信息
- @property (nonatomic, strong) NSDictionary *profile;
- /// 服务器时间戳
- @property (nonatomic, copy) NSString *timestamp;
- /// 是否开启了小时榜
- @property (nonatomic, assign) BOOL hourRankEnabled;
- /// 小时榜排名
- @property (nonatomic, assign) NSInteger hoursRankIndex;
- @property (nonatomic, strong) NSArray *hoursDataSource;
- @property (nonatomic, copy) NSString *hoursRankUrl;
- /// 个播主播是否在线 1在线 0离线,没有为0
- @property (nonatomic, assign) BOOL isSingleRtcAnchorOnline;
- /// 个播场次ID
- @property (nonatomic, copy) NSString *singleRtcHisId;
- /// 开播状态 除了个播房都使用次状态判断是否开播
- @property (nonatomic, assign) BOOL isLive;
- /// 更新心动值显示开关 返回对应的菜单model
- - (id)updateCardiacValueSwitch:(BOOL)scoreEnabled;
- /// 更新自由上麦开关状态 返回对应的菜单model
- - (id)updateRoomMicFreeSwitch:(BOOL)roomMicFree;
- /// 更新房间密码锁开关状态 返回对应的菜单model
- - (id)updateRoomLockSwitch:(BOOL)needPass;
- /// 更新公屏开关状态 返回对应的菜单model
- - (id)updateClearChatEnabledSwitch:(BOOL)chatEnabled;
- // 更新菜单数组
- - (NSArray *)updateMenuData;
- // 获取直播间信息
- - (void)getRoomInfoRequestCompleted:(void(^)(NSError *error))completed;
- /// 更新麦位信息
- - (void)getSeatsInfoRequestCompleted:(void(^)(NSError *error))completed;
- /// 获取麦序队列数量和判断出自己是否加入麦序队列
- - (void)getQueueUsersRequestCompleted:(void(^)(NSError *error))completed;
- /// 获取拍卖麦序队列数量和判断出自己是否加入麦序队列
- - (void)getAcutionQueueUsersRequestCompleted:(void(^)(NSError *error))completed;
- /// 获取排行榜信息
- - (void)getDiamondRankWeekCompleted:(void(^)(NSError *error))completed;
- /// 获取空缺的普通麦位号 -1说明没有空缺的普通麦位
- - (NSInteger)getNoUserGeneralSeatNo;
- // 获取聊天室活动
- - (void)getActivityRequestCompleted:(void(^)(NSError *error))completed;
- // 获取昨日榜单MVP
- - (void)getYesterdayDiamondRankMVPCompleted:(void(^)(NSError *error))completed;
- /// 判断用户是否有权限
- - (BOOL)isLimitUser;
- /// 获取指定用户资料的操作功能项
- - (NSArray *)getUserFunctionTitleWithUserId:(NSString *)userId andHideFunction:(BOOL )hideFunction;
- /// 判断这个用户是否在麦上
- /// @param userId 指定的用户id
- - (BOOL)judgeUserIsOnMicrophoneWithUserId:(NSString *)userId;
- /// 根据uid获取麦位model 不在麦上则返回nil
- /// @param userId 指定的用户id
- - (XYChatRoomSeatsModel *)getUserSeatModelWithUserId:(NSString *)userId;
- /// 获取主持人麦位model
- - (XYChatRoomSeatsModel *)getHostSeatModel;
- /// 根据菜单类型获取指定类型的菜单model
- /// @param type 需要的类型
- - (XYChatRoomMenuItemModel *)getMenuModelWithMenuType:(XYChatRoomMenuType)type;
- /// 获取左右边心动值最大的麦位 -1则是没有人
- /// @param isLeft YES左边 NO右边
- - (NSInteger)getLoveHatSeatNoWithLeft:(BOOL)isLeft;
- /// 进入关闭状态 默认是NO 当点击关闭房间的时候会变成YES 目前在关闭房间下麦的时候使用:不处理消息、不刷新定时器
- @property (nonatomic, assign) BOOL enterClosedState;
- //根据用户id获取当前麦位
- - (int )getMicIndex:(NSString *)userId;
- //根据麦为获取用户id
- - (NSString *)getUserIdByMicIndex:(NSInteger )micIndex;
- // 获取当前房间小时榜排名
- - (void)getRtcHourRankCompleted:(void(^)(NSError *error))completed;
- - (void)clear;
- #pragma mark — ----房间PK
- /// 房间内是否启用 PK 功能,未启用不显示 PK 相关的入口
- @property (nonatomic, assign) BOOL battleEnabled;
- /// 当前房间内 PK 详情 为 null 表示当前无进行中 PK
- @property (nonatomic, strong) XYChatRoomBattleRoomInModel *battleRoomIn;
- /// 房间内pk状态
- @property (nonatomic, assign) BOOL pkState;
- /// 解析获取用户完整信息
- /// @param dataDict 消息数据
- /// @param result 1左方 2右方
- - (void)parsePkRank:(NSDictionary *)dataDict result:(void(^)(int result))result;
- /// pk左边用户缓存数组
- @property (nonatomic, strong) NSMutableArray<XYPKProceedInfo *> *pkUserLeftCacheArrs;
- /// pk右边用户缓存数组
- @property (nonatomic, strong) NSMutableArray<XYPKProceedInfo *> *pkUserRightCacheArrs;
- /// pk左边排名数组
- @property (nonatomic, strong) NSMutableArray<XYPKProceedInfo *> *pkLeftVips;
- /// pk右边排名数组
- @property (nonatomic, strong) NSMutableArray<XYPKProceedInfo *> *pkRightVips;
- #pragma mark — ----房间PK
- #pragma mark — ----跨房Pk(相关属性方法用KF开头)
- /// 是否启用 跨房Pk功能,未启用不显示 跨房Pk相关的入口
- @property (nonatomic, assign) BOOL KFBattleEnabled;
- /// 跨房Pk状态 是否正在PK
- @property (nonatomic, assign) BOOL KFPkState;
- /// 跨房Pk匹配次数
- @property (nonatomic, assign) NSInteger KFPkMatchNumber;
- /// 跨房PK匹配状态
- @property (nonatomic, assign) XYVoiceRoomKFPKMatchState KFPKMatchState;
- /// 跨房PK信息
- @property (nonatomic, strong) XYChatRoomKFBattleRoomInModel *battleRoomCross;
- #pragma mark — ----跨房Pk
- #pragma mark — ----拍卖房
- /// 当前用户是否加入了拍卖麦序队列
- @property (nonatomic, assign) BOOL isJoinAuctionQueue;
- /// 当前拍卖麦序队列用户数量
- @property (nonatomic, assign) NSInteger auctionQueueUsersCount;
- /// 是否正在拍卖
- @property (nonatomic, assign) BOOL isAuctioning;
- /// 拍卖贡献榜(前三名)
- @property (nonatomic, strong) NSMutableArray<XYChatRoomAuctionRankItemModel *> *auctionRankArray;
- /// 拍卖位用户信息 nil这说明拍卖位没人
- @property (nonatomic, strong) XYChatRoomSeatsUserModel *auctionSeatUserModel;
- /// 拍卖信息
- @property (nonatomic, strong) XYChatRoomAuctionInfoModel *auctionInfoModel;
- @end
- @interface XYChatRoomBattleRoomInModel : NSObject
- @property (nonatomic, copy) NSString *roomId;
- @property (nonatomic, assign) NSInteger leftCampScore;
- @property (nonatomic, assign) NSInteger rightCampScore;
- /// 20 进行中 301已结束
- @property (nonatomic, assign) NSInteger battleStatus;
- @property (nonatomic, assign) NSInteger battleResult;
- @property (nonatomic, copy) NSString *battleId;
- @property (nonatomic, copy) NSString *topic;
- @property (nonatomic, copy) NSString *duration;
- @property (nonatomic, copy) NSString *createTime;
- @property (nonatomic, copy) NSString *finishTime;
- @end
- @interface XYChatRoomKFBattleRoomInModel : NSObject
- @property (nonatomic, copy) NSString *roomId;
- @property (nonatomic, copy) NSString *roomName;
- @property (nonatomic, copy) NSString *roomCover;
- @property (nonatomic, copy) NSString *targetRoomId;
- @property (nonatomic, copy) NSString *targetRoomCover;
- @property (nonatomic, copy) NSString *targetRoomName;
- @property (nonatomic, copy) NSString *battleId;
- @property (nonatomic, copy) NSString *topic;
- @property (nonatomic, copy) NSString *duration;
- @property (nonatomic, copy) NSString *createTime;
- @property (nonatomic, copy) NSString *finishTime;
- /// 客场静音状态 1开启收听 0关闭收听
- @property (nonatomic, assign) BOOL enableListen;
- /// 20 进行中 301已结束
- @property (nonatomic, assign) NSInteger battleStatus;
- @property (nonatomic, assign) NSInteger battleResult;
- @end
- @interface XYChatRoomAuctionInfoModel : NSObject
- @property (nonatomic, copy) NSString *roomId;
- /// 被拍卖用户id
- @property (nonatomic, copy) NSString *bidUserId;
- @property (nonatomic, copy) NSString *bidUserName;
- @property (nonatomic, copy) NSString *bidUserAvatar;
- /// 拍卖物品id
- @property (nonatomic, copy) NSString *bidItemId;
- /// 拍卖物品名称
- @property (nonatomic, copy) NSString *bidItemName;
- /// 拍卖时长(单位:天)
- @property (nonatomic, assign) NSInteger bidDuration;
- /// 起拍礼物id
- @property (nonatomic, copy) NSString *startingGiftId;
- /// 起拍礼物名称
- @property (nonatomic, copy) NSString *startingGiftName;
- /// 起拍礼物图标
- @property (nonatomic, copy) NSString *startingGiftIcon;
- /// 起拍礼物价格
- @property (nonatomic, copy) NSString *startingGiftPrice;
- /// 竞拍用户id
- @property (nonatomic, copy) NSString *winUserId;
- @property (nonatomic, copy) NSString *winUserName;
- @property (nonatomic, copy) NSString *winUserAvatar;
- /// 竞拍结果 1:中标、2:流拍
- @property (nonatomic, assign) NSInteger status;
- @property (nonatomic, copy) NSString *timestamp;
- @end
- NS_ASSUME_NONNULL_END
|