admin_pb.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package proto
  2. import (
  3. "strings"
  4. )
  5. // 参数请求 - 后台
  6. type AdminRequest struct {
  7. UserId int `json:",omitempty"` // 用户id
  8. RoomId int `json:",omitempty"` // 房间id
  9. RoomName string `json:",omitempty"` // 房间名称
  10. NickName string `json:",omitempty"` // 用户昵称
  11. BlackType int `json:",omitempty"` // 黑名单的类型(1:房间,2:麦位)
  12. PageIndex int `json:",omitempty"` // 第几页
  13. PageSize int `json:",omitempty"` // 请求的数量
  14. SortName string `json:",omitempty"` // 排序名称
  15. SortType string `json:",omitempty"` // 排序类型
  16. SysFlag bool // true:系统,false:用户
  17. }
  18. // 返回值 - 后台
  19. type AdminResponse struct {
  20. Data string `json:",omitempty"`
  21. RecordCount int `json:",omitempty"`
  22. List interface{}
  23. }
  24. // 是否没包含名称
  25. func IsNotContainName(searchKey string, searchKeyId int, toName string) bool {
  26. return searchKey != "" && searchKeyId == 0 && !strings.Contains(toName, searchKey)
  27. }
  28. // 是否没包含id
  29. func IsNotContainId(searchKey string, searchKeyId, toId int) bool {
  30. return searchKey == "" && searchKeyId > 0 && toId != searchKeyId
  31. }
  32. // 房间信息 - 后台
  33. type AdminRoomInfo struct {
  34. RoomName string // 房间名称
  35. UserId int // 用户id
  36. NickName string // 用户昵称
  37. Level int // 等级
  38. Exps int // 经验值
  39. MemberCount int // 成员数量
  40. RoomExpend
  41. Crdate string // 创建日期
  42. }
  43. // 房间的消耗 - 后台
  44. type RoomExpend struct {
  45. RoomId int // 房间ID
  46. CollectDiamond int // 钻石收益
  47. DiamondAmount int // 钻石消耗数量
  48. CollectGold int // 金币收益
  49. GoldAmount int // 金币消耗数量
  50. }
  51. // 语聊房详细信息 - 后台
  52. type AdminRoomDetail struct {
  53. RoomName string // 房间名称
  54. RoomImg string // 房间图片
  55. Family string // 家族
  56. Country string // 国家
  57. Language string // 语言
  58. JoinFee int // 入会费
  59. Announce string // 公告
  60. Tag string // 标签
  61. MemberCount int // 成员数量
  62. Crdate string // 创建时间
  63. Level int // 等级
  64. Exps int // 经验值
  65. MicInfo string `json:",omitempty"` // 麦位的信息
  66. UpMicCount int // 上麦的数量
  67. RoomExpend
  68. OnlineCount int // 在线人数
  69. CumulativeDuration int // 累计时长 - 暂不支持
  70. }
  71. // 获取麦位的数量 - 后台
  72. func AdminGetUpMicCount(mics []MicInfo) int {
  73. var count int
  74. for _, v := range mics {
  75. if v.UserId == 0 {
  76. continue
  77. }
  78. count++
  79. }
  80. return count
  81. }
  82. // 语聊房黑名单 - 后台
  83. type AdminRoomBlackList struct {
  84. UserID int // 用户id
  85. NickName string // 用户昵称
  86. RoleID int // 角色ID(0=关注 1=管理员 2=助理 3=成员)
  87. Level int // 等级
  88. ExpireTime int // 过期时间戳
  89. Crdate string // 创建时间
  90. }
  91. // 语聊房成员 - 后台
  92. type AdminRoomMember struct {
  93. RoomID int // 房间ID
  94. UserID int // 用户ID
  95. NickName string // 用户昵称
  96. RoleID int // 用户身份
  97. Exps int // 经验值
  98. Level int // 用户等级
  99. Crdate string // 创建时间
  100. }
  101. // 语聊房麦位 - 后台
  102. type AdminRoomMic struct {
  103. UserID int // 用户ID
  104. NickName string // 用户昵称
  105. RoleID int // 用户身份
  106. Level int // 用户等级
  107. MicNum int // 麦位编号
  108. UpMicType int // 上麦类型 - 暂不支持
  109. UpMicTime string // 上麦时间
  110. }
  111. // 房内操作日志
  112. type AdminRoomLogRecord struct {
  113. RoomID int // 房间ID
  114. UserID int // 用户ID
  115. NickName string // 用户昵称
  116. ToUserID int // 对象用户ID
  117. ToNickName string // 对象用户昵称
  118. OperateType int // 操作类型(11=踢麦 21=禁麦 22=解麦 31=添加房间黑名单 32=移除房间黑名单)
  119. Crdate string // 创建时间
  120. }
  121. // 房间任务列表
  122. type AdminRoomTask struct {
  123. RoomID int // 房间ID
  124. TaskID int // 任务ID
  125. TaskName string // 任务名称
  126. Schedule int // 进度
  127. CurrNum int // 当前数值
  128. UpdateTime string // 更新时间
  129. }
  130. // 用户的房间任务
  131. type AdminUserRoomTask struct {
  132. UserID int // 用户id
  133. RoomID int // 房间id
  134. TaskID int // 任务id
  135. TaskName string // 任务名称
  136. Schedule int // 进度
  137. CurrNum int // 当前数值
  138. Status int // 状态(0=进行中 1=完成)
  139. UpdateTime string // 更新的时间
  140. }
  141. // 房间上下麦日志
  142. type AdminRoomMicLog struct {
  143. RoomID int // 房间ID
  144. RoomName string // 房间名称
  145. UserID int // 用户ID
  146. NickName string // 用户昵称
  147. RoleID int // 用户身份 【角色ID】 (0=关注 1=管理员 2=助理 3=成员)
  148. MicMode int // 麦位模式(上麦方式)
  149. OnMicTime string // 上麦时间
  150. OffMicTime string // 下麦时间
  151. Seconds int // 时长
  152. OpUserID int // 操作人ID
  153. OpUserRoleID int // 操作人身份 【角色ID】 (0=关注 1=管理员 2=助理 3=成员)
  154. }