account.proto 7.2 KB

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