service.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
  2. import { thanos } from '@/conf/config'
  3. // 新增策略
  4. export async function create (params) {
  5. const url = `${thanos}/thanos-admin/api/v1/dsl/create`
  6. return fetchApi(url, params)
  7. }
  8. // 测试策略
  9. export async function test (params) {
  10. const url = `${thanos}/thanos-admin//api/v1/dsl/test`
  11. return fetchApi(url, params)
  12. }
  13. // 获取策略详情
  14. export async function detail (params) {
  15. const url = `${thanos}/thanos-admin/api/v1/dsl/query`
  16. return fetchApiGet(url, params)
  17. }
  18. // 更新
  19. export async function update (params) {
  20. const url = `${thanos}/thanos-admin/api/v1/dsl/update`
  21. return fetchApi(url, params)
  22. }
  23. export async function delItem (params) {
  24. const url = `${thanos}/thanos-admin/api/v1/dsl/delete`
  25. return fetchApi(url, params)
  26. }
  27. // 查询所有分组
  28. export async function groupList (params) {
  29. const url = `${thanos}/thanos-admin/api/v1/group/list?_from=strategies`
  30. return fetchApi(url, params)
  31. }
  32. // 查询分组详情
  33. export async function groupDetail (params) {
  34. const url = `${thanos}/thanos-admin/api/v1/group/query?_from=strategies`
  35. return fetchApi(url, params)
  36. }