account.proto 5.9 KB

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