account.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. syntax = "proto3";
  2. package api.account;
  3. import "google/api/annotations.proto";
  4. import "api/common/common.proto";
  5. //import "api/base/base.proto";
  6. //import "google/protobuf/struct.proto";
  7. import "google/protobuf/empty.proto";
  8. option go_package = "git.ikuban.com/server/pw-protobuf/api/account;account";
  9. option java_multiple_files = true;
  10. option java_package = "api.account";
  11. service Account {
  12. rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
  13. option (google.api.http) = {
  14. post: "/api/login/debug",
  15. body:"*"
  16. };
  17. };
  18. rpc Authorization (AuthorizationRequest) returns (TokenReply){
  19. option (google.api.http) = {
  20. post: "/api/login/authorization",
  21. body:"*"
  22. };
  23. };
  24. rpc RandomNickname (common.SexReq) returns (RandomNicknameReply){
  25. option (google.api.http) = {
  26. post: "/api/common/random/nickname",
  27. body:"*"
  28. };
  29. };
  30. rpc RandomAvatar (common.SexReq) returns (RandomAvatarReply){
  31. option (google.api.http) = {
  32. post: "/api/common/random/avatar",
  33. body:"*"
  34. };
  35. };
  36. rpc RandomAvatarList (common.SexReq) returns (RandomAvatarListReply){};
  37. // 通过openID和appID查询
  38. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  39. // 通过type和PID查询
  40. rpc GetIdentityByTypeAndPID (common.PersonParam) returns (IdentityInfo);
  41. // 通过原公众号openID和appID查询
  42. rpc GetIdentityByFromOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  43. // 通过分组名和性别查询标签
  44. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply);
  45. // 通过标签IDs查询标签
  46. rpc FindTagsByIDs (common.Ids) returns (common.TagListReply);
  47. // 随机介绍接口
  48. rpc RandomIntroduce (common.SexReq) returns (common.RandomIntroduceReply){
  49. option (google.api.http) = {
  50. post: "/api/common/random/introduce",
  51. body:"*"
  52. };
  53. };
  54. // 通过微信下载语音并上传到七牛
  55. rpc UploadMaterialVoice (MediaID) returns (MaterialLink){
  56. option (google.api.http) = {
  57. post: "/api/common/material/upload/voice",
  58. body:"*"
  59. };
  60. };
  61. // 通过类型获取表情包列表
  62. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){};
  63. // 获取对方性别的聊天话题
  64. rpc FindChatTopic (common.FindChatTopicRequest) returns (common.ChatTopicList){};
  65. // 随机表情包
  66. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){};
  67. // 随机打招呼
  68. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){};
  69. // 创建纸条
  70. rpc CreateScrip (CreateScripRequest) returns (ScripID){};
  71. // 删除纸条
  72. rpc DeleteScrip (DeleteScripRequest) returns (google.protobuf.Empty){};
  73. // 查询自己的小纸条
  74. rpc FindMyScrip (FindScripRequest) returns (ScripReply){};
  75. // 查询随机纸条列表
  76. rpc FindRecommendScrip (FindScripRequest) returns (ScripReply){};
  77. // 用户查看纸条
  78. rpc PersonLookScrip (PersonLookScripRequest) returns (google.protobuf.Empty){};
  79. // 用户点击回看
  80. rpc PersonClickLookBack (common.PersonParam) returns (ScripInfo){};
  81. }
  82. message PersonLookScripRequest{
  83. string personId = 1;
  84. string personType = 2;
  85. int64 scripId = 3;// 纸条id
  86. }
  87. message FindScripRequest {
  88. string personId = 1;
  89. string personType = 2;
  90. int64 nextId = 3;
  91. int64 offset = 4;
  92. }
  93. message ScripReply {
  94. repeated ScripInfo list = 1;
  95. int64 nextId = 2;
  96. }
  97. message ScripInfo {
  98. string personId = 1;// 创建者ID
  99. string personType = 2;// 创建者类型
  100. string text = 3;// 纸条内容
  101. string pictureUrl = 4;// 纸条配图
  102. string personName = 5;// 创建者名称
  103. int64 personSex = 6;// 创建者性别
  104. string personAvatar = 7;// 创建者头像
  105. int64 createTime = 8;// 创建时间
  106. }
  107. message DeleteScripRequest {
  108. int64 id = 1;
  109. string personId = 2;
  110. string personType = 3;
  111. }
  112. message CreateScripRequest {
  113. string personId = 1;
  114. string personType = 2;
  115. string text = 3;
  116. string pictureUrl = 4;
  117. }
  118. message ScripID {
  119. int64 id = 1;
  120. }
  121. message MediaID{
  122. string mediaId = 1;
  123. }
  124. message MaterialLink {
  125. string link = 1;
  126. }
  127. message RandomNicknameReply{
  128. string nickname = 1;
  129. }
  130. message RandomAvatarReply{
  131. string avatarUrl = 1;
  132. }
  133. message RandomAvatarListReply{
  134. repeated string list = 1;
  135. }
  136. message OpenIDAndAppIDRequest{
  137. string openId = 1;
  138. string appId = 2;
  139. }
  140. message IdentityInfo{
  141. string pid = 1;
  142. string type = 2;
  143. int64 identityID = 3;
  144. string openId = 4;
  145. }
  146. message UserInfoDB{
  147. string id = 1; // id
  148. string nickname = 2;// 昵称
  149. string avatarUrl =3;// 头像链接
  150. string phone = 4;// 手机号
  151. int64 sex = 5;// 性别
  152. int64 credit = 6;// 积分
  153. }
  154. message PartnerInfoDB{
  155. string id = 1; // id
  156. string nickname = 2;// 昵称
  157. string avatarUrl =3;// 头像链接
  158. string phone = 4;// 手机号
  159. int64 sex = 5;// 性别
  160. int64 credit = 6;// 积分
  161. }
  162. message AuthorizationRequest {
  163. string jsCode = 1;
  164. string appId = 2;
  165. string type = 3;
  166. string fromOpenId = 4;
  167. }
  168. message TokenReply {
  169. string token = 1;
  170. string appId = 2;
  171. }
  172. message DebugLoginRequest {
  173. int64 id = 1;
  174. string code = 2;
  175. }
  176. message LoginToken {
  177. string pid = 1;
  178. string type = 2;
  179. }