import request from '@/utils/request'

// 查询预警策略列表
export function listStrategy(query) {
  return request({
    url: '/cloud-warn/strategy/list',
    method: 'get',
    params: query
  })
}

// 查询预警策略详细
export function getStrategy(id) {
  return request({
    url: '/cloud-warn/strategy/' + id,
    method: 'get'
  })
}

// 新增预警策略
export function addStrategy(data) {
  return request({
    url: '/cloud-warn/strategy',
    method: 'post',
    data: data
  })
}

// 修改预警策略
export function updateStrategy(data) {
  return request({
    url: '/cloud-warn/strategy',
    method: 'put',
    data: data
  })
}

// 删除预警策略
export function delStrategy(id) {
  return request({
    url: '/cloud-warn/strategy/' + id,
    method: 'delete'
  })
}

// 查询车辆类型
export function findByCarType() {
  return request({
    url: '/cloud-warn/strategy/findByCarType',
    method: 'post',
  })
}
