account.proto 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 CreateTestUser (google.protobuf.Empty) returns (google.protobuf.Empty){
  12. option (google.api.http) = {
  13. post: "/api/login/create",
  14. body:"*"
  15. };
  16. };
  17. rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
  18. option (google.api.http) = {
  19. post: "/api/login/debug",
  20. body:"*"
  21. };
  22. };
  23. rpc Authorization (AuthorizationRequest) returns (TokenReply){
  24. option (google.api.http) = {
  25. post: "/api/login/authorization",
  26. body:"*"
  27. };
  28. };
  29. rpc SendPhoneCode (SendPhoneCodeRequest) returns (google.protobuf.Empty){
  30. option (google.api.http) = {
  31. post: "/api/user/code/send",
  32. body:"*"
  33. };
  34. };
  35. rpc CheckPhoneCode (CheckPhoneCodeRequest) returns (google.protobuf.Empty){
  36. option (google.api.http) = {
  37. post: "/api/user/code/check",
  38. body:"*"
  39. };
  40. };
  41. rpc GetIdentityByOpenID (OpenIDRequest) returns (IdentityInfo);
  42. }
  43. message OpenIDRequest{
  44. string openId = 1;
  45. }
  46. message IdentityInfo{
  47. string id = 1;
  48. string type = 2;
  49. }
  50. message SendPhoneCodeRequest {
  51. string phone = 1;
  52. }
  53. message CheckPhoneCodeRequest {
  54. string phone = 1;
  55. string code = 2;
  56. }
  57. message UserInfoDB{
  58. string id = 1; // id
  59. string nickname = 2;// 昵称
  60. string avatarUrl =3;// 头像链接
  61. string phone = 4;// 手机号
  62. int64 sex = 5;// 性别
  63. int64 credit = 6;// 积分
  64. }
  65. message PartnerInfoDB{
  66. string id = 1; // id
  67. string nickname = 2;// 昵称
  68. string avatarUrl =3;// 头像链接
  69. string phone = 4;// 手机号
  70. int64 sex = 5;// 性别
  71. int64 credit = 6;// 积分
  72. }
  73. message AuthorizationRequest {
  74. string jsCode = 1;
  75. string appId = 2;
  76. string type = 3;
  77. }
  78. message TokenReply {
  79. string token = 1;
  80. }
  81. message DebugLoginRequest {
  82. int64 id = 1;
  83. string code = 2;
  84. }
  85. message LoginToken {
  86. string pid = 1;
  87. string type = 2;
  88. }