import request from '@/utils/request'

// 查询危险源列表
export function listHazard(query) {
  return request({
    url: '/system/hazard/list',
    method: 'get',
    params: query
  })
}

// 查询危险源详细
export function getHazard(id) {
  return request({
    url: '/system/hazard/' + id,
    method: 'get'
  })
}

// 新增危险源
export function addHazard(data) {
  return request({
    url: '/system/hazard',
    method: 'post',
    data: data
  })
}

// 修改危险源
export function updateHazard(data) {
  return request({
    url: '/system/hazard',
    method: 'put',
    data: data
  })
}

// 删除危险源
export function delHazard(id) {
  return request({
    url: '/system/hazard/' + id,
    method: 'delete'
  })
}
