account.proto 6.5 KB

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