import request from '@/utils/request'

// 查询预警规则列表
export function listRule(query) {
  return request({
    url: '/warn/rule/list',
    method: 'get',
    params: query
  })
}

// 查询预警规则详细
export function getRule(id) {
  return request({
    url: '/warn/rule/' + id,
    method: 'get'
  })
}

// 新增预警规则
export function addRule(data) {
  return request({
    url: '/warn/rule',
    method: 'post',
    data: data
  })
}

// 修改预警规则
export function updateRule(data) {
  return request({
    url: '/warn/rule',
    method: 'put',
    data: data
  })
}

// 删除预警规则
export function delRule(id) {
  return request({
    url: '/warn/rule/' + id,
    method: 'delete'
  })
}
