account.proto 5.5 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 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. // 通过微信下载语音并上传到七牛
  45. rpc UploadMaterialVoice (MediaID) returns (MaterialLink){
  46. option (google.api.http) = {
  47. post: "/api/common/material/upload/voice",
  48. body:"*"
  49. };
  50. };
  51. // 统计订阅消息
  52. rpc StatisticsSubscribeMessage (StatisticsSubscribeMessageRequest) returns (google.protobuf.Empty){
  53. option (google.api.http) = {
  54. post: "/api/common/subscribe/statistic",
  55. body:"*"
  56. };
  57. };
  58. // 检查文本-百度云
  59. rpc CheckText (CheckTextRequest) returns (CheckTextReply){}
  60. // 通过openID和appID查询
  61. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  62. // 通过openID和appID查询 未查到就创建
  63. rpc GetIdentityByOpenIDAndAppIDAndCreate (OpenIDAndAppIDRequest) returns (IdentityInfo);
  64. // 通过accountID获取Identify信息
  65. rpc GetIdentifyByAccountID (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  66. // 通过accountID获取Identify信息
  67. rpc GetIdentifyByAccountIDAndIsSubscribe (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  68. // 通过accountID获取Identify信息
  69. rpc GetIdentifyByAccountIDAndIsSubscribeByMiniProgram (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  70. // 通过accountID获取Identify信息
  71. rpc FindIdentifyByAccountIDAndIsSubscribe (FindIdentifyByAccountIDAndIsSubscribeRequest) returns (FindIdentifyByAccountIDAndIsSubscribeReply){};
  72. // 用户关注
  73. rpc UserSubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  74. // 用户取关
  75. rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  76. }
  77. message ReduceSubscribeMessageRequest{
  78. string subscribeId = 1;
  79. string userId = 2;
  80. }
  81. message StatisticsSubscribeMessageRequest{
  82. repeated string idList = 1;
  83. }
  84. message FindIdentifyByAccountIDAndIsSubscribeRequest{
  85. repeated int64 accountIds = 1;
  86. }
  87. message FindIdentifyByAccountIDAndIsSubscribeReply{
  88. repeated FindIdentifyByAccountIDInfo list = 1;
  89. }
  90. message FindIdentifyByAccountIDInfo{
  91. string openId = 1;
  92. string appid = 2;
  93. int64 accountId = 3;
  94. string type = 4;// 类型(小程序、公众号用户)
  95. }
  96. message GetGetGzhConfigReply{
  97. string appId = 1;// 公众号Id
  98. string name = 2;// 公众号名称
  99. string imageUrl = 3;// 公众号图片
  100. string privacyPolicyUrl = 4;// 公众号隐私政策链接
  101. string userAgreementUrl = 5;// 公众号用户协议链接
  102. repeated string noteSubscribeTemplateIds = 6;
  103. repeated string chatSubscribeTemplateIds = 7;
  104. repeated string registerSubscribeTemplateIds = 8;
  105. string contactUrl = 9;
  106. bool isOpenActive = 10;
  107. string activeLink = 11;
  108. string privacyPolicyHTML = 12;// 隐私政策
  109. string userAgreementHTML = 13;// 用户协议
  110. string vipPolicyHTML = 14;// vip充值协议
  111. repeated string messageSubscribeTemplateIds = 15;
  112. }
  113. message GetIdentifyByAccountIDRequest{
  114. int64 accountId = 1;
  115. string appid = 2;
  116. }
  117. message GetIdentifyByAccountIDReply{
  118. string openId = 1;
  119. string appid = 2;
  120. string type = 4;// 类型(小程序、公众号用户)
  121. }
  122. message CheckTextRequest{
  123. string text = 1;// 待审核的文本
  124. }
  125. message CheckTextReply{
  126. bool isPass = 1;// 是否通过
  127. }
  128. message MediaID{
  129. string mediaId = 1;
  130. }
  131. message MaterialLink {
  132. string link = 1;
  133. }
  134. message OpenIDAndAppIDRequest{
  135. string openId = 1;
  136. string appId = 2;
  137. }
  138. message IdentityInfo{
  139. string pid = 1;
  140. }
  141. message UserInfoDB{
  142. string id = 1; // id
  143. string nickname = 2;// 昵称
  144. string avatarUrl =3;// 头像链接
  145. string phone = 4;// 手机号
  146. int64 sex = 5;// 性别
  147. int64 credit = 6;// 积分
  148. }
  149. message PartnerInfoDB{
  150. string id = 1; // id
  151. string nickname = 2;// 昵称
  152. string avatarUrl =3;// 头像链接
  153. string phone = 4;// 手机号
  154. int64 sex = 5;// 性别
  155. int64 credit = 6;// 积分
  156. }
  157. message AuthorizationMiniProgramRequest {
  158. string jsCode = 1;
  159. }
  160. message AuthorizationRequest {
  161. string jsCode = 1;
  162. string appId = 2;
  163. string type = 3;
  164. string fromOpenId = 4;
  165. int64 sex = 5;
  166. }
  167. message TokenReply {
  168. string token = 1;
  169. string appId = 2;
  170. }
  171. message MiniProgramTokenReply {
  172. string token = 1;
  173. string appId = 2;
  174. bool isNeedMessage = 3;
  175. }
  176. message DebugLoginRequest {
  177. int64 id = 1;
  178. string code = 2;
  179. }
  180. message LoginToken {
  181. string pid = 1;
  182. string type = 2;
  183. }