account.proto 5.0 KB

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