import http from '@/utils/http'

let baseUrl = '/category'

//新增分类
export function addCategory(addForm) {
  return http.post(baseUrl + '/add', addForm)
}

//查询分类树
export function getCateTree() {
  return http.get(baseUrl + '/tree')
}

//编辑分类
export function editCategory(editForm, categoryId) {
  return http.put(baseUrl + "/edit/" + categoryId, editForm)
}

//删除分类
export function deleteCategory(categoryId) {
  return http.delete(baseUrl + '/' + categoryId)
}

//分类树快照
export function treeSnapshot(taskId) {
  return http.get(baseUrl + '/tree-snapshot/' + taskId)
}
