api.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. // +bili:type=service
  2. // Code generated by warden.
  3. syntax = "proto3";
  4. package community.service.coin.v1;
  5. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  6. option go_package = "api";
  7. // AddCoinReply reply
  8. message AddCoinReply {
  9. }
  10. // AddCoinReq req
  11. message AddCoinReq {
  12. // ip
  13. string ip = 1 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  14. // mid
  15. int64 mid = 2 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  16. // up 主mid
  17. int64 upmid = 3 [(gogoproto.moretags) = 'form:"upid" validate:"required"'];
  18. // 最大投币数
  19. int64 max_coin = 4 [(gogoproto.moretags) = 'form:"max"'];
  20. // aid
  21. int64 aid = 5 [(gogoproto.moretags) = "form:\"aid\" validate:\"required\""];
  22. // 业务
  23. string business = 6 [(gogoproto.moretags) = "form:\"business\" validate:\"required\""];
  24. // 数量
  25. int64 number = 7 [(gogoproto.moretags) = "form:\"number\" validate:\"required,min=1\""];
  26. // 稿件typeid(稿件专用)
  27. int32 typeid = 8 [(gogoproto.moretags) = "form:\"typeid\""];
  28. // 稿件发布时间
  29. int64 pub_time = 9 [(gogoproto.moretags) = "form:\"pub_time\""];
  30. }
  31. // AddUserCoinExpReply add coin exp reply
  32. message AddUserCoinExpReply {
  33. }
  34. // AddUserCoinExpReq req
  35. message AddUserCoinExpReq {
  36. // ip
  37. string ip = 1 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  38. // mid
  39. int64 mid = 2;
  40. // business
  41. string business = 3;
  42. // number
  43. int64 number = 4;
  44. }
  45. // CoinsLogReply reply
  46. message CoinsLogReply {
  47. // log
  48. repeated ModelLog list = 1;
  49. }
  50. // CoinsLogReq req
  51. message CoinsLogReq {
  52. // mid
  53. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  54. // 返回最近一周还是全部
  55. bool recent = 2 [(gogoproto.moretags) = "form:\"recent\""];
  56. // 翻译后的格式 还是原始格式
  57. bool translate = 3 [(gogoproto.moretags) = "form:\"translate\""];
  58. }
  59. // ItemUserCoinsReply reply
  60. message ItemUserCoinsReply {
  61. // number
  62. int64 number = 1[(gogoproto.jsontag) = "number"] ;
  63. }
  64. // ItemUserCoinsReq req
  65. message ItemUserCoinsReq {
  66. // mid
  67. int64 mid = 1 [(gogoproto.moretags) = 'form:"mid" validate:"required"'];
  68. // aid
  69. int64 aid = 2 [(gogoproto.moretags) = "form:\"aid\" validate:\"required\""];
  70. // 业务
  71. string business = 3 [(gogoproto.moretags) = "form:\"business\" validate:\"required\""];
  72. }
  73. // ListReply reply
  74. message ListReply {
  75. // log
  76. repeated ModelList list = 1;
  77. }
  78. // ListReq .
  79. message ListReq {
  80. // mid
  81. int64 mid = 1;
  82. // business
  83. string business = 2;
  84. // 时间戳
  85. int64 ts = 3;
  86. }
  87. // ModelArchiveUserCoins .
  88. message ModelArchiveUserCoins {
  89. // number
  90. int64 number = 1;
  91. }
  92. // ModelArgModifyCoin .
  93. message ModelArgModifyCoin {
  94. // mid
  95. int64 mid = 1;
  96. // count
  97. double count = 2;
  98. // 原因
  99. string reason = 3;
  100. // ip
  101. string ip = 4 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  102. // 操作人
  103. string operator = 5;
  104. // 是否要检查余额数量 默认检查 为1则不检查
  105. int32 check_zero = 6;
  106. }
  107. // ModelList .
  108. message ModelList {
  109. // aid
  110. int64 aid = 1;
  111. // number
  112. int64 number = 2;
  113. // 时间戳
  114. int64 ts = 3;
  115. // ip
  116. uint32 ip = 4 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  117. }
  118. // ModelLog .
  119. message ModelLog {
  120. // 修改前硬币数
  121. double from = 1;
  122. // 修改后硬币数
  123. double to = 2;
  124. // ip
  125. string ip = 3 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  126. // 原因
  127. string desc = 4;
  128. // 时间戳
  129. int64 time_stamp = 5;
  130. }
  131. // ModelRecord record
  132. message ModelRecord {
  133. // aid
  134. int64 aid = 1;
  135. // mid
  136. int64 mid = 2;
  137. // up主id
  138. int64 up = 3;
  139. // 时间戳
  140. int64 timestamp = 4;
  141. // number
  142. int64 number = 5;
  143. // 业务
  144. string business = 6;
  145. // ip
  146. uint32 ip = 7 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  147. }
  148. // ModifyCoinsReply reply
  149. message ModifyCoinsReply {
  150. // result
  151. double result = 1;
  152. }
  153. // ModifyCoinsReq req
  154. message ModifyCoinsReq {
  155. // mid
  156. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required\""];
  157. // 变更的计数 例如10为硬币数加10
  158. double count = 2 [(gogoproto.moretags) = "form:\"count\" validate:\"required\""];
  159. // 改变的原因
  160. string reason = 3 [(gogoproto.moretags) = "form:\"reason\" validate:\"required\""];
  161. // ip
  162. string ip = 4 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  163. // 操作人
  164. string operator = 5 [(gogoproto.moretags) = "form:\"operator\""];
  165. // 是否要检查余额数量 默认检查 为1则不检查
  166. int32 check_zero = 6 [(gogoproto.moretags) = "form:\"check_zero\""];
  167. // 时间戳
  168. int64 ts = 7;
  169. }
  170. // TodayExpReply reply
  171. message TodayExpReply {
  172. // exp
  173. int64 exp = 1;
  174. }
  175. // TodayExpReq req
  176. message TodayExpReq {
  177. // mid
  178. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  179. }
  180. // UpdateAddCoinReply reply
  181. message UpdateAddCoinReply {
  182. }
  183. // UpdateAddCoinReq req
  184. message UpdateAddCoinReq {
  185. // aid
  186. int64 aid = 1;
  187. // mid
  188. int64 mid = 2;
  189. // up mid
  190. int64 up = 3;
  191. // timestamp
  192. int64 timestamp = 4;
  193. // number
  194. int64 number = 5;
  195. // business
  196. string business = 6;
  197. // ip
  198. uint32 ip = 7 [(gogoproto.jsontag) = "ip", (gogoproto.customname) = "IP"];
  199. string ipv6 = 8 [(gogoproto.jsontag) = "ip_v6", (gogoproto.customname) = "IPV6"];
  200. }
  201. // UserCoinsReply reply
  202. message UserCoinsReply {
  203. // count
  204. double count = 1;
  205. }
  206. // UserCoinsReq req
  207. message UserCoinsReq {
  208. // mid
  209. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  210. }
  211. // Coin rpc
  212. service Coin {
  213. // AddCoin add coin. 投币接口
  214. rpc AddCoin(AddCoinReq) returns(AddCoinReply);
  215. // ItemUserCoins get coins added of archive. 投币数量接口
  216. rpc ItemUserCoins(ItemUserCoinsReq) returns(ItemUserCoinsReply);
  217. // UserCoins get user coins. 用户硬币余额
  218. rpc UserCoins(UserCoinsReq) returns(UserCoinsReply);
  219. // ModifyCoins modify user coins. 修改硬币数
  220. rpc ModifyCoins(ModifyCoinsReq) returns(ModifyCoinsReply);
  221. // List get coin added list.投币列表
  222. rpc List(ListReq) returns(ListReply);
  223. // CoinsLog coins log 投币日志
  224. rpc CoinsLog(CoinsLogReq) returns(CoinsLogReply);
  225. // AddUserCoinExp add user coin exp for job
  226. rpc AddUserCoinExp(AddUserCoinExpReq) returns(AddUserCoinExpReply);
  227. // UpdateAddCoin update db after add coin for job.
  228. rpc UpdateAddCoin(UpdateAddCoinReq) returns(UpdateAddCoinReply);
  229. // TodayExp get today coin added exp. 今日投币经验
  230. rpc TodayExp(TodayExpReq) returns(TodayExpReply);
  231. }