房间优化 1
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -9,7 +11,7 @@ import lombok.Data;
|
||||
*@description:发布头条需要的参数
|
||||
*/
|
||||
@Data
|
||||
public class HeadlineBean implements Serializable {
|
||||
public class HeadlineBean extends BaseEvent implements Serializable {
|
||||
private String countdown;
|
||||
private String now_money;
|
||||
private String next_money;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MqttXlhEnd implements Serializable {
|
||||
public class MqttXlhEnd extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@@ -27,21 +27,21 @@ public class RoomMessageEvent {
|
||||
public static class T {
|
||||
private String text;
|
||||
private String GiftNum;
|
||||
private String pit_number;
|
||||
private String jia_jia;
|
||||
private UserInfo FromUserInfo;
|
||||
private UserInfo ToUserInfo;
|
||||
private List<UserInfo> ToUserInfos;
|
||||
private String pit_number;//麦位
|
||||
private String jia_jia;//坐骑
|
||||
private UserInfo FromUserInfo;//从me
|
||||
private UserInfo ToUserInfo;// 到you
|
||||
private List<UserInfo> ToUserInfos;//一键发送礼物
|
||||
private GiftBean GiftInfo;
|
||||
private List<GiftBean> GiftInfos;
|
||||
private int room_up_pit_type;
|
||||
private MusicSongBean songInfo;
|
||||
private MusicSongBean nextInfo;
|
||||
private int action;
|
||||
private int total;
|
||||
private RoomBean RoomInfo;
|
||||
private RoomAuction.AuctionUserBean auction_user;
|
||||
private List<RoomAuction.AuctionListBean> auction_list;
|
||||
private int room_up_pit_type;//1:上麦、0:下麦
|
||||
private MusicSongBean songInfo; //正在播放歌曲信息
|
||||
private MusicSongBean nextInfo; //下一首歌曲信息
|
||||
private int action; //切歌
|
||||
private int total; //
|
||||
private RoomBean RoomInfo; //房间信息
|
||||
private RoomAuction.AuctionUserBean auction_user; //拍卖信息
|
||||
private List<RoomAuction.AuctionListBean> auction_list; //拍卖列表
|
||||
private long duration;//时间
|
||||
private RoomAuction.AuctionListBean recipient;//是否成功,有值的是成功的,没有值的时候,是失败的
|
||||
private int type;//拍卖者,1:上麦、2:下麦
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/3
|
||||
*@description: 个人信息,点击我的获取
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class UserInfo implements Serializable {
|
||||
public class UserInfo extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String FEMALE = "2";
|
||||
public static final String MALE = "1";
|
||||
|
||||
@@ -75,10 +75,10 @@ public class RoomBean implements Serializable {
|
||||
private String room_name;//房间名称
|
||||
private String room_cover;//房间封面
|
||||
private String room_intro;//房间公告
|
||||
private String type_id;//房间类型
|
||||
private String type_id;//房间类型 1:点唱(pk) 2:拍卖(真爱拍小黑屋) 3/4:交友 6:小黑屋 7:互娱 8:交友
|
||||
private String type_name;//房间类型名称
|
||||
private String user_id;//房主id
|
||||
private String label_id;//类型id
|
||||
private String label_id;//类型id 2:ktv type:1/3/4/8
|
||||
private String label_icon;//房间类型图标
|
||||
private String room_background;//房间背景
|
||||
private String hot_value;//房间火热值
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.xscm.moduleutil.enumType
|
||||
|
||||
/**
|
||||
* 房间类型枚举
|
||||
* 对应 type_id 含义:
|
||||
* 2-拍卖(真爱拍小黑屋);1/3/4/8-交友;6-小黑屋;7-互娱
|
||||
*/
|
||||
enum class RoomType(
|
||||
val description: String, // 房间类型描述
|
||||
private vararg val typeIds: Int // 该类型对应的所有 type_id(支持多个)
|
||||
) {
|
||||
// 枚举常量:名称(描述, 对应的type_id)
|
||||
// SINGING_PK("点唱(pk)", 1),
|
||||
AUCTION("拍卖(真爱拍小黑屋)", 2),
|
||||
DATING("交友", 1,3, 4, 8), // 1、3、4、8 均对应交友
|
||||
BLACK_ROOM("小黑屋", 6),
|
||||
MUTUAL_ENTERTAINMENT("互娱", 7);
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 根据 type_id 字符串获取对应的枚举实例
|
||||
* @param typeIdStr 房间类型字符串(如 "1"、"3")
|
||||
* @return 匹配的 RoomType,若无效则返回 null
|
||||
*/
|
||||
fun fromTypeId(typeIdStr: String?): RoomType? {
|
||||
if (typeIdStr.isNullOrBlank()) return null
|
||||
val typeId = try {
|
||||
typeIdStr.toInt() // 转换为 Int(处理数字字符串)
|
||||
} catch (e: NumberFormatException) {
|
||||
return null // 非数字字符串视为无效
|
||||
}
|
||||
// 遍历所有枚举,匹配 type_id
|
||||
return values().find { typeId in it.typeIds }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user