index.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. syntax = "proto3";
  2. package live.appinterface.v2;
  3. option go_package = "v2";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // Index 相关服务
  6. service Index {
  7. // 首页大接口
  8. // `midware:"guest,verify"`
  9. rpc getAllList (GetAllListReq) returns (GetAllListResp);
  10. // 换一换接口
  11. // `midware:"guest,verify"`
  12. rpc change (ChangeReq) returns (ChangeResp);
  13. }
  14. // 接口1:GetAllList
  15. message GetAllListReq {
  16. // 平台
  17. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  18. // 设备
  19. string device = 2 [(gogoproto.moretags) = 'form:"device" validate:"required"'];
  20. // 分辨率
  21. string scale = 3 [(gogoproto.moretags) = 'form:"scale" validate:"required"'];
  22. // 版本号
  23. int64 build = 4 [(gogoproto.moretags) = 'form:"build" validate:"required"'];
  24. //关注页码
  25. int64 relation_page = 5 [(gogoproto.moretags) = 'form:"relation_page" validate:"required"'];
  26. //推荐页码 当前推荐页(用于天马强推),不传默认按1处理
  27. int64 rec_page = 6 [(gogoproto.moretags) = 'form:"rec_page"'];
  28. int64 quality = 7 [(gogoproto.moretags) = 'form:"quality"'];
  29. }
  30. // GetAllList响应
  31. message GetAllListResp {
  32. //刷新重新请求间隔
  33. int64 interval = 1 [(gogoproto.jsontag) = 'interval'];
  34. //是否命中天马灰度
  35. int64 is_sky_horse_gray = 2 [(gogoproto.jsontag) = 'is_sky_horse_gray'];
  36. //banner类型
  37. repeated MBanner banner = 3 [(gogoproto.jsontag) = 'banner'];
  38. //常用标签类型
  39. repeated MMyTag my_tag = 4 [(gogoproto.jsontag) = 'my_tag'];
  40. //分区入口类型
  41. repeated MAreaEntrance area_entrance = 5 [(gogoproto.jsontag) = 'area_entrance'];
  42. //大航海提示类型
  43. repeated MSeaPatrol sea_patrol = 6 [(gogoproto.jsontag) = 'sea_patrol'];
  44. //我的关注类型
  45. repeated MMyIdol my_idol = 7 [(gogoproto.jsontag) = 'my_idol'];
  46. //通用房间列表类型
  47. repeated MRoomBlock room_list = 8 [(gogoproto.jsontag) = 'room_list'];
  48. //小时榜类型
  49. repeated MHourRank hour_rank = 9 [(gogoproto.jsontag) = 'hour_rank'];
  50. //活动卡
  51. repeated MActivityCard activity_card = 10 [(gogoproto.jsontag) = 'activity_card'];
  52. }
  53. // module define begin
  54. // banner banner位
  55. message MBanner {
  56. // 模块信息
  57. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  58. // 模块列表
  59. repeated PicItem list = 2 [(gogoproto.jsontag) = 'list'];
  60. }
  61. // MyTag 常用标签
  62. message MMyTag {
  63. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  64. MyTagExtra extra_info = 2 [(gogoproto.jsontag) = 'extra_info'];
  65. repeated MyTagItem list = 3 [(gogoproto.jsontag) = 'list'];
  66. }
  67. // AreaEntrance 分区入口
  68. message MAreaEntrance {
  69. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  70. repeated PicItem list = 2 [(gogoproto.jsontag) = 'list'];
  71. }
  72. // SeaPatrol 大航海提示
  73. message MSeaPatrol {
  74. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  75. PicItem extra_info = 2 [(gogoproto.jsontag) = 'extra_info'];
  76. }
  77. // MyIdol 我的关注
  78. message MMyIdol {
  79. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  80. MyIdolExtra extra_info = 2 [(gogoproto.jsontag) = 'extra_info'];
  81. repeated MyIdolItem list = 3 [(gogoproto.jsontag) = 'list'];
  82. }
  83. // RoomList 房间列表
  84. message MRoomBlock {
  85. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  86. repeated CommonRoomItem list = 3 [(gogoproto.jsontag) = 'list'];
  87. }
  88. // MHourRank 小时榜
  89. message MHourRank {
  90. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  91. HourRankExtra extra_info = 2 [(gogoproto.jsontag) = 'extra_info'];
  92. repeated HourRankItem list = 3 [(gogoproto.jsontag) = 'list'];
  93. }
  94. // MActivityCard 活动卡
  95. message MActivityCard {
  96. ModuleInfo module_info = 1 [(gogoproto.jsontag) = 'module_info'];
  97. repeated ActivityCardItem list = 2 [(gogoproto.jsontag) = 'list'];
  98. }
  99. // ...
  100. // ModuleInfo
  101. message ModuleInfo {
  102. // 模块id
  103. int64 id = 1 [(gogoproto.jsontag) = 'id'];
  104. // 模块跳转链接
  105. string link = 2 [(gogoproto.jsontag) = 'link'];
  106. // 模块图标
  107. string pic = 3 [(gogoproto.jsontag) = 'pic'];
  108. // 模块标题
  109. string title = 4 [(gogoproto.jsontag) = 'title'];
  110. // 模块类型 1: banner 2: 导航栏 3: 运营推荐分区-标准 4: 运营推荐分区-方 5:排行榜(小时榜) 6: 推荐主播-标准 7: 推荐主播-方 8:我的关注(用户相关) 9:一级分区-标准 10:一级分区-方 11: 活动卡片 12:常用标签推荐入口(用户相关) 13:常用标签推荐房间列表(用户相关) 14:大航海提示入口
  111. int64 type = 5 [(gogoproto.jsontag) = 'type'];
  112. // 模块排序值
  113. int64 sort = 6 [(gogoproto.jsontag) = 'sort'];
  114. // 模块数据源数量,按需、目前只有推荐有,其它模块都是默认值0
  115. int64 count = 7 [(gogoproto.jsontag) = 'count'];
  116. }
  117. // PicItem 比如banner、分区入口、大航海提示等等
  118. message PicItem {
  119. //唯一标识id
  120. int64 id = 1 [(gogoproto.jsontag) = 'id'];
  121. //跳转url
  122. string link = 2 [(gogoproto.jsontag) = 'link'];
  123. //图片url
  124. string pic = 3 [(gogoproto.jsontag) = 'pic'];
  125. //标题
  126. string title = 4 [(gogoproto.jsontag) = 'title'];
  127. //内容
  128. string content = 5 [(gogoproto.jsontag) = 'content'];
  129. }
  130. // MyTagItem
  131. message MyTagItem {
  132. int64 area_v2_id = 1 [(gogoproto.jsontag) = 'area_v2_id'];
  133. string area_v2_name = 2 [(gogoproto.jsontag) = 'area_v2_name'];
  134. int64 area_v2_parent_id = 3 [(gogoproto.jsontag) = 'area_v2_parent_id'];
  135. string area_v2_parent_name = 4 [(gogoproto.jsontag) = 'area_v2_parent_name'];
  136. string pic = 5 [(gogoproto.jsontag) = 'pic'];
  137. string link = 6 [(gogoproto.jsontag) = 'link'];
  138. int64 is_advice = 7 [(gogoproto.jsontag) = 'is_advice'];
  139. }
  140. // MyTagExtra
  141. message MyTagExtra {
  142. //是否命中常用标签灰度
  143. int64 is_gray = 1 [(gogoproto.jsontag) = 'is_gray'];
  144. //offline已下线标签
  145. repeated OfflineTag offline = 2 [(gogoproto.jsontag) = 'offline'];
  146. }
  147. // OfflineTag
  148. message OfflineTag {
  149. int64 id = 1 [(gogoproto.jsontag) = 'id'];
  150. string area_v2_name = 2 [(gogoproto.jsontag) = 'area_v2_name'];
  151. }
  152. // MyIdolExtra
  153. message MyIdolExtra {
  154. int64 total_count = 1 [(gogoproto.jsontag) = 'total_count'];
  155. string time_desc = 2 [(gogoproto.jsontag) = 'time_desc'];
  156. string uname_desc = 3 [(gogoproto.jsontag) = 'uname_desc'];
  157. string tags_desc = 4 [(gogoproto.jsontag) = 'tags_desc'];
  158. int64 card_type = 5 [(gogoproto.jsontag) = 'card_type'];
  159. int64 relation_page = 6 [(gogoproto.jsontag) = 'relation_page'];
  160. }
  161. // MyIdolItem
  162. message MyIdolItem {
  163. int64 roomid = 1 [(gogoproto.jsontag) = 'roomid'];
  164. int64 uid = 2 [(gogoproto.jsontag) = 'uid'];
  165. string uname = 3 [(gogoproto.jsontag) = 'uname'];
  166. string face = 4 [(gogoproto.jsontag) = 'face'];
  167. string cover = 5 [(gogoproto.jsontag) = 'cover'];
  168. string title = 6 [(gogoproto.jsontag) = 'title'];
  169. int64 area = 7 [(gogoproto.jsontag) = 'area'];
  170. int64 live_time = 8 [(gogoproto.jsontag) = 'live_time'];
  171. string area_name = 9 [(gogoproto.jsontag) = 'area_name'];
  172. int64 area_v2_id = 10 [(gogoproto.jsontag) = 'area_v2_id'];
  173. string area_v2_name = 11 [(gogoproto.jsontag) = 'area_v2_name'];
  174. string area_v2_parent_name = 12 [(gogoproto.jsontag) = 'area_v2_parent_name'];
  175. int64 area_v2_parent_id = 13 [(gogoproto.jsontag) = 'area_v2_parent_id'];
  176. string live_tag_name = 14 [(gogoproto.jsontag) = 'live_tag_name'];
  177. int64 online = 15 [(gogoproto.jsontag) = 'online'];
  178. string play_url = 16 [(gogoproto.jsontag) = 'play_url'];
  179. string play_url_h265 = 17 [(gogoproto.jsontag) = 'play_url_h265'];
  180. repeated int64 accept_quality = 18 [(gogoproto.jsontag) = 'accept_quality'];
  181. int64 current_quality = 19 [(gogoproto.jsontag) = 'current_quality'];
  182. int64 pk_id = 20 [(gogoproto.jsontag) = 'pk_id'];
  183. string link = 21 [(gogoproto.jsontag) = 'link'];
  184. int64 special_attention = 22 [(gogoproto.jsontag) = 'special_attention'];
  185. int64 broadcast_type = 23 [(gogoproto.jsontag) = 'broadcast_type'];
  186. string pendent_ru = 24 [(gogoproto.jsontag) = 'pendent_ru'];
  187. string pendent_ru_color = 25 [(gogoproto.jsontag) = 'pendent_ru_color'];
  188. string pendent_ru_pic = 26 [(gogoproto.jsontag) = 'pendent_ru_pic'];
  189. int64 official_verify = 27 [(gogoproto.jsontag) = 'official_verify'];
  190. }
  191. // ActivityCardItem
  192. message ActivityCardItem {
  193. BannerCardItem card = 1 [(gogoproto.jsontag) = 'card'];
  194. repeated RoomCardItem room = 2 [(gogoproto.jsontag) = 'room'];
  195. repeated AvCardItem av = 3 [(gogoproto.jsontag) = 'av'];
  196. }
  197. // BannerCardItem
  198. message BannerCardItem {
  199. //活动id
  200. int64 aid = 1 [(gogoproto.jsontag) = 'aid'];
  201. //活动图片
  202. string pic = 2 [(gogoproto.jsontag) = 'pic'];
  203. //活动标题
  204. string title = 3 [(gogoproto.jsontag) = 'title'];
  205. //活动文案
  206. string text = 4 [(gogoproto.jsontag) = 'text'];
  207. //图片链接
  208. string pic_link = 5 [(gogoproto.jsontag) = 'pic_link'];
  209. //围观链接
  210. string go_link = 6 [(gogoproto.jsontag) = 'go_link'];
  211. //三种:去围观,预约,已预约
  212. string button_text = 7 [(gogoproto.jsontag) = 'button_text'];
  213. //代表卡片所处于的状态 0可以去围观,1用户可以点击去预约,2用户可以点击取消预约
  214. int64 status = 8 [(gogoproto.jsontag) = 'status'];
  215. //card,room和av排序值
  216. int64 sort = 9 [(gogoproto.jsontag) = 'sort'];
  217. }
  218. // RoomCardItem
  219. message RoomCardItem {
  220. //是否开播
  221. int64 is_live = 1 [(gogoproto.jsontag) = 'is_live'];
  222. //房间id
  223. int64 room_id = 2 [(gogoproto.jsontag) = 'room_id'];
  224. //房间标题
  225. string title = 3 [(gogoproto.jsontag) = 'title'];
  226. //主播名
  227. string u_name = 4 [(gogoproto.jsontag) = 'u_name'];
  228. //人气值
  229. int64 online = 5 [(gogoproto.jsontag) = 'online'];
  230. //封面
  231. string cover = 6 [(gogoproto.jsontag) = 'cover'];
  232. //父一级分区id
  233. int64 area_v2_parent_id = 7 [(gogoproto.jsontag) = 'area_v2_parent_id'];
  234. //二级分区id
  235. int64 area_v2_id = 8 [(gogoproto.jsontag) = 'area_v2_id'];
  236. //card,room和av排序值
  237. int64 sort = 9 [(gogoproto.jsontag) = 'sort'];
  238. }
  239. // AvCardItem
  240. message AvCardItem {
  241. //视频
  242. int64 avid = 1 [(gogoproto.jsontag) = 'avid'];
  243. //avid
  244. string title = 2 [(gogoproto.jsontag) = 'title'];
  245. //视频标题
  246. int64 view_count = 3 [(gogoproto.jsontag) = 'view_count'];
  247. //浏览
  248. int64 dan_ma_ku = 4 [(gogoproto.jsontag) = 'dan_ma_ku'];
  249. //弹幕
  250. int64 duration = 5 [(gogoproto.jsontag) = 'duration'];
  251. //时长
  252. string cover = 6 [(gogoproto.jsontag) = 'cover'];
  253. //card,room和av排序值
  254. int64 sort = 7 [(gogoproto.jsontag) = 'sort'];
  255. }
  256. // CommonRoomItem
  257. message CommonRoomItem {
  258. //当前拥有清晰度列表
  259. repeated int64 accept_quality = 1 [(gogoproto.jsontag) = 'accept_quality'];
  260. //二级分区id
  261. int64 area_v2_id = 2 [(gogoproto.jsontag) = 'area_v2_id'];
  262. //一级分区id
  263. int64 area_v2_parent_id = 3 [(gogoproto.jsontag) = 'area_v2_parent_id'];
  264. //二级分区名称
  265. string area_v2_name = 4 [(gogoproto.jsontag) = 'area_v2_name'];
  266. //一级分区名称
  267. string area_v2_parent_name = 5 [(gogoproto.jsontag) = 'area_v2_parent_name'];
  268. //横竖屏 0:横屏 1:竖屏 -1:异常情况
  269. int64 broadcast_type = 6 [(gogoproto.jsontag) = 'broadcast_type'];
  270. //封面,封面现在有3种:关键帧、封面图、秀场封面(正方形的),返回哪个由后端决定
  271. string cover = 7 [(gogoproto.jsontag) = 'cover'];
  272. //当前清晰度,清晰度((0)) 0:默认码率, 2:800 3:1500 4:原画
  273. int64 current_quality = 8 [(gogoproto.jsontag) = 'current_quality'];
  274. //主播头像
  275. string face = 9 [(gogoproto.jsontag) = 'face'];
  276. //跳转链接
  277. string link = 10 [(gogoproto.jsontag) = 'link'];
  278. //人气值
  279. int64 online = 11 [(gogoproto.jsontag) = 'online'];
  280. //新版角标-右上 默认为空 只能是文字!!!@古月 【5.29显示更新】:服务端还是吐右上(兼容老版),5.29显示在左上
  281. string pendent_ru = 12 [(gogoproto.jsontag) = 'pendent_ru'];
  282. //【5.29显示更新】:服务端还是吐右上,5.29客户端显示在左上,对应的背景图片
  283. string pendent_ru_color = 13 [(gogoproto.jsontag) = 'pendent_ru_color'];
  284. //新版移动端角标色值-右上
  285. string pendent_ru_pic = 14 [(gogoproto.jsontag) = 'pendent_ru_pic'];
  286. //pk_id
  287. int64 pk_id = 15 [(gogoproto.jsontag) = 'pk_id'];
  288. //秒开播放串 h264
  289. string play_url = 16 [(gogoproto.jsontag) = 'play_url'];
  290. //推荐类型 1:人气 2:营收 3:运营强推 4:天马推荐(暂定)用于客户端打点
  291. int64 rec_type = 17 [(gogoproto.jsontag) = 'rec_type'];
  292. //房间id
  293. int64 roomid = 18 [(gogoproto.jsontag) = 'roomid'];
  294. //房间标题
  295. string title = 19 [(gogoproto.jsontag) = 'title'];
  296. //主播uname
  297. string uname = 20 [(gogoproto.jsontag) = 'uname'];
  298. //秒开播放串 h265
  299. string play_url_h265 = 21 [(gogoproto.jsontag) = 'play_url_h265'];
  300. }
  301. // HourRankItem
  302. message HourRankItem {
  303. //排名
  304. int64 rank = 1 [(gogoproto.jsontag) = 'rank'];
  305. //用户uid
  306. int64 uid = 2 [(gogoproto.jsontag) = 'uid'];
  307. //房间id
  308. int64 roomid = 3 [(gogoproto.jsontag) = 'roomid'];
  309. //用户昵称
  310. string uname = 4 [(gogoproto.jsontag) = 'uname'];
  311. //用户头像
  312. string face = 5 [(gogoproto.jsontag) = 'face'];
  313. //直播状态
  314. int64 live_status = 6 [(gogoproto.jsontag) = 'live_status'];
  315. //父分区id
  316. int64 area_v2_parent_id = 7 [(gogoproto.jsontag) = 'area_v2_parent_id'];
  317. //父分区名称
  318. string area_v2_parent_name = 8 [(gogoproto.jsontag) = 'area_v2_parent_name'];
  319. //子分区id
  320. int64 area_v2_id = 9 [(gogoproto.jsontag) = 'area_v2_id'];
  321. //子分区名称
  322. string area_v2_name = 10 [(gogoproto.jsontag) = 'area_v2_name'];
  323. }
  324. message HourRankExtra {
  325. //14:00-15:00榜单
  326. string sub_title = 1 [(gogoproto.jsontag) = 'sub_title'];
  327. }
  328. // 接口2:换一换
  329. message ChangeReq {
  330. //模块id
  331. int64 module_id = 1 [(gogoproto.moretags) = 'form:"module_id" validate:"required"'];
  332. //关注的room ids
  333. string attention_room_id = 2 [(gogoproto.moretags) = 'form:"attention_room_id"'];
  334. //换一换的当前页数
  335. int64 page = 3 [(gogoproto.moretags) = 'form:"page" validate:"required"'];
  336. string platform = 4 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  337. int64 build = 5 [(gogoproto.moretags) = 'form:"build" validate:"required"'];
  338. string device = 6 [(gogoproto.moretags) = 'form:"device" validate:"required"'];
  339. int64 quality = 7 [(gogoproto.moretags) = 'form:"quality"'];
  340. }
  341. // 换一换响应
  342. message ChangeResp {
  343. ModuleInfo module_info = 1;
  344. int64 is_sky_horse_gray = 2 [(gogoproto.jsontag) = 'is_sky_horse_gray'];
  345. repeated CommonRoomItem list = 3;
  346. }