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

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

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

/**
 * 根据Id获取App Category
 * @param appCatId
 * @returns
 */
export function getAppCatById(appCatId: number) {
  return apiRequest({
    url: `/app/cat/${appCatId}`,
    method: 'GET',
  })
}

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

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

/**
 * 删除App Category
 * @param appCatId
 * @returns
 */
export function deleteAppCatById(appCatId: number) {
  return apiRequest({
    url: `/app/cat/${appCatId}`,
    method: 'DELETE',
  })
}
