account.proto 5.6 KB

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