user.proto 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 (LoginReply){
  11. option (google.api.http) = {
  12. post: "/api/login/debug",
  13. body:"*"
  14. };
  15. };
  16. rpc Login (LoginRequest) returns (LoginReply){
  17. option (google.api.http) = {
  18. post: "/api/login",
  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 UpdateUserPhone (UpdatePhoneRequest) returns (google.protobuf.Empty){
  29. option (google.api.http) = {
  30. post: "/api/user/update/phone",
  31. body:"*"
  32. };
  33. };
  34. rpc GetUserInfo (google.protobuf.Empty) returns (UserInfo){
  35. option (google.api.http) = {
  36. post: "/api/user/info",
  37. body:"*"
  38. };
  39. };
  40. }
  41. message UserInfo{
  42. string id = 1; // id
  43. string nickname = 2;// 昵称
  44. string avatarUrl =3;// 头像链接
  45. string phone = 4;// 手机号
  46. int64 sex = 5;// 性别
  47. int64 credit = 6;// 积分
  48. }
  49. message UpdateUserInformationRequest {
  50. string Nickname = 1;
  51. string avatarUrl = 2;
  52. int64 sex = 3;
  53. }
  54. message UpdatePhoneRequest {
  55. string phone = 1;
  56. }
  57. message DebugLoginRequest {
  58. string userId = 1;
  59. string code = 2;
  60. }
  61. message LoginRequest {
  62. string jsCode = 1;
  63. }
  64. message LoginReply {
  65. string token = 1;
  66. }