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

/**
 * 列表查询
 * @returns
 */
export function getGroupCatByList() {
  return apiRequest({
    url: '/group/cat',
    method: 'GET',
  })
}

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

/**
 * 基于ID查询
 * @returns
 * @param groupCatId
 */
export function getGroupCatById(groupCatId: number) {
  return apiRequest({
    url: `/group/cat/${groupCatId}`,
    method: 'GET',
  })
}

/**
 * 添加
 * @param data
 * @returns
 */
export function createGroupCat(data: any) {
  return apiRequest({
    url: '/group/cat/add',
    method: 'POST',
    data,
  })
}

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

/**
 * 删除
 * @returns
 * @param groupCatId
 */
export function deleteGroupCatById(groupCatId: number) {
  return apiRequest({
    url: `/group/cat/${groupCatId}`,
    method: 'DELETE',
  })
}
