api.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. syntax = "proto3";
  2. package live.daoanchor.v0;
  3. option go_package = "v0";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. message CreateCacheListReq {
  6. repeated int64 room_ids = 1;
  7. string content = 2;
  8. }
  9. message CreateCacheListResp {
  10. }
  11. message CreateLiveCacheListReq {
  12. repeated int64 room_ids = 1;
  13. string content = 2;
  14. }
  15. message CreateLiveCacheListResp {
  16. }
  17. message GetContentMapReq {
  18. }
  19. message GetContentMapResp {
  20. map<string,int64> list = 1;
  21. }
  22. message CreateDBDataReq {
  23. repeated int64 room_ids = 1;
  24. string content = 2;
  25. }
  26. message CreateDBDataResp {
  27. }
  28. service CreateData {
  29. // CreateCacheList 生成历史数据缓存列表
  30. rpc CreateCacheList(CreateCacheListReq) returns (CreateCacheListResp);
  31. // CreateLiveCacheList 生成开播历史数据缓存列表
  32. rpc CreateLiveCacheList(CreateLiveCacheListReq) returns (CreateLiveCacheListResp);
  33. // GetContentMap 获取需要生成历史数据的对象列表
  34. rpc GetContentMap(GetContentMapReq) returns (GetContentMapResp);
  35. rpc CreateDBData(CreateDBDataReq) returns (CreateDBDataResp);
  36. }
  37. message GetAnchorGradeListReq {
  38. }
  39. message GetAnchorGradeListResp {
  40. repeated List list = 1 [(gogoproto.jsontag) = 'list'];
  41. message List {
  42. //主播评级id 1=>S;2=>A;3=>B...
  43. int64 grade_id = 1 [(gogoproto.jsontag) = 'grade_id'];
  44. //主播评级名称 S;A;B...
  45. string grade_name = 2 [(gogoproto.jsontag) = 'grade_name'];
  46. //人数基数
  47. int64 base_online =3 [(gogoproto.jsontag) = 'online_base'];
  48. //人气倍数
  49. int64 popularity_rate =4 [(gogoproto.jsontag) = 'popularity_rate'];
  50. }
  51. }
  52. message EditAnchorGradeReq {
  53. int64 grade_id =1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  54. int64 online_base = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  55. int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  56. }
  57. message EditAnchorGradeResp {
  58. }
  59. message AddAnchorGradeReq {
  60. int64 id =1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  61. int64 online_base = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  62. int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  63. }
  64. message AddAnchorGradeResp {
  65. }
  66. message GetContentListReq {
  67. int64 page = 1;
  68. int64 page_size = 2;
  69. }
  70. message GetContentListResp {
  71. int64 page = 1;
  72. int64 page_size = 2;
  73. int64 total_count = 3;
  74. repeated List list = 4 [(gogoproto.jsontag) = 'list'];
  75. message List {
  76. //父分区id
  77. int64 parent_area_id = 1 [(gogoproto.jsontag) = 'parent_area_id'];
  78. //父分区名称
  79. string parent_area_name =2 [(gogoproto.jsontag) = 'parent_area_name'];
  80. //二级分区信息<id,name>
  81. map<int64,string> area_list = 3 [(gogoproto.jsontag) = 'area_list'];
  82. //人气倍率系数
  83. int64 popularity_rate =4 [(gogoproto.jsontag) = 'popularity_rate'];
  84. }
  85. }
  86. message EditContentReq {
  87. int64 id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  88. int64 popularity_rate = 2;
  89. repeated int64 list =3;
  90. int64 parent_id = 4;
  91. int64 is_all =5;
  92. }
  93. message EditContentResp {
  94. }
  95. message AddContentReq {
  96. int64 parent_id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  97. repeated int64 list = 2 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  98. int64 popularity_rate = 3 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  99. int64 is_all =4 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  100. }
  101. message AddContentResp {
  102. }
  103. message DeleteContentReq {
  104. int64 id = 1 [(gogoproto.moretags) = "validate:\"dive,gt=0,required\""];
  105. }
  106. message DeleteContentResp {
  107. }
  108. //人气相关接口
  109. service Popularity {
  110. // GetAnchorGradeList 获取人气值主播评级列表
  111. rpc GetAnchorGradeList(GetAnchorGradeListReq) returns (GetAnchorGradeListResp);
  112. // EditAnchorGrade 编辑主播评级对应的人气值数据
  113. rpc EditAnchorGrade(EditAnchorGradeReq) returns (EditAnchorGradeResp);
  114. // GetContentList 人气内容系数列表
  115. rpc GetContentList(GetContentListReq) returns (GetContentListResp);
  116. // AddContent 添加内容系数
  117. rpc AddContent(AddContentReq) returns (AddContentResp);
  118. // EditContent 编辑内容系数
  119. rpc EditContent(EditContentReq) returns (EditContentResp);
  120. // DeleteContent 删除内容系数
  121. rpc DeleteContent(DeleteContentReq) returns (DeleteContentResp);
  122. }