user.proto 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. syntax = "proto3";
  2. package api.user;
  3. import "google/api/annotations.proto";
  4. //import "google/protobuf/struct.proto";
  5. import "google/protobuf/empty.proto";
  6. option go_package = "git.ikuban.com/server/pw-protobuf/api/user;user";
  7. option java_multiple_files = true;
  8. option java_package = "api.user";
  9. service User {
  10. rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
  11. option (google.api.http) = {
  12. post: "/api/user/login/debug",
  13. body:"*"
  14. };
  15. };
  16. rpc Authorization (AuthorizationRequest) returns (TokenReply){
  17. option (google.api.http) = {
  18. post: "/api/user/authorization",
  19. body:"*"
  20. };
  21. };
  22. rpc UpdateUserInformation (UpdateUserInformationRequest) returns (google.protobuf.Empty){
  23. option (google.api.http) = {
  24. post: "/api/user/update/information",
  25. body:"*"
  26. };
  27. };
  28. rpc GetUserInfo (google.protobuf.Empty) returns (UserInfo){
  29. option (google.api.http) = {
  30. post: "/api/user/info",
  31. body:"*"
  32. };
  33. };
  34. rpc SendPhoneCode (SendPhoneCodeRequest) returns (google.protobuf.Empty){
  35. option (google.api.http) = {
  36. post: "/api/user/code/send",
  37. body:"*"
  38. };
  39. };
  40. rpc CheckPhoneCode (CheckPhoneCodeRequest) returns (google.protobuf.Empty){
  41. option (google.api.http) = {
  42. post: "/api/user/code/check",
  43. body:"*"
  44. };
  45. };
  46. }
  47. message UserInfo{
  48. string id = 1; // id
  49. string nickname = 2;// 昵称
  50. string avatarUrl =3;// 头像链接
  51. string phone = 4;// 手机号
  52. int64 sex = 5;// 性别
  53. int64 credit = 6;// 积分
  54. }
  55. message UpdateUserInformationRequest {
  56. string Nickname = 1;
  57. string avatarUrl = 2;
  58. int64 sex = 3;
  59. }
  60. message SendPhoneCodeRequest {
  61. string phone = 1;
  62. }
  63. message CheckPhoneCodeRequest {
  64. string phone = 1;
  65. string code = 2;
  66. }
  67. message DebugLoginRequest {
  68. string userId = 1;
  69. string code = 2;
  70. }
  71. message AuthorizationRequest {
  72. string jsCode = 1;
  73. }
  74. message TokenReply {
  75. string token = 1;
  76. }