api.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. // +bili:type=service
  2. syntax = "proto3";
  3. package relation.service;
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. option go_package = "api";
  6. service Relation {
  7. rpc Relation(RelationReq) returns (FollowingReply);
  8. rpc Relations(RelationsReq) returns (FollowingMapReply);
  9. rpc Stat(MidReq) returns (StatReply);
  10. rpc Stats(MidsReq) returns (StatsReply);
  11. rpc Attentions(MidReq) returns (FollowingsReply);
  12. rpc Followings(MidReq) returns (FollowingsReply);
  13. rpc AddFollowing(FollowingReq) returns (EmptyReply);
  14. rpc DelFollowing(FollowingReq) returns (EmptyReply);
  15. rpc Whispers(MidReq) returns (FollowingsReply);
  16. rpc AddWhisper(FollowingReq) returns (EmptyReply);
  17. rpc DelWhisper(FollowingReq) returns (EmptyReply);
  18. rpc Blacks(MidReq) returns (FollowingsReply);
  19. rpc AddBlack(FollowingReq) returns (EmptyReply);
  20. rpc DelBlack(FollowingReq) returns (EmptyReply);
  21. rpc Followers(MidReq) returns (FollowingsReply);
  22. rpc DelFollower(FollowingReq) returns (EmptyReply);
  23. rpc Tag(TagIdReq) returns (TagReply);
  24. rpc Tags(MidReq) returns (TagsCountReply);
  25. rpc UserTag(RelationReq) returns (UserTagReply);
  26. rpc CreateTag(TagReq) returns (CreateTagReply);
  27. rpc UpdateTag(TagUpdateReq) returns (EmptyReply);
  28. rpc DelTag(TagDelReq) returns (EmptyReply);
  29. rpc TagsAddUsers(TagsMoveUsersReq) returns (EmptyReply);
  30. rpc TagsCopyUsers(TagsMoveUsersReq) returns (EmptyReply);
  31. rpc TagsMoveUsers(TagsMoveUsersReq) returns (EmptyReply);
  32. rpc Prompt(PromptReq) returns (PromptReply);
  33. rpc ClosePrompt(PromptReq) returns (EmptyReply);
  34. rpc AddSpecial(FollowingReq) returns (EmptyReply);
  35. rpc DelSpecial(FollowingReq) returns (EmptyReply);
  36. rpc Special(MidReq) returns (SpecialReply);
  37. rpc FollowersUnread(MidReq) returns (FollowersUnreadReply);
  38. rpc FollowersUnreadCount(MidReq) returns (FollowersUnreadCountReply);
  39. rpc AchieveGet(AchieveGetReq) returns (AchieveGetReply);
  40. rpc Achieve(AchieveReq) returns (AchieveReply);
  41. rpc ResetFollowersUnread(MidReq) returns (EmptyReply);
  42. rpc ResetFollowersUnreadCount(MidReq) returns (EmptyReply);
  43. rpc DisableFollowerNotify(MidReq) returns (EmptyReply);
  44. rpc EnableFollowerNotify(MidReq) returns (EmptyReply);
  45. rpc FollowerNotifySetting(MidReq) returns (FollowerNotifySettingReply);
  46. rpc SameFollowings(SameFollowingReq) returns (FollowingsReply);
  47. }
  48. message RelationReq {
  49. int64 mid = 1;
  50. int64 fid = 2;
  51. string real_ip = 3;
  52. }
  53. // +bili:deepcopy-gen=true
  54. // +bili:deepcopy-gen:structs=go-common/app/service/main/relation/model.Following
  55. message FollowingReply {
  56. int64 mid = 1 [ (gogoproto.jsontag) = "mid" ];
  57. uint32 attribute = 2 [ (gogoproto.jsontag) = "attribute" ];
  58. uint32 source = 3 [ (gogoproto.jsontag) = "-" ];
  59. int64 ctime = 4 [
  60. (gogoproto.jsontag) = "-",
  61. (gogoproto.casttype) = "go-common/library/time.Time",
  62. (gogoproto.customname) = "CTime"
  63. ];
  64. int64 mtime = 5 [
  65. (gogoproto.jsontag) = "mtime",
  66. (gogoproto.casttype) = "go-common/library/time.Time",
  67. (gogoproto.customname) = "MTime"
  68. ];
  69. repeated int64 tag = 6 [ (gogoproto.jsontag) = "tag" ];
  70. int32 special = 7 [ (gogoproto.jsontag) = "special" ];
  71. }
  72. message RelationsReq {
  73. int64 mid = 1;
  74. repeated int64 fid = 2;
  75. string real_ip = 3;
  76. }
  77. message FollowingMapReply { map<int64, FollowingReply> following_map = 1; }
  78. message FollowingsReply { repeated FollowingReply following_list = 1; }
  79. message MidReq {
  80. int64 mid = 1;
  81. string real_ip = 2;
  82. }
  83. // +bili:deepcopy-gen=true
  84. // +bili:deepcopy-gen:structs=go-common/app/service/main/relation/model.Stat
  85. message StatReply {
  86. int64 mid = 1 [ (gogoproto.jsontag) = "mid" ];
  87. int64 following = 2 [ (gogoproto.jsontag) = "following" ];
  88. int64 whisper = 3 [ (gogoproto.jsontag) = "whisper" ];
  89. int64 black = 4 [ (gogoproto.jsontag) = "black" ];
  90. int64 follower = 5 [ (gogoproto.jsontag) = "follower" ];
  91. int64 ctime = 6 [
  92. (gogoproto.jsontag) = "-",
  93. (gogoproto.casttype) = "go-common/library/time.Time",
  94. (gogoproto.customname) = "CTime"
  95. ];
  96. int64 mtime = 7 [
  97. (gogoproto.jsontag) = "-",
  98. (gogoproto.casttype) = "go-common/library/time.Time",
  99. (gogoproto.customname) = "MTime"
  100. ];
  101. }
  102. message MidsReq {
  103. repeated int64 mids = 1;
  104. string real_ip = 2;
  105. }
  106. message StatsReply { map<int64, StatReply> stat_reply_map = 1; }
  107. message FollowingReq {
  108. int64 mid = 1;
  109. int64 fid = 2;
  110. uint32 source = 3 [ (gogoproto.casttype) = "uint8" ];
  111. string real_ip = 4;
  112. int32 action = 5 [ (gogoproto.casttype) = "int8" ];
  113. map<string, string> infoc = 6;
  114. }
  115. message EmptyReply {}
  116. // ArgTagId tag id
  117. message TagIdReq {
  118. int64 mid = 1;
  119. int64 tag_id = 2;
  120. string real_ip = 3;
  121. }
  122. message TagReply { repeated int64 mids = 1; }
  123. // +bili:deepcopy-gen=true
  124. // +bili:deepcopy-gen:structs=go-common/app/service/main/relation/model.TagCount
  125. message TagCountReply {
  126. int64 tagid = 1 [ (gogoproto.jsontag) = "tagid" ];
  127. string name = 2 [ (gogoproto.jsontag) = "name" ];
  128. int64 count = 3 [ (gogoproto.jsontag) = "count" ];
  129. }
  130. message TagsCountReply { repeated TagCountReply tag_count_list = 1; }
  131. message UserTagReply { map<int64, string> tags = 1; }
  132. message TagReq {
  133. int64 mid = 1;
  134. string tag = 2;
  135. string real_ip = 3;
  136. }
  137. message TagUpdateReq {
  138. int64 mid = 1;
  139. int64 tag_id = 2;
  140. string new = 3;
  141. string real_ip = 4;
  142. }
  143. message TagDelReq {
  144. int64 mid = 1;
  145. int64 tag_id = 2;
  146. string real_ip = 3;
  147. }
  148. message TagsMoveUsersReq {
  149. int64 mid = 1;
  150. int64 before_id = 2;
  151. string after_tag_ids = 3;
  152. string fids = 4;
  153. string real_ip = 5;
  154. }
  155. message PromptReq {
  156. int64 mid = 1;
  157. int64 fid = 2;
  158. int32 btype = 3 [ (gogoproto.casttype) = "int8" ];
  159. }
  160. message CreateTagReply { int64 tag_id = 1; }
  161. message PromptReply { bool success = 1; }
  162. message FollowersUnreadReply { bool has_unread = 1; }
  163. message FollowersUnreadCountReply { int64 unread_count = 1; }
  164. message SpecialReply { repeated int64 mids = 1; }
  165. message AchieveGetReq {
  166. string award = 1;
  167. int64 mid = 2;
  168. }
  169. message AchieveGetReply { string awardToken = 1; }
  170. message AchieveReq { string awardToken = 1; }
  171. message AchieveReply {
  172. string award = 1;
  173. int64 mid = 2;
  174. }
  175. message FollowerNotifySettingReply {
  176. int64 mid = 1;
  177. bool enabled = 2;
  178. }
  179. message SameFollowingReq {
  180. int64 mid = 1;
  181. int64 mid2 = 2;
  182. }