api.proto 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. // +bili:type=service
  2. syntax = "proto3";
  3. package account.service;
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. option go_package = "api";
  6. message Card {
  7. int64 mid = 1 [(gogoproto.jsontag) = "mid"];
  8. string name = 2 [(gogoproto.jsontag) = "name"];
  9. string sex = 3 [(gogoproto.jsontag) = "sex"];
  10. string face = 4 [(gogoproto.jsontag) = "face"];
  11. string sign = 5 [(gogoproto.jsontag) = "sign"];
  12. int32 rank = 6 [(gogoproto.jsontag) = "rank"];
  13. int32 level = 7 [(gogoproto.jsontag) = "level"];
  14. int32 silence = 8 [(gogoproto.jsontag) = "silence"];
  15. VipInfo vip = 9 [(gogoproto.jsontag) = "vip", (gogoproto.nullable) = false];
  16. PendantInfo pendant = 10
  17. [(gogoproto.jsontag) = "pendant", (gogoproto.nullable) = false];
  18. NameplateInfo nameplate = 11
  19. [(gogoproto.jsontag) = "nameplate", (gogoproto.nullable) = false];
  20. OfficialInfo official = 12
  21. [(gogoproto.jsontag) = "official", (gogoproto.nullable) = false];
  22. }
  23. message Info {
  24. int64 mid = 1 [(gogoproto.jsontag) = "mid"];
  25. string name = 2 [(gogoproto.jsontag) = "name"];
  26. string sex = 3 [(gogoproto.jsontag) = "sex"];
  27. string face = 4 [(gogoproto.jsontag) = "face"];
  28. string sign = 5 [(gogoproto.jsontag) = "sign"];
  29. int32 rank = 6 [(gogoproto.jsontag) = "rank"];
  30. }
  31. message Profile {
  32. int64 mid = 1 [(gogoproto.jsontag) = "mid"];
  33. string name = 2 [(gogoproto.jsontag) = "name"];
  34. string sex = 3 [(gogoproto.jsontag) = "sex"];
  35. string face = 4 [(gogoproto.jsontag) = "face"];
  36. string sign = 5 [(gogoproto.jsontag) = "sign"];
  37. int32 rank = 6 [(gogoproto.jsontag) = "rank"];
  38. int32 level = 7 [(gogoproto.jsontag) = "level"];
  39. int32 join_time = 8 [(gogoproto.jsontag) = "jointime"];
  40. int32 moral = 9 [(gogoproto.jsontag) = "moral"];
  41. int32 silence = 10 [(gogoproto.jsontag) = "silence"];
  42. int32 email_status = 11 [(gogoproto.jsontag) = "email_status"];
  43. int32 tel_status = 12 [(gogoproto.jsontag) = "tel_status"];
  44. int32 identification = 13 [(gogoproto.jsontag) = "identification"];
  45. VipInfo vip = 14 [(gogoproto.jsontag) = "vip", (gogoproto.nullable) = false];
  46. PendantInfo pendant = 15
  47. [(gogoproto.jsontag) = "pendant", (gogoproto.nullable) = false];
  48. NameplateInfo nameplate = 16
  49. [(gogoproto.jsontag) = "nameplate", (gogoproto.nullable) = false];
  50. OfficialInfo official = 17
  51. [(gogoproto.jsontag) = "official", (gogoproto.nullable) = false];
  52. int64 birthday = 18 [
  53. (gogoproto.jsontag) = "birthday",
  54. (gogoproto.casttype) = "go-common/library/time.Time"
  55. ];
  56. int32 is_tourist = 19 [(gogoproto.jsontag) = "is_tourist"];
  57. }
  58. // +bili:deepcopy-gen=true
  59. // +bili:deepcopy-gen:structs=go-common/app/service/main/member/model.LevelInfo
  60. message LevelInfo {
  61. int32 cur = 1 [(gogoproto.jsontag) = "current_level"];
  62. int32 min = 2 [(gogoproto.jsontag) = "current_min"];
  63. int32 now_exp = 3 [(gogoproto.jsontag) = "current_exp"];
  64. int32 next_exp = 4 [(gogoproto.jsontag) = "next_exp"];
  65. }
  66. message VipInfo {
  67. int32 type = 1 [(gogoproto.jsontag) = "type"];
  68. int32 status = 2 [(gogoproto.jsontag) = "status"];
  69. int64 due_date = 3 [(gogoproto.jsontag) = "due_date"];
  70. int32 vip_pay_type = 4 [(gogoproto.jsontag) = "vip_pay_type"];
  71. }
  72. message PendantInfo {
  73. int32 pid = 1 [(gogoproto.jsontag) = "pid", (gogoproto.casttype) = "int"];
  74. string name = 2 [(gogoproto.jsontag) = "name"];
  75. string image = 3 [(gogoproto.jsontag) = "image"];
  76. int64 expire = 4
  77. [(gogoproto.jsontag) = "expire", (gogoproto.casttype) = "int"];
  78. }
  79. message NameplateInfo {
  80. int32 nid = 1 [(gogoproto.jsontag) = "nid", (gogoproto.casttype) = "int"];
  81. string name = 2 [(gogoproto.jsontag) = "name"];
  82. string image = 3 [(gogoproto.jsontag) = "image"];
  83. string image_small = 4 [(gogoproto.jsontag) = "image_small"];
  84. string level = 5 [(gogoproto.jsontag) = "level"];
  85. string condition = 6 [(gogoproto.jsontag) = "condition"];
  86. }
  87. // +bili:deepcopy-gen=true
  88. // +bili:deepcopy-gen:structs=go-common/app/service/main/member/model.OfficialInfo
  89. message OfficialInfo {
  90. int32 role = 1 [(gogoproto.jsontag) = "role", (gogoproto.casttype) = "int8"];
  91. string title = 2 [(gogoproto.jsontag) = "title"];
  92. string desc = 3 [(gogoproto.jsontag) = "desc"];
  93. }
  94. message MidReq {
  95. int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  96. string real_ip = 2;
  97. }
  98. message MidsReq {
  99. repeated int64 mids = 1
  100. [(gogoproto.moretags) = "validate:\"gt=0,dive,gt=0\""];
  101. string real_ip = 2;
  102. }
  103. message NamesReq {
  104. repeated string names = 1
  105. [(gogoproto.moretags) = "validate:\"gt=0,dive,gt=0\""];
  106. string real_ip = 2;
  107. }
  108. message ExpReq {
  109. int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  110. double exp = 2;
  111. string operater = 3;
  112. string operate = 4;
  113. string reason = 5;
  114. string real_ip = 6;
  115. }
  116. message MoralReq {
  117. int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  118. double moral = 2;
  119. string oper = 3;
  120. string reason = 4;
  121. string remark = 5;
  122. string real_ip = 6;
  123. }
  124. message RelationReq {
  125. int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  126. int64 owner = 2;
  127. string real_ip = 3;
  128. }
  129. message RelationsReq {
  130. int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
  131. repeated int64 owners = 2;
  132. string real_ip = 3;
  133. }
  134. message RichRelationReq {
  135. int64 owner = 1;
  136. repeated int64 mids = 2
  137. [(gogoproto.moretags) = "validate:\"gt=0,dive,gt=0\""];
  138. string real_ip = 3;
  139. }
  140. message InfoReply {
  141. Info info = 1;
  142. }
  143. message InfosReply {
  144. map<int64, Info> infos = 1;
  145. }
  146. message CardReply {
  147. Card card = 1;
  148. }
  149. message CardsReply {
  150. map<int64, Card> cards = 1;
  151. }
  152. message ProfileReply {
  153. Profile profile = 1;
  154. }
  155. message ProfileStatReply {
  156. Profile profile = 1;
  157. LevelInfo level_info = 2 [(gogoproto.nullable) = false];
  158. double coins = 3;
  159. int64 following = 4;
  160. int64 follower = 5;
  161. }
  162. message RelationReply {
  163. bool following = 1;
  164. }
  165. message AttentionsReply {
  166. repeated int64 attentions = 1;
  167. }
  168. message BlacksReply {
  169. map<int64, bool> black_list = 1;
  170. }
  171. message RelationsReply {
  172. map<int64, RelationReply> relations = 1;
  173. }
  174. message RichRelationsReply {
  175. map<int64, int32> rich_relations = 1;
  176. }
  177. // +bili:deepcopy-gen=true
  178. // +bili:deepcopy-gen:structs=go-common/app/service/main/account/api.VipInfo
  179. message VipReply {
  180. int32 type = 1;
  181. int32 status = 2;
  182. int64 due_date = 3;
  183. int32 vip_pay_type = 4;
  184. }
  185. message VipsReply {
  186. map<int64, VipReply> vips = 1;
  187. }
  188. message ExpReply {}
  189. message MoralReply {}
  190. service Account {
  191. rpc Info3(MidReq) returns (InfoReply);
  192. rpc Infos3(MidsReq) returns (InfosReply);
  193. rpc InfosByName3(NamesReq) returns (InfosReply);
  194. rpc Card3(MidReq) returns (CardReply);
  195. rpc Cards3(MidsReq) returns (CardsReply);
  196. rpc Profile3(MidReq) returns (ProfileReply);
  197. rpc ProfileWithStat3(MidReq) returns (ProfileStatReply);
  198. rpc AddExp3(ExpReq) returns (ExpReply);
  199. rpc AddMoral3(MoralReq) returns (MoralReply);
  200. rpc Relation3(RelationReq) returns (RelationReply);
  201. rpc Attentions3(MidReq) returns (AttentionsReply);
  202. rpc Blacks3(MidReq) returns (BlacksReply);
  203. rpc Relations3(RelationsReq) returns (RelationsReply);
  204. rpc RichRelations3(RichRelationReq) returns (RichRelationsReply);
  205. rpc Vip3(MidReq) returns (VipReply);
  206. rpc Vips3(MidsReq) returns (VipsReply);
  207. }