account.proto 5.3 KB

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