account.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. string privacyPolicyHTML = 12;// 隐私政策
  135. string userAgreementHTML = 13;// 用户协议
  136. }
  137. message GetIdentifyByAccountIDRequest{
  138. int64 accountId = 1;
  139. string appid = 2;
  140. }
  141. message GetIdentifyByAccountIDReply{
  142. string openId = 1;
  143. string appid = 2;
  144. string type = 4;// 类型(小程序、公众号用户)
  145. }
  146. message CheckTextRequest{
  147. string text = 1;// 待审核的文本
  148. }
  149. message CheckTextReply{
  150. bool isPass = 1;// 是否通过
  151. }
  152. message MediaID{
  153. string mediaId = 1;
  154. }
  155. message MaterialLink {
  156. string link = 1;
  157. }
  158. message RandomNicknameReply{
  159. string nickname = 1;
  160. }
  161. message RandomAvatarReply{
  162. string avatarUrl = 1;
  163. }
  164. message RandomAvatarListReply{
  165. repeated string list = 1;
  166. }
  167. message OpenIDAndAppIDRequest{
  168. string openId = 1;
  169. string appId = 2;
  170. }
  171. message IdentityInfo{
  172. string pid = 1;
  173. }
  174. message UserInfoDB{
  175. string id = 1; // id
  176. string nickname = 2;// 昵称
  177. string avatarUrl =3;// 头像链接
  178. string phone = 4;// 手机号
  179. int64 sex = 5;// 性别
  180. int64 credit = 6;// 积分
  181. }
  182. message PartnerInfoDB{
  183. string id = 1; // id
  184. string nickname = 2;// 昵称
  185. string avatarUrl =3;// 头像链接
  186. string phone = 4;// 手机号
  187. int64 sex = 5;// 性别
  188. int64 credit = 6;// 积分
  189. }
  190. message AuthorizationMiniProgramRequest {
  191. string jsCode = 1;
  192. }
  193. message AuthorizationRequest {
  194. string jsCode = 1;
  195. string appId = 2;
  196. string type = 3;
  197. string fromOpenId = 4;
  198. int64 sex = 5;
  199. }
  200. message TokenReply {
  201. string token = 1;
  202. string appId = 2;
  203. }
  204. message MiniProgramTokenReply {
  205. string token = 1;
  206. string appId = 2;
  207. bool isNeedMessage = 3;
  208. }
  209. message DebugLoginRequest {
  210. int64 id = 1;
  211. string code = 2;
  212. }
  213. message LoginToken {
  214. string pid = 1;
  215. string type = 2;
  216. }