import request from '@/utils/request'

// 创建档案分类
export function createFileCategory(data) {
  return request({
    url: '/setting/file-category/create',
    method: 'post',
    data: data
  })
}

// 更新档案分类
export function updateFileCategory(data) {
  return request({
    url: '/setting/file-category/update',
    method: 'put',
    data: data
  })
}

// 删除档案分类
export function deleteFileCategory(id) {
  return request({
    url: '/setting/file-category/delete?id=' + id,
    method: 'delete'
  })
}

// 获得档案分类
export function getFileCategory(id) {
  return request({
    url: '/setting/file-category/get?id=' + id,
    method: 'get'
  })
}

// 获得档案分类分页
export function getFileCategoryPage(query) {
  return request({
    url: '/setting/file-category/page',
    method: 'get',
    params: query
  })
}

// 导出档案分类 Excel
export function exportFileCategoryExcel(query) {
  return request({
    url: '/setting/file-category/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
