UserTitle.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. syntax = "proto3";
  2. package rc.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. service UserTitle {
  6. /** 根据头衔id获取头衔名称,头衔不存在不返回
  7. *
  8. */
  9. rpc getTitleByIds (UserTitleGetTitleByIdsReq) returns (UserTitleGetTitleByIdsResp);
  10. /** 移动端获取佩戴的头衔
  11. *
  12. */
  13. rpc getMobileTitle (UserTitleGetMobileTitleReq) returns (UserTitleGetMobileTitleResp);
  14. /** 获取弹幕头衔(需要登录态)
  15. *
  16. */
  17. rpc getCommentTitle (UserTitleGetCommentTitleReq) returns (UserTitleGetCommentTitleResp);
  18. /** 添加头衔
  19. *
  20. */
  21. rpc add (UserTitleAddReq) returns (UserTitleAddResp);
  22. /** 个人中心我的头衔列表
  23. *
  24. */
  25. rpc getAll (UserTitleGetAllReq) returns (UserTitleGetAllResp);
  26. }
  27. message UserTitleGetTitleByIdsReq {
  28. // 头衔ID列表
  29. repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
  30. }
  31. message UserTitleGetTitleByIdsResp {
  32. //
  33. int64 code = 1 [(gogoproto.jsontag) = "code"];
  34. //
  35. string msg = 2 [(gogoproto.jsontag) = "msg"];
  36. //
  37. string message = 3 [(gogoproto.jsontag) = "message"];
  38. //
  39. map<int64, string> data = 4 [(gogoproto.jsontag) = "data"];
  40. }
  41. message UserTitleGetMobileTitleReq {
  42. //
  43. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  44. }
  45. message UserTitleGetMobileTitleResp {
  46. //
  47. int64 code = 1 [(gogoproto.jsontag) = "code"];
  48. //
  49. string msg = 2 [(gogoproto.jsontag) = "msg"];
  50. //
  51. string message = 3 [(gogoproto.jsontag) = "message"];
  52. //
  53. Data data = 4 [(gogoproto.jsontag) = "data"];
  54. message Data {
  55. // 头衔标识
  56. string title = 1 [(gogoproto.jsontag) = "title"];
  57. // 头衔名称
  58. string activity = 2 [(gogoproto.jsontag) = "activity"];
  59. }
  60. }
  61. message UserTitleGetCommentTitleReq {
  62. }
  63. message UserTitleGetCommentTitleResp {
  64. // code
  65. int64 code = 1 [(gogoproto.jsontag) = "code"];
  66. // msg
  67. string msg = 2 [(gogoproto.jsontag) = "msg"];
  68. // data[0]老头衔唯一标识如 'cake-flour', data[1]新头衔唯一标识如'title-137-1', 无头衔为空数组
  69. repeated string data = 3 [(gogoproto.jsontag) = "data"];
  70. }
  71. message UserTitleAddReq {
  72. // UID
  73. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  74. // 头衔id
  75. int64 title_id = 2 [(gogoproto.jsontag) = "title_id"];
  76. // 过期时间dateTime
  77. string expire_time = 3 [(gogoproto.jsontag) = "expire_time"];
  78. // 积分
  79. int64 score = 4 [(gogoproto.jsontag) = "score"];
  80. }
  81. message UserTitleAddResp {
  82. // code
  83. int64 code = 1 [(gogoproto.jsontag) = "code"];
  84. // msg
  85. string msg = 2 [(gogoproto.jsontag) = "msg"];
  86. //
  87. Data data = 3 [(gogoproto.jsontag) = "data"];
  88. message Data {
  89. }
  90. }
  91. message UserTitleGetAllReq {
  92. // UID
  93. int64 uid = 1 [(gogoproto.jsontag) = "uid"];
  94. }
  95. message UserTitleGetAllResp {
  96. //
  97. int64 code = 1 [(gogoproto.jsontag) = "code"];
  98. //
  99. string msg = 2 [(gogoproto.jsontag) = "msg"];
  100. //
  101. string message = 3 [(gogoproto.jsontag) = "message"];
  102. // type -> content
  103. map<int64, Data> data = 4 [(gogoproto.jsontag) = "data"];
  104. message Data {
  105. //
  106. string id = 1 [(gogoproto.jsontag) = "id"];
  107. //
  108. string uid = 2 [(gogoproto.jsontag) = "uid"];
  109. // 头衔id
  110. string tid = 3 [(gogoproto.jsontag) = "tid"];
  111. // 数量
  112. string num = 4 [(gogoproto.jsontag) = "num"];
  113. //
  114. string score = 5 [(gogoproto.jsontag) = "score"];
  115. //
  116. string create_time = 6 [(gogoproto.jsontag) = "create_time"];
  117. //
  118. string expire_time = 7 [(gogoproto.jsontag) = "expire_time"];
  119. //
  120. string status = 8 [(gogoproto.jsontag) = "status"];
  121. }
  122. }