Medal.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. syntax = "proto3";
  2. package fans_medal.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. service Medal {
  6. /** up主开启勋章
  7. *
  8. */
  9. rpc create (MedalCreateReq) returns (MedalCreateResp);
  10. /** 获取up主自己的勋章,更严格的类型
  11. *
  12. */
  13. rpc query (MedalQueryReq) returns (MedalQueryResp);
  14. /** 根据ID查询勋章详情,返回严格的类型
  15. *
  16. */
  17. rpc query_id (MedalQueryIdReq) returns (MedalQueryIdResp);
  18. }
  19. message MedalCreateReq {
  20. //
  21. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  22. //
  23. int64 source = 2 [(gogoproto.jsontag) = "source"];
  24. }
  25. message MedalCreateResp {
  26. //
  27. int64 code = 1 [(gogoproto.jsontag) = "code"];
  28. //
  29. string msg = 2 [(gogoproto.jsontag) = "msg"];
  30. //
  31. Data data = 3 [(gogoproto.jsontag) = "data"];
  32. message Data {
  33. // 勋章ID
  34. int64 id = 1 [(gogoproto.jsontag) = "id"];
  35. // up主uid
  36. int64 uid = 2 [(gogoproto.jsontag) = "uid"];
  37. // 勋章名称
  38. string medal_name = 3 [(gogoproto.jsontag) = "medal_name"];
  39. // 直播开通状态 0 冻结 1 可用
  40. int64 live_status = 4 [(gogoproto.jsontag) = "live_status"];
  41. // 主站开通状态 0 冻结 1 可用
  42. int64 master_status = 5 [(gogoproto.jsontag) = "master_status"];
  43. // 勋章审核状态 -1已拒绝 0未申请 1已申请 2已开通
  44. int64 status = 6 [(gogoproto.jsontag) = "status"];
  45. // 审核不通过通过的理由
  46. string reason = 7 [(gogoproto.jsontag) = "reason"];
  47. // 申请来源
  48. int64 apply_source = 8 [(gogoproto.jsontag) = "apply_source"];
  49. // 最后一次修改勋章名称的时间戳
  50. int64 last_rename_time = 9 [(gogoproto.jsontag) = "last_rename_time"];
  51. // 改名状态
  52. int64 rename_status = 10 [(gogoproto.jsontag) = "rename_status"];
  53. // 充电超过该数值可获得勋章
  54. int64 charge_num = 11 [(gogoproto.jsontag) = "charge_num"];
  55. // 投币超过该数值可获得勋章
  56. int64 coin_num = 12 [(gogoproto.jsontag) = "coin_num"];
  57. // 没有勋章时为 true
  58. bool is_null = 13 [(gogoproto.jsontag) = "is_null"];
  59. }
  60. }
  61. message MedalQueryReq {
  62. //
  63. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  64. //
  65. int64 source = 2 [(gogoproto.jsontag) = "source"];
  66. }
  67. message MedalQueryResp {
  68. //
  69. int64 code = 1 [(gogoproto.jsontag) = "code"];
  70. //
  71. string msg = 2 [(gogoproto.jsontag) = "msg"];
  72. //
  73. Data data = 3 [(gogoproto.jsontag) = "data"];
  74. message Data {
  75. // 勋章ID
  76. int64 id = 1 [(gogoproto.jsontag) = "id"];
  77. // up主uid
  78. int64 uid = 2 [(gogoproto.jsontag) = "uid"];
  79. // 勋章名称
  80. string medal_name = 3 [(gogoproto.jsontag) = "medal_name"];
  81. // 直播开通状态 0 冻结 1 可用
  82. int64 live_status = 4 [(gogoproto.jsontag) = "live_status"];
  83. // 主站开通状态 0 冻结 1 可用
  84. int64 master_status = 5 [(gogoproto.jsontag) = "master_status"];
  85. // 勋章审核状态 -1已拒绝 0未申请 1已申请 2已开通
  86. int64 status = 6 [(gogoproto.jsontag) = "status"];
  87. // 审核不通过通过的理由
  88. string reason = 7 [(gogoproto.jsontag) = "reason"];
  89. // 申请来源
  90. int64 apply_source = 8 [(gogoproto.jsontag) = "apply_source"];
  91. // 最后一次修改勋章名称的时间戳
  92. int64 last_rename_time = 9 [(gogoproto.jsontag) = "last_rename_time"];
  93. // 改名状态
  94. int64 rename_status = 10 [(gogoproto.jsontag) = "rename_status"];
  95. // 充电超过该数值可获得勋章
  96. int64 charge_num = 11 [(gogoproto.jsontag) = "charge_num"];
  97. // 投币超过该数值可获得勋章
  98. int64 coin_num = 12 [(gogoproto.jsontag) = "coin_num"];
  99. // 没有勋章时为 true
  100. bool is_null = 13 [(gogoproto.jsontag) = "is_null"];
  101. }
  102. }
  103. message MedalQueryIdReq {
  104. //
  105. int64 medal_id = 1 [(gogoproto.jsontag) = "medal_id"];
  106. }
  107. message MedalQueryIdResp {
  108. //
  109. int64 code = 1 [(gogoproto.jsontag) = "code"];
  110. //
  111. string msg = 2 [(gogoproto.jsontag) = "msg"];
  112. //
  113. Data data = 3 [(gogoproto.jsontag) = "data"];
  114. message Data {
  115. //
  116. int64 id = 1 [(gogoproto.jsontag) = "id"];
  117. //
  118. int64 uid = 2 [(gogoproto.jsontag) = "uid"];
  119. //
  120. string medal_name = 3 [(gogoproto.jsontag) = "medal_name"];
  121. //
  122. int64 live_status = 4 [(gogoproto.jsontag) = "live_status"];
  123. //
  124. int64 master_status = 5 [(gogoproto.jsontag) = "master_status"];
  125. //
  126. int64 status = 6 [(gogoproto.jsontag) = "status"];
  127. //
  128. int64 reason = 7 [(gogoproto.jsontag) = "reason"];
  129. //
  130. int64 last_rename_time = 8 [(gogoproto.jsontag) = "last_rename_time"];
  131. //
  132. bool is_null = 9 [(gogoproto.jsontag) = "is_null"];
  133. }
  134. }