account.proto 5.3 KB

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