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

/**
 * 获取Client分页
 * @param data
 * @returns
 */
export function getClientByPage(data: any) {
  return apiRequest({
    url: '/client/page',
    method: 'GET',
    params: data,
  })
}

/**
 * 获取Client列表
 * @param data
 * @returns
 */
export function getClientByList(data: any) {
  return apiRequest({
    url: '/client',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取Client
 * @returns
 * @param clientId
 */
export function getClientById(clientId: number) {
  return apiRequest({
    url: `/client/${clientId}`,
    method: 'GET',
  })
}

/**
 * 添加Client
 * @param data
 * @returns
 */
export function createClient(data: any) {
  return apiRequest({
    url: '/client/add',
    method: 'post',
    data,
  })
}

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

/**
 * 更新Client状态
 * @returns
 * @param clientId
 * @param status
 */
export function updateClientStatus(clientId: number, status: number) {
  return apiRequest({
    url: `/client/updateStatus/${clientId}/${status}`,
    method: 'PUT',
  })
}

/**
 * 删除Client
 * @returns
 * @param clientId
 */
export function deleteClientById(clientId: number) {
  return apiRequest({
    url: `/client/${clientId}`,
    method: 'DELETE',
  })
}
