import request from '@/core/utils/request'

// 创建
export function create (data) {
  return request.post('/cms/category/create', data)
}

// 根据ID删除
export function deleteById (id) {
  return request.get(`/cms/category/delete/${id}`)
}

// 批量删除
export function deleteByIdInBatch (ids) {
  return request.get('/cms/category/delete/batch', {
    params: {
      ids
    }
  })
}

// 根据ID修改
export function updateById (data) {
  return request.post('/cms/category/updateById', data)
}

// 修改状态
export function updateStatus (data) {
  return request.post('/cms/category/updateStatus', data)
}

// 查询所有
export function fetchAll (data) {
  return request.get('/cms/category/tree', data)
}
