titans.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. // 获取配置 请求参数逗号隔开的字符串 返回`internal:"true"`
  7. rpc getMultiConfigs(MultiConfigReq) returns (MultiConfigResp);
  8. // 获取服务级配置 `internal:"true"`
  9. rpc getServiceConfig(ServiceConfigReq) returns (ServiceConfigResp);
  10. //插入服务配置 `method:"POST" internal:"true"`
  11. rpc setServiceConfig(SetReq) returns (SetResp);
  12. // 获取服务级配置 `internal:"true"`
  13. rpc getServiceConfigList(ServiceListReq) returns (ServiceListResp);
  14. // 获取已配置的discoveryId `internal:"true"`
  15. rpc getTreeIds(TreeIdsReq) returns (TreeIdsResp);
  16. // 获取用户的应用树 `internal:"true"`
  17. //rpc getMyTreeApps(TreeAppsReq) returns (TreeAppsResp);
  18. // 获取运营数据列表 `internal:"true"`
  19. rpc getEasyList(EasyGetReq) returns (EasyGetResp);
  20. // 设置运营列表 `method:"POST" internal:"true"`
  21. rpc setEasyList(EasySetReq) returns (EasySetResp);
  22. }
  23. message EasyGetReq{
  24. int64 id = 1 [(gogoproto.moretags) = 'form:"id"'];
  25. int64 page = 2 [(gogoproto.moretags) = 'form:"page"'];
  26. }
  27. message EasyGetResp{
  28. repeated EasyList list = 1 [(gogoproto.jsontag) = "list"];
  29. }
  30. message EasyList{
  31. string tree_name = 1 [(gogoproto.jsontag) = "tree_name"];
  32. string tree_path = 2 [(gogoproto.jsontag) = "tree_path"];
  33. int64 tree_id = 3 [(gogoproto.jsontag) = "tree_id"];
  34. string keyword = 4 [(gogoproto.jsontag) = "keyword"];
  35. string name = 5 [(gogoproto.jsontag) = "name"];
  36. }
  37. message EasySetReq{
  38. int64 id = 1 [(gogoproto.moretags) = 'form:"id"'];
  39. }
  40. message EasySetResp{
  41. int64 eId = 1 [(gogoproto.jsontag) = "eId"];
  42. }
  43. message TreeAppsReq{
  44. string node = 1 [(gogoproto.moretags) = 'form:"node"'];
  45. string team = 2 [(gogoproto.moretags) = 'form:"team"'];
  46. }
  47. message TreeAppsResp{
  48. repeated Node list = 1 [(gogoproto.jsontag) = "list"];
  49. }
  50. message Node{
  51. string name = 1 [(gogoproto.jsontag) = "name"];
  52. string path = 2 [(gogoproto.jsontag) = "path"];
  53. int64 tree_id = 3 [(gogoproto.jsontag) = "tree_id"];
  54. }
  55. message MultiConfigReq{
  56. string values = 1 [(gogoproto.moretags) = 'form:"values"'];
  57. }
  58. message MultiConfigResp{
  59. map<int64, mChild> list = 1 [(gogoproto.jsontag) = "list"];
  60. }
  61. message mChild {
  62. map<string, string> keys = 1 [(gogoproto.jsontag) = "keys"];
  63. }
  64. message ServiceConfigReq {
  65. int64 tree_id = 1 [(gogoproto.moretags) = 'form:"tree_id"'];
  66. }
  67. message ServiceConfigResp{
  68. map<string, string> list = 1 [(gogoproto.jsontag) = "list"];
  69. }
  70. message SetReq {
  71. string tree_name = 1 [(gogoproto.moretags) = 'form:"tree_name" required'];
  72. string tree_path = 2 [(gogoproto.moretags) = 'form:"tree_path"'];
  73. int64 tree_id = 3 [(gogoproto.moretags) = 'form:"tree_id" required'];
  74. string service = 4 [(gogoproto.moretags) = 'form:"service"'];
  75. string keyword = 5 [(gogoproto.moretags) = 'form:"keyword"'];
  76. int64 template = 6 [(gogoproto.moretags) = 'form:"template"'];
  77. string name = 7 [(gogoproto.moretags) = 'form:"name"'];
  78. string value = 8 [(gogoproto.moretags) = 'form:"value"'];
  79. int64 status = 9 [(gogoproto.moretags) = 'form:"status"'];
  80. int64 id = 10 [(gogoproto.moretags) = 'form:"id"'];
  81. }
  82. message SetResp {
  83. int64 id = 1 [(gogoproto.jsontag) = "id"];
  84. }
  85. message ServiceListReq{
  86. string tree_name = 1 [(gogoproto.moretags) = 'form:"tree_name" required'];
  87. int64 tree_id = 2 [(gogoproto.moretags) = 'form:"tree_id"'];
  88. string service = 3 [(gogoproto.moretags) = 'form:"service"'];
  89. string keyword = 4 [(gogoproto.moretags) = 'form:"keyword"'];
  90. int64 page = 5 [(gogoproto.moretags) = 'form:"page"'];
  91. int64 page_size = 6 [(gogoproto.moretags) = 'form:"page_size"'];
  92. string name = 7 [(gogoproto.moretags) = 'form:"name"'];
  93. int64 status = 8 [(gogoproto.moretags) = 'form:"status"'];
  94. }
  95. message ServiceListResp{
  96. repeated mList list = 1 [(gogoproto.jsontag) = "list"];
  97. int64 total_num = 2 [(gogoproto.jsontag) = "total_num"];
  98. }
  99. message mList {
  100. //Id
  101. int64 id = 1 [(gogoproto.jsontag) = "id"];
  102. //tree_name
  103. string tree_name = 2 [(gogoproto.jsontag) = "tree_name"];
  104. string tree_path = 3 [(gogoproto.jsontag) = "tree_path"];
  105. int64 tree_id = 4 [(gogoproto.jsontag) = "tree_id"];
  106. string service = 5 [(gogoproto.jsontag) = "service"];
  107. //索引名称
  108. int64 template = 6 [(gogoproto.jsontag) = "template"];
  109. string keyword = 7 [(gogoproto.jsontag) = "keyword"];
  110. //配置值
  111. string value = 8 [(gogoproto.jsontag) = "value"];
  112. //配置解释
  113. string name = 9 [(gogoproto.jsontag) = "name"];
  114. //创建时间
  115. string ctime = 10 [(gogoproto.jsontag) = "ctime"];
  116. //最近更新时间
  117. string mtime = 11 [(gogoproto.jsontag) = "mtime"];
  118. //状态
  119. int64 status = 12 [(gogoproto.jsontag) = "status"];
  120. }
  121. message TreeIdsReq {
  122. string tree_name = 1 [(gogoproto.moretags) = 'form:"tree_name" required'];
  123. }
  124. message TreeIdsResp{
  125. repeated int64 list = 1 [(gogoproto.jsontag) = "list"];
  126. }