service.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. syntax = "proto3";
  2. package live.appucenter.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // History 相关服务
  6. service RoomAdmin {
  7. // 根据登录态获取功能入口是否显示, 需要登录态
  8. // `method:"GET" midware:"auth"`
  9. rpc is_any (ShowEntryReq) returns (ShowEntryResp);
  10. // 获取用户拥有的的所有房管身份
  11. // `method:"GET" midware:"auth"`
  12. rpc get_by_uid (RoomAdminGetByUidReq) returns (RoomAdminGetByUidResp);
  13. // 辞职房管
  14. // `method:"POST" midware:"auth"`
  15. rpc resign (RoomAdminResignRoomAdminReq) returns (RoomAdminResignRoomAdminResp);
  16. // 查询需要添加的房管
  17. // `method:"POST" midware:"auth"`
  18. rpc search_for_admin (RoomAdminSearchForAdminReq) returns (RoomAdminSearchForAdminResp);
  19. // 获取主播拥有的的所有房管
  20. // `method:"GET" midware:"auth"`
  21. rpc get_by_anchor (RoomAdminGetByAnchorReq) returns (RoomAdminGetByAnchorResp);
  22. // 撤销房管
  23. // `method:"POST" midware:"auth"`
  24. rpc dismiss (RoomAdminDismissAdminReq) returns (RoomAdminDismissAdminResp);
  25. // 任命房管
  26. // `method:"POST" midware:"auth"`
  27. rpc appoint (RoomAdminAddReq) returns (RoomAdminAddResp);
  28. }
  29. // 历史记录请求参数定义
  30. message ShowEntryReq {
  31. }
  32. // 获取接口返回响应
  33. message ShowEntryResp {
  34. // 是否有房管
  35. int64 has_admin = 1;
  36. }
  37. message RoomAdminSearchForAdminReq {
  38. string key_word = 1 [(gogoproto.moretags) = 'form:"key_word" validate:"required"'];
  39. }
  40. message RoomAdminSearchForAdminResp {
  41. repeated Data data = 3 [(gogoproto.jsontag) = "data"];
  42. message Data {
  43. // 用户id
  44. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  45. // 是否房管
  46. int64 is_admin = 2 [(gogoproto.jsontag) = "is_admin"];
  47. // 用户名
  48. string uname = 4 [(gogoproto.jsontag) = "uname"];
  49. // 用户头像
  50. string face = 5 [(gogoproto.jsontag) = "face"];
  51. // 粉丝勋章名称
  52. string medal_name = 6 [(gogoproto.jsontag) = "medal_name"];
  53. // 粉丝勋章等级
  54. int64 level = 7 [(gogoproto.jsontag) = "level"];
  55. }
  56. }
  57. message RoomAdminResignRoomAdminReq {
  58. // 房间号
  59. int64 roomid = 1 [(gogoproto.moretags) = 'form:"roomid" validate:"required"'];
  60. }
  61. message RoomAdminResignRoomAdminResp {
  62. }
  63. message RoomAdminGetByUidReq {
  64. // 页数
  65. int64 page = 1 [(gogoproto.moretags) = 'form:"page"'];
  66. }
  67. message RoomAdminGetByUidResp {
  68. //
  69. Page page = 1;
  70. //
  71. repeated Data data = 3 [(gogoproto.jsontag) = "data"];
  72. message Data {
  73. // 用户id
  74. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  75. // 房间号
  76. int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
  77. // 主播的用户id
  78. int64 anchor_id = 3 [(gogoproto.jsontag) = "anchor_id"];
  79. // 主播用户名
  80. string uname = 4 [(gogoproto.jsontag) = "uname"];
  81. // 主播封面
  82. string anchor_cover = 5 [(gogoproto.jsontag) = "anchor_cover"];
  83. // 上任时间
  84. string ctime = 6 [(gogoproto.jsontag) = "ctime"];
  85. }
  86. message Page {
  87. // 当前页码
  88. int64 page = 1;
  89. // 每页大小
  90. int64 page_size = 2;
  91. // 总页数
  92. int64 total_page = 3;
  93. // 总记录数
  94. int64 total_count = 4;
  95. }
  96. }
  97. message RoomAdminGetByAnchorReq {
  98. // 页数
  99. int64 page = 1 [(gogoproto.moretags) = 'form:"page"'];
  100. }
  101. message RoomAdminGetByAnchorResp {
  102. //
  103. Page page = 1;
  104. //
  105. repeated Data data = 3 [(gogoproto.jsontag) = "data"];
  106. message Data {
  107. // 用户id
  108. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  109. // 用户名
  110. string uname = 4 [(gogoproto.jsontag) = "uname"];
  111. // 用户头像
  112. string face = 5 [(gogoproto.jsontag) = "face"];
  113. // 上任时间
  114. string ctime = 6 [(gogoproto.jsontag) = "ctime"];
  115. // 粉丝勋章名称
  116. string medal_name = 8 [(gogoproto.jsontag) = "medal_name"];
  117. // 粉丝勋章等级
  118. int64 level = 9 [(gogoproto.jsontag) = "level"];
  119. }
  120. message Page {
  121. // 当前页码
  122. int64 page = 1;
  123. // 每页大小
  124. int64 page_size = 2;
  125. // 总页数
  126. int64 total_page = 3;
  127. // 总记录数
  128. int64 total_count = 4;
  129. }
  130. }
  131. message RoomAdminDismissAdminReq {
  132. // 房管的用户uid
  133. int64 uid = 1 [(gogoproto.moretags) = 'form:"uid" validate:"required"'];
  134. }
  135. message RoomAdminDismissAdminResp {
  136. }
  137. message RoomAdminAddReq {
  138. // 房管的uid
  139. int64 uid = 1 [(gogoproto.moretags) = 'form:"uid" validate:"required"'];
  140. }
  141. message RoomAdminAddResp {
  142. message UI {
  143. // 用户id
  144. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  145. // 用户名
  146. string uname = 2 [(gogoproto.jsontag) = "uname"];
  147. }
  148. // banner
  149. UI userinfo = 1 [(gogoproto.jsontag) = "userinfo"];
  150. // 房管的用户id
  151. int64 uid = 2 [(gogoproto.jsontag) = "uid"];
  152. // 房间号
  153. int64 roomid = 3 [(gogoproto.jsontag) = "roomid"];
  154. // 创建时间 "2017-07-26 17:12:51"
  155. string ctime = 4 [(gogoproto.jsontag) = "ctime"];
  156. }