user.proto 2.1 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. import "api/chat/chat.proto";
  7. import "api/common/common.proto";
  8. option go_package = "git.ikuban.com/server/pw-protobuf/api/user;user";
  9. option java_multiple_files = true;
  10. option java_package = "api.user";
  11. service User {
  12. // 更新用户信息
  13. rpc UpdateUserInformation (UpdateUserInformationRequest) returns (google.protobuf.Empty){
  14. option (google.api.http) = {
  15. post: "/api/user/update/information",
  16. body:"*"
  17. };
  18. };
  19. // 获取用户详情
  20. rpc GetUserInfo (google.protobuf.Empty) returns (UserInfo){
  21. option (google.api.http) = {
  22. post: "/api/user/info",
  23. body:"*"
  24. };
  25. };
  26. // 检查用户是否与陪聊关联
  27. rpc CheckUserPartnerIsRelationship (common.PartnerIDParam) returns (chat.CheckUserPartnerIsRelationshipReply){
  28. option (google.api.http) = {
  29. post: "/api/user/check/relationship",
  30. body:"*"
  31. };
  32. };
  33. // 创建用户与陪聊的关联
  34. rpc CreateUserPartnerIsRelationship (common.PartnerIDParam) returns (chat.CreateUserPartnerIsRelationshipReply){
  35. option (google.api.http) = {
  36. post: "/api/user/create/relationship",
  37. body:"*"
  38. };
  39. };
  40. // 获取陪聊的确认通过页面信息
  41. rpc GetPartnerCircleInfo (common.PartnerIDParam) returns (common.AddFriendMessageInfo){
  42. option (google.api.http) = {
  43. post: "/api/partner/circle/info",
  44. body:"*"
  45. };
  46. };
  47. // 获取用户主页信息
  48. rpc GetUserHomeInfo (common.UserIDParam) returns (common.HomeInfo){
  49. option (google.api.http) = {
  50. post: "/api/user/home",
  51. body:"*"
  52. };
  53. };
  54. }
  55. message UserInfo{
  56. string id = 1; // id
  57. string nickname = 2;// 昵称
  58. string avatarUrl =3;// 头像链接
  59. int64 age = 4;// 年龄
  60. int64 sex = 5;// 性别
  61. int64 credit = 6;// 积分
  62. int64 likeNum = 7;// 我喜欢
  63. int64 likedNum = 8;// 喜欢我
  64. int64 lookNum = 9;// 看过我
  65. }
  66. message UpdateUserInformationRequest {
  67. string Nickname = 1; // 昵称
  68. string avatarUrl = 2;// 头像
  69. int64 sex = 3; // 性别
  70. }