titans.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. syntax = "proto3";
  2. package live.resource.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. service titans {
  6. //获取team下某个keyword的配置 `internal:"true"`
  7. rpc get_config_by_keyword(GetConfigReq) returns (GetConfigResp);
  8. //设置team下某个keyword配置 `internal:"true"`
  9. rpc set_config_by_keyword(SetConfigReq) returns (SetConfigResp);
  10. //管理后台根据条件获取配置 `internal:"true"`
  11. rpc get_configs_by_params(ParamsConfigReq) returns (ParamsConfigResp);
  12. //获取discover_id对应的全部配置 `internal:"true"`
  13. rpc getByTreeId(TreeIdReq) returns (TreeIdResp);
  14. //获取多个team或索引的的全部配置 `internal:"true"`
  15. rpc get_configs_by_likes(LikesConfigReq) returns (LikesConfigResp);
  16. }
  17. message GetConfigReq {
  18. //team
  19. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  20. //索引名称
  21. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword"'];
  22. //id
  23. int64 id = 3 [(gogoproto.moretags) = 'form:"id"'];
  24. }
  25. message GetConfigResp {
  26. //team
  27. int64 team = 1 [(gogoproto.jsontag) = "team"];
  28. //索引名称
  29. string keyword = 2 [(gogoproto.jsontag) = "keyword"];
  30. //配置值
  31. string value = 3 [(gogoproto.jsontag) = "value"];
  32. //配置解释
  33. string name = 4 [(gogoproto.jsontag) = "name"];
  34. //创建时间
  35. string ctime = 5 [(gogoproto.jsontag) = "ctime"];
  36. //最近更新时间
  37. string mtime = 6 [(gogoproto.jsontag) = "mtime"];
  38. //状态
  39. int64 status = 7 [(gogoproto.jsontag) = "status"];
  40. //状态
  41. int64 id = 8 [(gogoproto.jsontag) = "id"];
  42. }
  43. message SetConfigReq {
  44. //team
  45. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  46. //索引名称
  47. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword" validate:"required"'];
  48. //配置值
  49. string value = 3 [(gogoproto.moretags) = 'form:"value" validate:"required"'];
  50. //配置解释
  51. string name = 4 [(gogoproto.moretags) = 'form:"name"'];
  52. //编辑时id
  53. int64 id = 5 [(gogoproto.moretags) = 'form:"id"'];
  54. //记录状态 新增时默认为0
  55. int64 status = 6 [(gogoproto.moretags) = 'form:"status"'];
  56. }
  57. message SetConfigResp {
  58. int64 id = 1 [(gogoproto.jsontag) = "id"];
  59. }
  60. message ParamsConfigReq{
  61. int64 team = 1 [(gogoproto.moretags) = 'form:"team"'];
  62. string keyword = 2 [(gogoproto.moretags) = 'form:"keyword"'];
  63. string name = 3 [(gogoproto.moretags) = 'form:"name"'];
  64. int64 status = 4 [(gogoproto.moretags) = 'form:"status"'];
  65. int64 page = 5 [(gogoproto.moretags) = 'form:"page" validate:"required"'];
  66. //页量
  67. int64 page_size = 6 [(gogoproto.moretags) = 'form:"page_size" validate:"required"'];
  68. //id
  69. int64 id = 7 [(gogoproto.moretags) = 'form:"id"'];
  70. }
  71. message ParamsConfigResp{
  72. //数据列表
  73. repeated List list = 1 [(gogoproto.jsontag) = "list"];
  74. //记录总数
  75. int64 total_num = 2 [(gogoproto.jsontag) = "total_num"];
  76. }
  77. message List {
  78. //Id
  79. int64 id = 1 [(gogoproto.jsontag) = "id"];
  80. //team
  81. int64 team = 2 [(gogoproto.jsontag) = "team"];
  82. //索引名称
  83. string keyword = 3 [(gogoproto.jsontag) = "keyword"];
  84. //配置值
  85. string value = 4 [(gogoproto.jsontag) = "value"];
  86. //配置解释
  87. string name = 5 [(gogoproto.jsontag) = "name"];
  88. //创建时间
  89. string ctime = 6 [(gogoproto.jsontag) = "ctime"];
  90. //最近更新时间
  91. string mtime = 7 [(gogoproto.jsontag) = "mtime"];
  92. //状态
  93. int64 status = 8 [(gogoproto.jsontag) = "status"];
  94. }
  95. message LikesConfigReq{
  96. repeated string params = 1 [(gogoproto.moretags) = 'form:"params" validate:"required"'];
  97. }
  98. message LikesConfigResp{
  99. map<int64, Child> list = 1 [(gogoproto.jsontag) = "list"];
  100. }
  101. message Child {
  102. map<string, string> keys = 1 [(gogoproto.jsontag) = "keys"];
  103. }
  104. message TreeIdReq{
  105. int64 tree_id = 1 [(gogoproto.moretags) = 'form:"tree_id" validate:"required"'];
  106. }
  107. message TreeIdResp{
  108. map<string, string> list = 1 [(gogoproto.jsontag) = "list"];
  109. }