user.proto 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/partner/partner.proto";
  8. import "api/common/common.proto";
  9. option go_package = "git.ikuban.com/server/pw-protobuf/api/user;user";
  10. option java_multiple_files = true;
  11. option java_package = "api.user";
  12. service User {
  13. // 更新用户信息
  14. rpc UpdateUserInformation (UpdateUserInformationRequest) returns (google.protobuf.Empty){
  15. option (google.api.http) = {
  16. post: "/api/user/update/information",
  17. body:"*"
  18. };
  19. };
  20. // 获取用户详情
  21. rpc GetUserInfo (google.protobuf.Empty) returns (UserInfo){
  22. option (google.api.http) = {
  23. post: "/api/user/info",
  24. body:"*"
  25. };
  26. };
  27. // 检查用户是否与陪聊关联
  28. rpc CheckUserPartnerIsRelationship (common.PartnerIDParam) returns (chat.CheckUserPartnerIsRelationshipReply){
  29. option (google.api.http) = {
  30. post: "/api/user/check/relationship",
  31. body:"*"
  32. };
  33. };
  34. // 创建用户与陪聊的关联
  35. rpc CreateUserPartnerIsRelationship (common.PartnerIDParam) returns (chat.CreateUserPartnerIsRelationshipReply){
  36. option (google.api.http) = {
  37. post: "/api/user/create/relationship",
  38. body:"*"
  39. };
  40. };
  41. rpc GetPartnerCircleInfo (common.PartnerIDParam) returns (partner.PartnerCircleInfo){
  42. option (google.api.http) = {
  43. post: "/api/partner/circle/info",
  44. body:"*"
  45. };
  46. };
  47. rpc GetUserHomeInfo (common.UserIDParam) returns (UserHomeInfo){
  48. option (google.api.http) = {
  49. post: "/api/user/circle/info",
  50. body:"*"
  51. };
  52. };
  53. }
  54. message UserHomeInfo{
  55. string id = 1; // id
  56. string nickname = 2;// 昵称
  57. string avatarUrl =3;// 头像链接
  58. int64 sex = 4;// 性别
  59. repeated string pictures = 5; // 图片
  60. int64 age = 6; // 年龄
  61. string constellation = 7; // 星座
  62. string area = 8; // 地区
  63. repeated string tag = 9; // 标签
  64. string signature = 10; // 签名
  65. string introduceVoice = 11; // 介绍语音
  66. int64 likedNum = 12;// 喜欢我
  67. int64 lookNum = 13;// 看过我
  68. }
  69. message UserInfo{
  70. string id = 1; // id
  71. string nickname = 2;// 昵称
  72. string avatarUrl =3;// 头像链接
  73. int64 age = 4;// 年龄
  74. int64 sex = 5;// 性别
  75. int64 credit = 6;// 积分
  76. int64 likeNum = 7;// 我喜欢
  77. int64 likedNum = 8;// 喜欢我
  78. int64 lookNum = 9;// 看过我
  79. }
  80. message UpdateUserInformationRequest {
  81. string Nickname = 1;
  82. string avatarUrl = 2;
  83. int64 sex = 3;
  84. }