import request from '@/utils/request'

// 查询预警信息列表
export function listWarning(query) {
  return request({
    url: '/management/warning/list',
    method: 'get',
    params: query
  })
}

// 查询预警信息详细
export function getWarning(earlyWarningId) {
  return request({
    url: '/management/warning/' + earlyWarningId,
    method: 'get'
  })
}

// 新增预警信息
export function addWarning(data) {
  return request({
    url: '/management/warning',
    method: 'post',
    data: data
  })
}

// 修改预警信息
export function updateWarning(data) {
  return request({
    url: '/management/warning',
    method: 'put',
    data: data
  })
}

// 删除预警信息
export function delWarning(earlyWarningId) {
  return request({
    url: '/management/warning/' + earlyWarningId,
    method: 'delete'
  })
}

// 导出预警信息
export function exportWarning(query) {
  return request({
    url: '/management/warning/export',
    method: 'get',
    params: query
  })
}

// 导出预警信息
export function sendWarning(data) {
    return request({
      url: '/management/warning/send',
      method: 'post',
      data: data
    })
  }