account.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 RandomNickname (RandomNicknameRequest) returns (RandomNicknameReply){
  25. option (google.api.http) = {
  26. post: "/api/random/nickname",
  27. body:"*"
  28. };
  29. };
  30. rpc RandomAvatar (RandomAvatarRequest) returns (RandomAvatarReply){
  31. option (google.api.http) = {
  32. post: "/api/random/avatar",
  33. body:"*"
  34. };
  35. };
  36. // 通过openID和appID查询
  37. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  38. // 通过原公众号openID和appID查询
  39. rpc GetIdentityByFromOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  40. // 通过分组名和性别查询标签
  41. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply);
  42. // 通过标签IDs查询标签
  43. rpc FindByIDs (common.Ids) returns (common.TagListReply);
  44. // 随机介绍接口
  45. rpc RandomIntroduce (common.SexReq) returns (common.RandomIntroduceReply){
  46. option (google.api.http) = {
  47. post: "/api/random/introduce",
  48. body:"*"
  49. };
  50. };
  51. }
  52. message RandomNicknameRequest{
  53. int64 sex = 1;
  54. }
  55. message RandomNicknameReply{
  56. string nickname = 1;
  57. }
  58. message RandomAvatarRequest{
  59. int64 sex = 1;
  60. }
  61. message RandomAvatarReply{
  62. string avatarUrl = 1;
  63. }
  64. message OpenIDAndAppIDRequest{
  65. string openId = 1;
  66. string appId = 2;
  67. }
  68. message IdentityInfo{
  69. string id = 1;
  70. string type = 2;
  71. }
  72. message UserInfoDB{
  73. string id = 1; // id
  74. string nickname = 2;// 昵称
  75. string avatarUrl =3;// 头像链接
  76. string phone = 4;// 手机号
  77. int64 sex = 5;// 性别
  78. int64 credit = 6;// 积分
  79. }
  80. message PartnerInfoDB{
  81. string id = 1; // id
  82. string nickname = 2;// 昵称
  83. string avatarUrl =3;// 头像链接
  84. string phone = 4;// 手机号
  85. int64 sex = 5;// 性别
  86. int64 credit = 6;// 积分
  87. }
  88. message AuthorizationRequest {
  89. string jsCode = 1;
  90. string appId = 2;
  91. string type = 3;
  92. string fromOpenId = 4;
  93. }
  94. message TokenReply {
  95. string token = 1;
  96. }
  97. message DebugLoginRequest {
  98. int64 id = 1;
  99. string code = 2;
  100. }
  101. message LoginToken {
  102. string pid = 1;
  103. string type = 2;
  104. }