account.proto 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. // 获取公众号配置
  37. rpc GetGetGzhConfig (google.protobuf.Empty) returns (GetGetGzhConfigReply){
  38. option (google.api.http) = {
  39. post: "/api/login/gzh/conf",
  40. body:"*"
  41. };
  42. };
  43. // 统计订阅消息
  44. rpc StatisticsSubscribeMessage (StatisticsSubscribeMessageRequest) returns (google.protobuf.Empty){
  45. option (google.api.http) = {
  46. post: "/api/common/subscribe/statistic",
  47. body:"*"
  48. };
  49. };
  50. rpc RandomAvatarList (common.SexReq) returns (RandomAvatarListReply){};
  51. // 通过openID和appID查询
  52. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  53. // 通过openID和appID查询 未查到就创建
  54. rpc GetIdentityByOpenIDAndAppIDAndCreate (OpenIDAndAppIDRequest) returns (IdentityInfo);
  55. // 通过分组名和性别查询标签
  56. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply);
  57. // 通过标签IDs查询标签
  58. rpc FindTagsByIDs (common.Ids) returns (common.TagListReply);
  59. // 随机介绍接口
  60. rpc RandomIntroduce (common.SexReq) returns (common.RandomIntroduceReply){
  61. option (google.api.http) = {
  62. post: "/api/common/random/introduce",
  63. body:"*"
  64. };
  65. };
  66. // 通过微信下载语音并上传到七牛
  67. rpc UploadMaterialVoice (MediaID) returns (MaterialLink){
  68. option (google.api.http) = {
  69. post: "/api/common/material/upload/voice",
  70. body:"*"
  71. };
  72. };
  73. // 通过类型获取表情包列表
  74. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){};
  75. // 获取对方性别的聊天话题
  76. rpc FindChatTopic (common.FindChatTopicRequest) returns (common.ChatTopicList){};
  77. // 随机表情包
  78. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){};
  79. // 随机打招呼
  80. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){};
  81. // 检查文本-百度云
  82. rpc CheckText (CheckTextRequest) returns (CheckTextReply){}
  83. // 获取用户登录配置
  84. rpc GetUserLoginConfig (common.GetLoginConfigRequest) returns (common.GetLoginConfigReply){
  85. option (google.api.http) = {
  86. post: "/api/login/config",
  87. body:"*"
  88. };
  89. };
  90. // 通过accountID获取Identify信息
  91. rpc GetIdentifyByAccountID (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  92. // 通过accountID获取Identify信息
  93. rpc GetIdentifyByAccountIDAndIsSubscribe (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  94. // 通过accountID获取Identify信息
  95. rpc FindIdentifyByAccountIDAndIsSubscribe (FindIdentifyByAccountIDAndIsSubscribeRequest) returns (FindIdentifyByAccountIDAndIsSubscribeReply){};
  96. // 用户关注
  97. rpc UserSubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  98. // 用户取关
  99. rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  100. }
  101. message StatisticsSubscribeMessageRequest{
  102. repeated string idList = 1;
  103. }
  104. message FindIdentifyByAccountIDAndIsSubscribeRequest{
  105. repeated int64 accountIds = 1;
  106. }
  107. message FindIdentifyByAccountIDAndIsSubscribeReply{
  108. repeated FindIdentifyByAccountIDInfo list = 1;
  109. }
  110. message FindIdentifyByAccountIDInfo{
  111. string openId = 1;
  112. string appid = 2;
  113. int64 accountId = 3;
  114. }
  115. message GetGetGzhConfigReply{
  116. string appId = 1;// 公众号Id
  117. string name = 2;// 公众号名称
  118. string imageUrl = 3;// 公众号图片
  119. string privacyPolicyUrl = 4;// 公众号隐私政策链接
  120. string userAgreementUrl = 5;// 公众号用户协议链接
  121. repeated string noteSubscribeTemplateIds = 6;
  122. repeated string chatSubscribeTemplateIds = 7;
  123. repeated string registerSubscribeTemplateIds = 8;
  124. string contactUrl = 9;
  125. bool isOpenActive = 10;
  126. string activeLink = 11;
  127. }
  128. message GetIdentifyByAccountIDRequest{
  129. int64 accountId = 1;
  130. string appid = 2;
  131. }
  132. message GetIdentifyByAccountIDReply{
  133. string openId = 1;
  134. string appid = 2;
  135. }
  136. message CheckTextRequest{
  137. string text = 1;// 待审核的文本
  138. }
  139. message CheckTextReply{
  140. bool isPass = 1;// 是否通过
  141. }
  142. message MediaID{
  143. string mediaId = 1;
  144. }
  145. message MaterialLink {
  146. string link = 1;
  147. }
  148. message RandomNicknameReply{
  149. string nickname = 1;
  150. }
  151. message RandomAvatarReply{
  152. string avatarUrl = 1;
  153. }
  154. message RandomAvatarListReply{
  155. repeated string list = 1;
  156. }
  157. message OpenIDAndAppIDRequest{
  158. string openId = 1;
  159. string appId = 2;
  160. }
  161. message IdentityInfo{
  162. string pid = 1;
  163. }
  164. message UserInfoDB{
  165. string id = 1; // id
  166. string nickname = 2;// 昵称
  167. string avatarUrl =3;// 头像链接
  168. string phone = 4;// 手机号
  169. int64 sex = 5;// 性别
  170. int64 credit = 6;// 积分
  171. }
  172. message PartnerInfoDB{
  173. string id = 1; // id
  174. string nickname = 2;// 昵称
  175. string avatarUrl =3;// 头像链接
  176. string phone = 4;// 手机号
  177. int64 sex = 5;// 性别
  178. int64 credit = 6;// 积分
  179. }
  180. message AuthorizationRequest {
  181. string jsCode = 1;
  182. string appId = 2;
  183. string type = 3;
  184. string fromOpenId = 4;
  185. int64 sex = 5;
  186. }
  187. message TokenReply {
  188. string token = 1;
  189. string appId = 2;
  190. }
  191. message DebugLoginRequest {
  192. int64 id = 1;
  193. string code = 2;
  194. }
  195. message LoginToken {
  196. string pid = 1;
  197. string type = 2;
  198. }