import apiRequest from '@/network/http/apiRequest'

/**
 * 获取Task Category分页
 * @param data
 * @returns
 */
export function getTaskCatByPage(data: any) {
  return apiRequest({
    url: '/task/cat/page',
    method: 'GET',
    params: data,
  })
}

/**
 * 获取Task Category列表
 * @param data
 * @returns
 */
export function getTaskCatByList(data: any) {
  return apiRequest({
    url: '/task/cat',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取Task Category
 * @returns
 * @param id
 */
export function getTaskCatById(id: number) {
  return apiRequest({
    url: `/task/cat/${id}`,
    method: 'GET',
  })
}

/**
 * 添加Task Category
 * @param data
 * @returns
 */
export function createTaskCat(data: any) {
  return apiRequest({
    url: '/task/cat/add',
    method: 'post',
    data,
  })
}

/**
 * 更新Task Category
 * @param data
 * @returns
 */
export function updateTaskCat(data: any) {
  return apiRequest({
    url: '/task/cat/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除Task Category
 * @returns
 * @param id
 */
export function deleteTaskCatById(id: number) {
  return apiRequest({
    url: `/task/cat/${id}`,
    method: 'DELETE',
  })
}
