api.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. syntax = "proto3";
  2. package live.daoanchor.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. message AnchorLevel {
  6. // 当前等级
  7. int64 level = 1;
  8. // 当前等级颜色
  9. int64 color = 2;
  10. // 当前积分
  11. int64 score = 3;
  12. // 当前等级最小积分
  13. int64 left = 4;
  14. // 当前等级最大积分
  15. int64 right = 5;
  16. // 最大等级
  17. int64 max_level = 6;
  18. }
  19. message TagData {
  20. int64 tag_id = 1;
  21. int64 tag_sub_id = 2;
  22. int64 tag_value = 3;
  23. string tag_ext = 4;
  24. int64 tag_expire_at = 5;
  25. }
  26. message RoomData {
  27. int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  28. int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  29. int64 short_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  30. string title = 4 [(gogoproto.moretags) = "validate:\"required\""];
  31. string cover = 5;
  32. string tags = 6;
  33. string background = 7;
  34. string description = 8;
  35. int64 live_status = 9 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  36. int64 live_start_time = 10 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  37. int64 live_screen_type = 11 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  38. int64 live_mark = 12;
  39. int64 lock_status = 13;
  40. int64 lock_time = 14;
  41. int64 hidden_status = 15 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  42. int64 hidden_time = 16;
  43. int64 area_id = 17 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  44. string area_name = 18 [(gogoproto.moretags) = "validate:\"required\""];
  45. int64 parent_area_id = 19 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  46. string parent_area_name = 20 [(gogoproto.moretags) = "validate:\"required\""];
  47. string keyframe = 21;
  48. int64 popularity_count = 22;
  49. repeated TagData tag_list = 23;
  50. int64 anchor_profile_type = 25;
  51. AnchorLevel anchor_level = 26;
  52. int64 anchor_round_switch = 27;
  53. int64 anchor_round_status = 28;
  54. int64 anchor_record_switch = 29;
  55. int64 anchor_record_status = 30;
  56. int64 anchor_san = 31;
  57. // 0默认 1摄像头直播 2录屏直播 3语音直播
  58. int64 live_type = 32;
  59. }
  60. message RoomByIDsReq {
  61. repeated int64 room_ids = 1;
  62. repeated int64 uids = 2;
  63. repeated string fields = 3;
  64. int64 default_fields = 4;
  65. }
  66. message RoomByIDsResp {
  67. map<int64, RoomData> room_data_set = 1;
  68. }
  69. message RoomOnlineListReq {
  70. string filter = 1;
  71. string sort = 2;
  72. int64 page = 3;
  73. int64 page_size = 4;
  74. repeated string fields = 5;
  75. }
  76. message RoomOnlineListResp {
  77. map<int64, RoomData> room_data_list = 1;
  78. }
  79. message RoomOnlineListByAreaReq {
  80. repeated int64 area_ids = 1;
  81. }
  82. message RoomOnlineListByAreaResp {
  83. repeated int64 room_ids = 1;
  84. }
  85. message RoomCreateReq {
  86. int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  87. int64 room_id = 2;
  88. }
  89. message RoomCreateResp {
  90. int64 room_id = 1;
  91. }
  92. message UpdateResp {
  93. int64 affected_rows = 1;
  94. }
  95. message RoomUpdateReq {
  96. repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
  97. int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  98. string title = 3;
  99. string cover = 4;
  100. string tags = 5;
  101. string background = 6;
  102. string description = 7;
  103. int64 live_start_time = 8;
  104. int64 live_screen_type = 9;
  105. int64 lock_status = 10;
  106. int64 lock_time = 11;
  107. int64 hidden_time = 12;
  108. int64 area_id = 13;
  109. int64 anchor_round_switch = 14;
  110. int64 anchor_record_switch = 15;
  111. int64 live_type = 16;
  112. }
  113. message RoomBatchUpdateReq {
  114. repeated RoomUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
  115. }
  116. message AnchorUpdateReq {
  117. repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
  118. int64 uid = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  119. int64 profile_type = 3;
  120. int64 san_score = 4;
  121. int64 round_status = 5;
  122. int64 record_status = 6;
  123. int64 exp = 7;
  124. }
  125. message AnchorBatchUpdateReq {
  126. repeated AnchorUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
  127. }
  128. message AnchorIncreReq {
  129. string req_id = 1 [(gogoproto.moretags) = "validate:\"required\""];
  130. repeated string fields = 2 [(gogoproto.moretags) = "validate:\"required\""];
  131. int64 uid = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  132. int64 san_score = 4;
  133. int64 exp = 5;
  134. }
  135. message AnchorBatchIncreReq {
  136. repeated AnchorIncreReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
  137. }
  138. message RoomExtendUpdateReq {
  139. repeated string fields = 1 [(gogoproto.moretags) = "validate:\"required\""];
  140. int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  141. string keyframe = 3;
  142. int64 danmu_count = 4;
  143. int64 popularity_count = 5;
  144. int64 audience_count = 6;
  145. int64 gift_count = 7;
  146. int64 gift_gold_amount = 8;
  147. int64 gift_gold_count = 9;
  148. }
  149. message RoomExtendBatchUpdateReq {
  150. repeated RoomExtendUpdateReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
  151. }
  152. message RoomExtendIncreReq {
  153. string req_id = 1 [(gogoproto.moretags) = "validate:\"required\""];
  154. repeated string fields = 2 [(gogoproto.moretags) = "validate:\"required\""];
  155. int64 room_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  156. int64 danmu_count = 4;
  157. int64 popularity_count = 5;
  158. int64 audience_count = 6;
  159. int64 gift_count = 7;
  160. int64 gift_gold_amount = 8;
  161. int64 gift_gold_count = 9;
  162. }
  163. message RoomExtendBatchIncreReq {
  164. repeated RoomExtendIncreReq reqs = 1 [(gogoproto.moretags) = "validate:\"required\""];
  165. }
  166. message RoomTagCreateReq {
  167. int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  168. int64 tag_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  169. int64 tag_sub_id = 3;
  170. int64 tag_value = 4;
  171. string tag_ext = 5;
  172. int64 tag_expire_at = 6;
  173. }
  174. message RoomAttrCreateReq {
  175. int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  176. int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  177. int64 attr_sub_id = 3;
  178. int64 attr_value = 4;
  179. string attr_ext = 5;
  180. }
  181. message RoomAttrSetExReq {
  182. int64 room_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  183. int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  184. int64 attr_sub_id = 3;
  185. int64 attr_value = 4;
  186. string attr_ext = 5;
  187. }
  188. message FetchAreasReq {
  189. int64 area_id = 1;
  190. }
  191. message AreaInfo {
  192. int64 area_id = 1;
  193. string area_name = 2;
  194. }
  195. message FetchAreasResp {
  196. AreaInfo info = 1;
  197. repeated AreaInfo areas = 2;
  198. }
  199. message FetchAttrByIDsReq {
  200. repeated int64 room_ids = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  201. int64 attr_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  202. int64 attr_sub_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  203. }
  204. message AttrData {
  205. int64 room_id = 1;
  206. int64 attr_id = 2;
  207. int64 attr_sub_id = 3;
  208. int64 attr_value = 4;
  209. }
  210. message FetchAttrByIDsResp {
  211. map<int64, AttrData> attrs = 1;
  212. }
  213. message AttrReq {
  214. int64 attr_id = 1;
  215. int64 attr_sub_id = 2;
  216. }
  217. message RoomOnlineListByAttrsReq {
  218. repeated AttrReq attrs = 1;
  219. }
  220. message AttrResp {
  221. int64 uid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  222. int64 room_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  223. int64 area_id = 3 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  224. int64 parent_area_id = 4 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  225. repeated TagData tag_list = 5;
  226. repeated AttrData attr_list = 6;
  227. int64 popularity_count = 7;
  228. int64 anchor_profile_type = 8;
  229. }
  230. message RoomOnlineListByAttrsResp {
  231. map<int64, AttrResp> attrs = 1;
  232. }
  233. message DeleteAttrReq {
  234. int64 attr_id = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  235. int64 attr_sub_id = 2 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  236. }
  237. service DaoAnchor {
  238. // FetchRoomByIDs 查询房间信息
  239. rpc FetchRoomByIDs(RoomByIDsReq) returns (RoomByIDsResp);
  240. // RoomOnlineList 在线房间列表
  241. rpc RoomOnlineList(RoomOnlineListReq) returns (RoomOnlineListResp);
  242. // RoomOnlineListByArea 分区在线房间列表(只返回room_id列表,不传分区,默认查找所有)
  243. rpc RoomOnlineListByArea(RoomOnlineListByAreaReq) returns (RoomOnlineListByAreaResp);
  244. // RoomOnlineListByAttrs 在线房间维度信息(不传attrs,不查询attr)
  245. rpc RoomOnlineListByAttrs(RoomOnlineListByAttrsReq) returns (RoomOnlineListByAttrsResp);
  246. // RoomCreate 房间创建
  247. rpc RoomCreate(RoomCreateReq) returns (RoomCreateResp);
  248. // RoomUpdate 房间信息更新
  249. rpc RoomUpdate(RoomUpdateReq) returns (UpdateResp);
  250. // RoomBatchUpdate 房间信息批量更新
  251. rpc RoomBatchUpdate(RoomBatchUpdateReq) returns (UpdateResp);
  252. // RoomExtendUpdate 房间扩展信息更新
  253. rpc RoomExtendUpdate(RoomExtendUpdateReq) returns (UpdateResp);
  254. // RoomExtendBatchUpdate 房间扩展信息批量更新
  255. rpc RoomExtendBatchUpdate(RoomExtendBatchUpdateReq) returns (UpdateResp);
  256. // RoomExtendIncre 房间信息增量更新
  257. rpc RoomExtendIncre(RoomExtendIncreReq) returns (UpdateResp);
  258. // RoomExtendBatchIncre 房间信息批量增量更新
  259. rpc RoomExtendBatchIncre(RoomExtendBatchIncreReq) returns (UpdateResp);
  260. // RoomTagCreate 房间Tag创建
  261. rpc RoomTagCreate(RoomTagCreateReq) returns (UpdateResp);
  262. // RoomAttrCreate 房间Attr创建
  263. rpc RoomAttrCreate(RoomAttrCreateReq) returns (UpdateResp);
  264. // RoomAttrSetEx 房间Attr更新
  265. rpc RoomAttrSetEx(RoomAttrSetExReq) returns (UpdateResp);
  266. // AnchorUpdate 主播信息更新
  267. rpc AnchorUpdate(AnchorUpdateReq) returns (UpdateResp);
  268. // AnchorBatchUpdate 主播信息批量更新
  269. rpc AnchorBatchUpdate(AnchorBatchUpdateReq) returns (UpdateResp);
  270. // AnchorIncre 主播信息增量更新
  271. rpc AnchorIncre(AnchorIncreReq) returns (UpdateResp);
  272. // AnchorBatchIncre 主播信息批量增量更新
  273. rpc AnchorBatchIncre(AnchorBatchIncreReq) returns (UpdateResp);
  274. // FetchAreas 根据父分区号查询子分区
  275. rpc FetchAreas(FetchAreasReq) returns (FetchAreasResp);
  276. // FetchAttrByIDs 批量根据房间号查询指标
  277. rpc FetchAttrByIDs(FetchAttrByIDsReq) returns (FetchAttrByIDsResp);
  278. // DeleteAttr 删除某一个指标
  279. rpc DeleteAttr(DeleteAttrReq) returns (UpdateResp);
  280. }