account.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. rpc AuthorizationHalfScreenMiniProgram (AuthorizationHalfScreenMiniProgramRequest) returns (google.protobuf.Empty){
  31. option (google.api.http) = {
  32. post: "/api/login/authorization/miniprogram/halfscreen",
  33. body:"*"
  34. };
  35. };
  36. // 获取用户登录配置
  37. rpc GetUserLoginConfig (google.protobuf.Empty) returns (common.GetLoginConfigReply){
  38. option (google.api.http) = {
  39. post: "/api/login/config",
  40. body:"*"
  41. };
  42. };
  43. // 获取公众号配置
  44. rpc GetGetGzhConfig (google.protobuf.Empty) returns (GetGetGzhConfigReply){
  45. option (google.api.http) = {
  46. post: "/api/login/gzh/conf",
  47. body:"*"
  48. };
  49. };
  50. // 通过openID和appID查询
  51. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  52. // 通过openID和appID查询 未查到就创建
  53. rpc GetIdentityByOpenIDAndAppIDAndCreate (OpenIDAndAppIDRequest) returns (IdentityInfo);
  54. // 通过accountID获取Identify信息
  55. rpc GetIdentifyByAccountID (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  56. // 通过accountID获取Identify信息
  57. rpc GetIdentifyByAccountIDAndIsSubscribe (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  58. // 通过accountID获取Identify信息
  59. rpc GetIdentifyByAccountIDAndIsSubscribeByMiniProgram (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  60. // 通过accountID获取Identify信息
  61. rpc FindIdentifyByAccountIDAndIsSubscribe (FindIdentifyByAccountIDAndIsSubscribeRequest) returns (FindIdentifyByAccountIDAndIsSubscribeReply){};
  62. // 用户关注
  63. rpc UserSubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  64. // 用户取关
  65. rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  66. // 获取用户手机号哦
  67. rpc GetUserPhoneByCode (GetUserPhoneByCodeRequest) returns (GetUserPhoneByCodeReply){};
  68. }
  69. message GetUserPhoneByCodeRequest{
  70. string code = 1;
  71. string type = 2;
  72. }
  73. message GetUserPhoneByCodeReply{
  74. string phone = 2;
  75. }
  76. message ReduceSubscribeMessageRequest{
  77. string subscribeId = 1;
  78. string userId = 2;
  79. }
  80. message StatisticsSubscribeMessageRequest{
  81. repeated string idList = 1;
  82. }
  83. message FindIdentifyByAccountIDAndIsSubscribeRequest{
  84. repeated int64 accountIds = 1;
  85. }
  86. message FindIdentifyByAccountIDAndIsSubscribeReply{
  87. repeated FindIdentifyByAccountIDInfo list = 1;
  88. }
  89. message FindIdentifyByAccountIDInfo{
  90. string openId = 1;
  91. string appid = 2;
  92. int64 accountId = 3;
  93. string type = 4;// 类型(小程序、公众号用户)
  94. }
  95. message GetGetGzhConfigReply{
  96. string appId = 1;// 公众号Id
  97. string name = 2;// 公众号名称
  98. string imageUrl = 3;// 公众号图片
  99. string privacyPolicyUrl = 4;// 公众号隐私政策链接
  100. string userAgreementUrl = 5;// 公众号用户协议链接
  101. repeated string noteSubscribeTemplateIds = 6;
  102. repeated string chatSubscribeTemplateIds = 7;
  103. repeated string registerSubscribeTemplateIds = 8;
  104. string contactUrl = 9;
  105. bool isOpenActive = 10;
  106. string activeLink = 11;
  107. string privacyPolicyHTML = 12;// 隐私政策
  108. string userAgreementHTML = 13;// 用户协议
  109. string vipPolicyHTML = 14;// vip充值协议
  110. repeated string messageSubscribeTemplateIds = 15;
  111. }
  112. message GetIdentifyByAccountIDRequest{
  113. int64 accountId = 1;
  114. string appid = 2;
  115. }
  116. message GetIdentifyByAccountIDReply{
  117. string openId = 1;
  118. string appid = 2;
  119. string type = 4;// 类型(小程序、公众号用户)
  120. }
  121. message CheckTextRequest{
  122. string text = 1;// 待审核的文本
  123. }
  124. message CheckTextReply{
  125. bool isPass = 1;// 是否通过
  126. }
  127. message MediaID{
  128. string mediaId = 1;
  129. }
  130. message MaterialLink {
  131. string link = 1;
  132. }
  133. message OpenIDAndAppIDRequest{
  134. string openId = 1;
  135. string appId = 2;
  136. }
  137. message IdentityInfo{
  138. string pid = 1;
  139. int64 accountId = 2;
  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 AuthorizationHalfScreenMiniProgramRequest {
  161. string jsCode = 1;
  162. string userId = 2;
  163. }
  164. message AuthorizationRequest {
  165. string jsCode = 1;
  166. string appId = 2;
  167. string type = 3;
  168. string fromOpenId = 4;
  169. int64 sex = 5;
  170. }
  171. message TokenReply {
  172. string token = 1;
  173. string appId = 2;
  174. }
  175. message MiniProgramTokenReply {
  176. string token = 1;
  177. string appId = 2;
  178. bool isNeedMessage = 3;
  179. }
  180. message DebugLoginRequest {
  181. int64 id = 1;
  182. string code = 2;
  183. }
  184. message LoginToken {
  185. string pid = 1;
  186. string type = 2;
  187. }