account.proto 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. syntax = "proto3";
  2. package api.account;
  3. import "google/api/annotations.proto";
  4. //import "api/base/base.proto";
  5. //import "google/protobuf/struct.proto";
  6. //import "google/protobuf/empty.proto";
  7. option go_package = "git.ikuban.com/server/pw-protobuf/api/account;account";
  8. option java_multiple_files = true;
  9. option java_package = "api.account";
  10. service Account {
  11. rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
  12. option (google.api.http) = {
  13. post: "/api/login/debug",
  14. body:"*"
  15. };
  16. };
  17. rpc Authorization (AuthorizationRequest) returns (TokenReply){
  18. option (google.api.http) = {
  19. post: "/api/login/authorization",
  20. body:"*"
  21. };
  22. };
  23. rpc RandomNickname (RandomNicknameRequest) returns (RandomNicknameReply){
  24. option (google.api.http) = {
  25. post: "/api/random/nickname",
  26. body:"*"
  27. };
  28. };
  29. rpc RandomAvatar (RandomAvatarRequest) returns (RandomAvatarReply){
  30. option (google.api.http) = {
  31. post: "/api/random/avatar",
  32. body:"*"
  33. };
  34. };
  35. // 通过openID和appID查询
  36. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  37. // 通过原公众号openID和appID查询
  38. rpc GetIdentityByFromOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  39. }
  40. message RandomNicknameRequest{
  41. int64 sex = 1;
  42. }
  43. message RandomNicknameReply{
  44. string nickname = 1;
  45. }
  46. message RandomAvatarRequest{
  47. int64 sex = 1;
  48. }
  49. message RandomAvatarReply{
  50. string avatarUrl = 1;
  51. }
  52. message OpenIDAndAppIDRequest{
  53. string openId = 1;
  54. string appId = 2;
  55. }
  56. message IdentityInfo{
  57. string id = 1;
  58. string type = 2;
  59. }
  60. message UserInfoDB{
  61. string id = 1; // id
  62. string nickname = 2;// 昵称
  63. string avatarUrl =3;// 头像链接
  64. string phone = 4;// 手机号
  65. int64 sex = 5;// 性别
  66. int64 credit = 6;// 积分
  67. }
  68. message PartnerInfoDB{
  69. string id = 1; // id
  70. string nickname = 2;// 昵称
  71. string avatarUrl =3;// 头像链接
  72. string phone = 4;// 手机号
  73. int64 sex = 5;// 性别
  74. int64 credit = 6;// 积分
  75. }
  76. message AuthorizationRequest {
  77. string jsCode = 1;
  78. string appId = 2;
  79. string type = 3;
  80. string fromOpenId = 4;
  81. }
  82. message TokenReply {
  83. string token = 1;
  84. }
  85. message DebugLoginRequest {
  86. int64 id = 1;
  87. string code = 2;
  88. }
  89. message LoginToken {
  90. string pid = 1;
  91. string type = 2;
  92. }