import request from '@/utils/request'

// 查询洪水案例库列表
export function listCase(query) {
  return request({
    url: '/flood/case/list',
    method: 'get',
    params: query
  })
}

// 查询洪水案例库详细
export function getCase(caseId) {
  return request({
    url: '/flood/case/' + caseId,
    method: 'get'
  })
}

// 新增洪水案例库
export function addCase(data) {
  return request({
    url: '/flood/case',
    method: 'post',
    data: data
  })
}

// 修改洪水案例库
export function updateCase(data) {
  return request({
    url: '/flood/case',
    method: 'put',
    data: data
  })
}

// 删除洪水案例库
export function delCase(caseId) {
  return request({
    url: '/flood/case/' + caseId,
    method: 'delete'
  })
}

// 导入洪水案例数据
export function importCase(data) {
  return request({
    url: '/flood/case/importData',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 导出洪水案例库
export function exportCase(query) {
  return request({
    url: '/flood/case/export',
    method: 'post',
    params: query
  })
}
