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

/**
 * 分页查询Partner Category
 * @param data
 * @returns
 */
export function getPartnerCatByPage(data: any) {
  return apiRequest({
    url: '/partner/cat/page',
    method: 'GET',
    params: data,
  })
}

/**
 * 列表查询Partner Category
 * @param data
 * @returns
 */
export function getPartnerCatByList(data: any) {
  return apiRequest({
    url: '/partner/cat',
    method: 'GET',
    params: data,
  })
}

/**
 * 基于ID查询Partner Category
 * @returns
 * @param id
 */
export function getPartnerCatById(id: number) {
  return apiRequest({
    url: `/partner/cat/${id}`,
    method: 'GET',
  })
}

/**
 * 新增Partner Category
 * @param data
 * @returns
 */
export function createPartnerCat(data: any) {
  return apiRequest({
    url: '/partner/cat/add',
    method: 'POST',
    data,
  })
}

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

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