gaea.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. syntax = "proto3";
  2. package live.liveadmin.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. service gaea {
  6. //获取team下某个keyword的配置 `internal:"true"`
  7. rpc get_config_by_keyword(GetConfigReq) returns (GetConfigResp);
  8. //`method:"POST" internal:"true"` 设置team下某个keyword配置
  9. rpc set_config_by_keyword(SetConfigReq) returns (SetConfigResp);
  10. //管理后台根据条件获取配置 `internal:"true"`
  11. rpc get_configs_by_params(ParamsConfigReq) returns (ParamsConfigResp);
  12. //获取单个team的全部配置 `internal:"true"`
  13. rpc get_configs_by_team(TeamConfigReq) returns (TeamConfigResp);
  14. //通过keyword获取配置 `internal:"true"`
  15. rpc get_configs_by_keyword(GetConfigsReq) returns (GetConfigsResp);
  16. //获取多个team下的全部配置 `internal:"true"`
  17. rpc get_configs_by_teams(TeamsConfigReq) returns (TeamsConfigResp);
  18. }
  19. // 通过参数获取一条记录的信息
  20. message GetConfigReq {
  21. //team
  22. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  23. //索引名称
  24. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword"'];
  25. //id
  26. int64 id = 3 [(gogoproto.moretags) = 'form:"id"'];
  27. }
  28. message GetConfigResp {
  29. //team
  30. int64 team = 1 [(gogoproto.jsontag) = "team"];
  31. //索引名称
  32. string keyword = 2 [(gogoproto.jsontag) = "keyword"];
  33. //配置值
  34. string value = 3 [(gogoproto.jsontag) = "value"];
  35. //配置解释
  36. string name = 4 [(gogoproto.jsontag) = "name"];
  37. //创建时间
  38. string ctime = 5 [(gogoproto.jsontag) = "ctime"];
  39. //最近更新时间
  40. string mtime = 6 [(gogoproto.jsontag) = "mtime"];
  41. //状态
  42. int64 status = 7 [(gogoproto.jsontag) = "status"];
  43. //id
  44. int64 id = 8 [(gogoproto.jsontag) = "id"];
  45. }
  46. // 设置某个key的信息
  47. message SetConfigReq {
  48. //team
  49. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  50. //索引名称
  51. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword" validate:"required"'];
  52. //配置值
  53. string value = 3 [(gogoproto.moretags) = 'form:"value" validate:"required"'];
  54. //配置解释
  55. string name = 4 [(gogoproto.moretags) = 'form:"name"'];
  56. //编辑时id
  57. int64 id = 5 [(gogoproto.moretags) = 'form:"id"'];
  58. //状态
  59. int64 status = 6 [(gogoproto.moretags) = 'form:"status"'];
  60. }
  61. message SetConfigResp {
  62. int64 id = 1 [(gogoproto.jsontag) = "id"];
  63. }
  64. // 管理后台通过参数获取列表
  65. message ParamsConfigReq{
  66. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  67. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword"'];
  68. string name = 3 [(gogoproto.moretags) = 'form:"name"'];
  69. int64 status = 4 [(gogoproto.moretags) = 'form:"status"'];
  70. int64 page = 5 [(gogoproto.moretags) = 'form:"page" validate:"required"'];
  71. //页量
  72. int64 page_size = 6 [(gogoproto.moretags) = 'form:"page_size" validate:"required"'];
  73. //id
  74. int64 id = 7 [(gogoproto.moretags) = 'form:"id"'];
  75. }
  76. message ParamsConfigResp{
  77. repeated List list =1 [(gogoproto.jsontag) = "list"];
  78. //记录总数
  79. int64 total_num = 2 [(gogoproto.jsontag) = "total_num"];
  80. }
  81. message TeamConfigReq{
  82. //team
  83. string team = 1 [(gogoproto.moretags) = 'form:"team" validate:"required"'];
  84. //页码 从1开始
  85. int64 page = 2 [(gogoproto.moretags) = 'form:"page" validate:"required"'];
  86. //页量
  87. int64 page_size = 3 [(gogoproto.moretags) = 'form:"page_size" validate:"required"'];
  88. }
  89. message TeamConfigResp{
  90. //数据列表
  91. repeated List list = 1 [(gogoproto.jsontag) = "list"];
  92. //记录总数
  93. int64 total_num = 2 [(gogoproto.jsontag) = "total_num"];
  94. }
  95. message GetConfigsReq{
  96. //索引名称
  97. string keyword = 1 [(gogoproto.moretags) = 'form:"keyword" validate:"required"'];
  98. //页码
  99. int64 page = 2 [(gogoproto.moretags) = 'form:"page" validate:"required"'];
  100. //页量
  101. int64 page_size = 3 [(gogoproto.moretags) = 'form:"page_size" validate:"required"'];
  102. }
  103. message GetConfigsResp{
  104. //数据列表
  105. repeated List list = 1 [(gogoproto.jsontag) = "list"];
  106. //记录总数
  107. int64 total_num = 2 [(gogoproto.jsontag) = "total_num"];
  108. }
  109. message List {
  110. //Id
  111. int64 id = 1 [(gogoproto.jsontag) = "id"];
  112. //team
  113. int64 team = 2 [(gogoproto.jsontag) = "team"];
  114. //索引名称
  115. string keyword = 3 [(gogoproto.jsontag) = "keyword"];
  116. //配置值
  117. string value = 4 [(gogoproto.jsontag) = "value"];
  118. //配置解释
  119. string name = 5 [(gogoproto.jsontag) = "name"];
  120. //创建时间
  121. string ctime = 6 [(gogoproto.jsontag) = "ctime"];
  122. //最近更新时间
  123. string mtime = 7 [(gogoproto.jsontag) = "mtime"];
  124. //状态
  125. int64 status = 8 [(gogoproto.jsontag) = "status"];
  126. }
  127. message TeamsConfigReq{
  128. //team
  129. repeated int64 team = 1 [(gogoproto.moretags) = 'form:"team" validate:"required"'];
  130. }
  131. message TeamsConfigResp{
  132. string list = 1 [(gogoproto.jsontag) = "list"];
  133. }