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

/**
 * 查询
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function getX(objectCode: string, oamCode: string, data: any) {
  return apiRequest({
    url: `/x/${objectCode}/${oamCode}`,
    method: 'GET',
    params: data,
  })
}

/**
 * 查询
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function generateParams(objectCode: string, oamCode: string) {
  return apiRequest({
    url: `/x/GenerateParams/${objectCode}/${oamCode}`,
    method: 'GET',
  })
}


/**
 * 添加
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function createX(objectCode: string, oamCode: string, data: any) {
  return apiRequest({
    url: `/x/${objectCode}/${oamCode}`,
    method: 'POST',
    data,
  })
}

/**
 * 更新
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function updateX(objectCode: string, oamCode: string, data: any) {
  return apiRequest({
    url: `/x/${objectCode}/${oamCode}`,
    method: 'PUT',
    data,
  })
}

/**
 * 更新
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function patchX(objectCode: string, oamCode: string, data: any) {
  return apiRequest({
    url: `/x/${objectCode}/${oamCode}`,
    method: 'PUT',
    data,
  })
}

/**
 * 删除
 * @param objectCode
 * @param oamCode
 * @returns
 */
export function deleteX(objectCode: string, oamCode: string, data: any) {
  return apiRequest({
    url: `/x/${objectCode}/${oamCode}`,
    method: 'DELETE',
    data,
  })
}
