user.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. syntax = "proto3";
  2. package live.webucenter;
  3. option go_package = "http";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. service User {
  6. // 根据uid查询用户信息
  7. // `midware:"auth"`
  8. rpc get_user_info (GetInfoReq) returns (GetInfoResp);
  9. }
  10. // GetInfoReq get user info req, uid and platform get from header.metadata
  11. message GetInfoReq {
  12. // platform in url
  13. string platform = 1 [(gogoproto.moretags) = 'form:"platform"'];
  14. }
  15. // GetInfoResp
  16. message GetInfoResp {
  17. // 用户uid
  18. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  19. // 用户名
  20. string uname = 2 [(gogoproto.jsontag) = "uname"];
  21. // 头像
  22. string face = 3 [(gogoproto.jsontag) = "face"];
  23. // 主站硬币
  24. double coin = 4 [(gogoproto.jsontag) = "billCoin"];
  25. // 用户银瓜子
  26. int64 silver = 5 [(gogoproto.jsontag) = "silver"];
  27. // 用户金瓜子
  28. int64 gold = 6 [(gogoproto.jsontag) = "gold"];
  29. // 用户成就点
  30. int64 achieve = 7 [(gogoproto.jsontag) = "achieve"];
  31. // 月费姥爷
  32. int32 vip = 8 [(gogoproto.jsontag) = "vip", (gogoproto.casttype) = "int"];
  33. // 年费姥爷
  34. int32 svip = 9 [(gogoproto.jsontag) = "svip", (gogoproto.casttype) = "int"];
  35. // 用户等级
  36. int64 user_level = 10 [(gogoproto.jsontag) = "user_level"];
  37. // 用户下一等级
  38. int64 user_next_level = 11 [(gogoproto.jsontag) = "user_next_level"];
  39. // 用户在当前等级已经获得的经验
  40. int64 user_intimacy = 12 [(gogoproto.jsontag) = "user_intimacy"];
  41. // 用户从当前等级升级到下一级所需总经验
  42. int64 user_next_intimacy = 13 [(gogoproto.jsontag) = "user_next_intimacy"];
  43. // 新增字段,判断用户是否达到满级 0:没有1:满级
  44. int64 is_level_top = 14 [(gogoproto.jsontag) = "is_level_top"];
  45. // 用户等级排名
  46. string user_level_rank = 15 [(gogoproto.jsontag) = "user_level_rank"];
  47. // 年返逻辑,已失效
  48. int32 user_charged = 16 [(gogoproto.jsontag) = "user_charged", (gogoproto.casttype) = "int"];
  49. }