import request from '@/utils/request'

// 创建资料分类
export function createMaterialCategory(data) {
  return request({
    url: '/server/material-category/create',
    method: 'post',
    data: data
  })
}

// 更新资料分类
export function updateMaterialCategory(data) {
  return request({
    url: '/server/material-category/update',
    method: 'post',
    data: data
  })
}

// 删除资料分类
export function deleteMaterialCategory(id) {
  return request({
    url: '/server/material-category/delete?id=' + id,
    method: 'post'
  })
}

// 获得资料分类
export function getMaterialCategory(id) {
  return request({
    url: '/server/material-category/get?id=' + id,
    method: 'get'
  })
}

// 获得资料分类列表
export function getMaterialCategoryList(params) {
  return request({
    url: '/server/material-category/list',
    method: 'get',
    params
  })
}
// 导出资料分类 Excel
export function exportMaterialCategoryExcel(params) {
  return request({
    url: '/server/material-category/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
