account.proto 5.2 KB

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