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

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

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

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

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

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

/**
 * 删除Ent Type
 * @returns
 * @param id
 */
export function deleteEntCatById(id: number) {
  return apiRequest({
    url: `/ent/cat/${id}`,
    method: 'DELETE',
  })
}
