account.proto 7.1 KB

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