user.proto 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 UserGetHomeInfo (common.PersonParam) returns (common.HomeInfo){
  49. option (google.api.http) = {
  50. post: "/api/user/home",
  51. body:"*"
  52. };
  53. };
  54. // 通过用户IDs查看用户信息列表
  55. rpc FindUserDBList (common.PersonIDList) returns (common.PersonDBReply);
  56. }
  57. message UserInfo{
  58. string id = 1; // id
  59. string nickname = 2;// 昵称
  60. string avatarUrl =3;// 头像链接
  61. int64 age = 4;// 年龄
  62. int64 sex = 5;// 性别
  63. int64 credit = 6;// 积分
  64. int64 likeNum = 7;// 我喜欢
  65. int64 likedNum = 8;// 喜欢我
  66. int64 likedUnreadNum = 9; // 喜欢我的未读数
  67. int64 lookNum = 10;// 看过我
  68. int64 lookUnreadNum = 11;// 看过我的未读数
  69. }
  70. message UpdateUserInformationRequest {
  71. string Nickname = 1; // 昵称
  72. string avatarUrl = 2;// 头像
  73. int64 sex = 3; // 性别
  74. }