api.proto 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. syntax = "proto3";
  2. package live.resource.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // addReq
  6. message AddReq {
  7. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  8. string title = 2 [(gogoproto.moretags) = 'form:"title" validate:"required"'];
  9. string jumpPath = 3 [(gogoproto.moretags) = 'form:"jumpPath"'];
  10. int64 jumpTime = 4 [(gogoproto.moretags) = 'form:"jumpTime"'];
  11. string type = 5 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
  12. string device = 6 [(gogoproto.moretags) = 'form:"device" validate:"required"'];
  13. string startTime = 7 [(gogoproto.moretags) = 'form:"startTime" validate:"required"'];
  14. string endTime = 8 [(gogoproto.moretags) = 'form:"endTime" validate:"required"'];
  15. string imageUrl = 9 [(gogoproto.moretags) = 'form:"imageUrl" validate:"required"'];
  16. int64 jumpPathType = 10 [(gogoproto.moretags) = 'form:"jumpPathType"'];
  17. }
  18. // addResp
  19. message AddResp {
  20. repeated int64 id = 1 [(gogoproto.jsontag) = "id"];
  21. }
  22. // editReq
  23. message EditReq {
  24. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  25. int64 id = 2 [(gogoproto.moretags) = 'form:"id" validate:"required"'];
  26. string title = 3 [(gogoproto.moretags) = 'form:"title"'];
  27. string jumpPath = 4 [(gogoproto.moretags) = 'form:"jumpPath"'];
  28. int64 jumpTime = 5 [(gogoproto.moretags) = 'form:"jumpTime"'];
  29. string startTime = 7 [(gogoproto.moretags) = 'form:"startTime"'];
  30. string endTime = 8 [(gogoproto.moretags) = 'form:"endTime"'];
  31. string imageUrl = 9 [(gogoproto.moretags) = 'form:"imageUrl"'];
  32. int64 jumpPathType = 10 [(gogoproto.moretags) = 'form:"jumpPathType"'];
  33. }
  34. // editResp
  35. message EditResp {
  36. }
  37. //下线闪屏
  38. message OfflineReq {
  39. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  40. int64 id = 2 [(gogoproto.moretags) = 'form:"id" validate:"required"'];
  41. }
  42. message OfflineResp {
  43. }
  44. //获取闪屏配置列表
  45. message GetListReq {
  46. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  47. int64 page = 2 [(gogoproto.moretags) = 'form:"page"'];
  48. int64 pageSize = 3 [(gogoproto.moretags) = 'form:"pageSize"'];
  49. string type = 4 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
  50. }
  51. message GetListResp {
  52. int64 currentPage = 1 [(gogoproto.jsontag) = "currentPage"];
  53. int64 totalCount = 2 [(gogoproto.jsontag) = "totalCount"];
  54. repeated List list = 3 [(gogoproto.jsontag) = "list"];
  55. message List {
  56. int64 id = 1 [(gogoproto.jsontag) = "id"];
  57. string title = 2 [(gogoproto.jsontag) = "title"];
  58. string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
  59. string device_platform = 4 [(gogoproto.jsontag) = "device_platform"];
  60. int64 device_build = 5 [(gogoproto.jsontag) = "device_build"];
  61. string startTime = 6 [(gogoproto.jsontag) = "startTime"];
  62. string endTime = 7 [(gogoproto.jsontag) = "endTime"];
  63. int64 status = 8 [(gogoproto.jsontag) = "status"];
  64. int64 device_limit =9 [(gogoproto.jsontag) = "device_limit"];
  65. string imageUrl = 10 [(gogoproto.jsontag) = "imageUrl"];
  66. int64 jumpPathType = 11 [(gogoproto.jsontag) = "jumpPathType"];
  67. int64 jumpTime = 12 [(gogoproto.jsontag) = "jumpTime"];
  68. }
  69. }
  70. // 获取当前有效闪屏配置(客户端)
  71. message GetInfoReq {
  72. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  73. int64 build = 2 [(gogoproto.moretags) = 'form:"build" validate:"required"'];
  74. }
  75. message GetInfoResp {
  76. int64 id = 1 [(gogoproto.jsontag) = "id"];
  77. string title = 2 [(gogoproto.jsontag) = "title"];
  78. string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
  79. int64 jumpTime = 4 [(gogoproto.jsontag) = "jumpTime"];
  80. int64 jumpPathType = 5 [(gogoproto.jsontag) = "jumpPathType"];
  81. string imageUrl = 6 [(gogoproto.jsontag) = "imageUrl"];
  82. }
  83. // 获取当前有效banner配置(客户端)
  84. message GetBlinkBannerReq {
  85. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  86. int64 build = 2 [(gogoproto.moretags) = 'form:"build" validate:"required"'];
  87. }
  88. message GetBlinkBannerResp {
  89. int64 id = 1 [(gogoproto.jsontag) = "id"];
  90. string title = 2 [(gogoproto.jsontag) = "title"];
  91. string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
  92. int64 jumpTime = 4 [(gogoproto.jsontag) = "jumpTime"];
  93. int64 jumpPathType = 5 [(gogoproto.jsontag) = "jumpPathType"];
  94. string imageUrl = 6 [(gogoproto.jsontag) = "imageUrl"];
  95. }
  96. // 获取banner配置(客户端)
  97. message GetBannerReq {
  98. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  99. int64 build = 2 [(gogoproto.moretags) = 'form:"build" validate:"required"'];
  100. string type = 3 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
  101. }
  102. message GetBannerResp {
  103. repeated List list = 1 [(gogoproto.jsontag) = "list"];
  104. message List {
  105. int64 id = 1 [(gogoproto.jsontag) = "id"];
  106. string title = 2 [(gogoproto.jsontag) = "title"];
  107. string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
  108. int64 jumpTime = 4 [(gogoproto.jsontag) = "jumpTime"];
  109. int64 jumpPathType = 5 [(gogoproto.jsontag) = "jumpPathType"];
  110. string imageUrl = 6 [(gogoproto.jsontag) = "imageUrl"];
  111. }
  112. }
  113. message GetPlatformListReq {
  114. int64 type=1 [(gogoproto.jsontag) = "type"];
  115. }
  116. message GetPlatformListResp {
  117. repeated string platform =1 [(gogoproto.jsontag) = "platform"];
  118. }
  119. message GetListExReq {
  120. string platform = 1 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  121. int64 page = 2 [(gogoproto.moretags) = 'form:"page"'];
  122. int64 pageSize = 3 [(gogoproto.moretags) = 'form:"pageSize"'];
  123. repeated string type = 4 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
  124. string device_platform = 5 [(gogoproto.moretags) = 'form:"device_platform"'];
  125. string status = 6 [(gogoproto.moretags) = 'form:"status"'];
  126. string startTime = 7 [(gogoproto.moretags) = 'form:"startTime"'];
  127. string endTime = 8 [(gogoproto.moretags) = 'form:"endTime"'];
  128. }
  129. message GetListExResp {
  130. int64 currentPage = 1 [(gogoproto.jsontag) = "currentPage"];
  131. int64 totalCount = 2 [(gogoproto.jsontag) = "totalCount"];
  132. repeated List list = 3 [(gogoproto.jsontag) = "list"];
  133. message List {
  134. int64 id = 1 [(gogoproto.jsontag) = "id"];
  135. string title = 2 [(gogoproto.jsontag) = "title"];
  136. string jumpPath = 3 [(gogoproto.jsontag) = "jumpPath"];
  137. string device_platform = 4 [(gogoproto.jsontag) = "device_platform"];
  138. int64 device_build = 5 [(gogoproto.jsontag) = "device_build"];
  139. string startTime = 6 [(gogoproto.jsontag) = "startTime"];
  140. string endTime = 7 [(gogoproto.jsontag) = "endTime"];
  141. int64 status = 8 [(gogoproto.jsontag) = "status"];
  142. int64 device_limit =9 [(gogoproto.jsontag) = "device_limit"];
  143. string imageUrl = 10 [(gogoproto.jsontag) = "imageUrl"];
  144. int64 jumpPathType = 11 [(gogoproto.jsontag) = "jumpPathType"];
  145. int64 jumpTime = 12 [(gogoproto.jsontag) = "jumpTime"];
  146. string type = 13 [(gogoproto.jsontag) = "type"];
  147. }
  148. }
  149. service Resource {
  150. //Add 添加资源接口
  151. rpc Add(AddReq) returns (AddResp);
  152. //Add 添加资源接口(不限制位置和平台)
  153. rpc AddEx(AddReq) returns (AddResp);
  154. //Edit 编辑资源接口
  155. rpc Edit(EditReq) returns (EditResp);
  156. //Offline 下线资源接口
  157. rpc Offline(OfflineReq) returns (OfflineResp);
  158. //GetList 获取资源列表
  159. rpc GetList(GetListReq) returns (GetListResp);
  160. //获取平台列表
  161. rpc GetPlatformList(GetPlatformListReq) returns (GetPlatformListResp);
  162. //GetListEx 获取资源列表
  163. rpc GetListEx(GetListExReq) returns (GetListExResp);
  164. }
  165. service Splash {
  166. //获取有效闪屏配置
  167. rpc GetInfo(GetInfoReq) returns (GetInfoResp);
  168. }
  169. service Banner {
  170. //获取有效banner配置
  171. rpc GetBlinkBanner(GetInfoReq) returns (GetInfoResp);
  172. //获取有效banner配置
  173. rpc GetBanner(GetBannerReq) returns (GetBannerResp);
  174. }