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

/**
 * 获取ObjectOAM列表
 * @param data
 * @returns
 */
export function getObjectOAMByList(data: any) {
  return apiRequest({
    url: '/model/object/oam',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取ObjectOAM
 * @param modelId
 * @param objectId
 * @param oamId
 * @returns
 */
export function getObjectOAMById(modelId: number, objectId: number, oamId: number) {
  return apiRequest({
    url: `/model/object/oam/${modelId}/${objectId}/${oamId}`,
    method: 'GET',
  })
}

/**
 * 根据Id获取ObjectOAM列表
 * @param modelId
 * @param objectId
 * @returns
 */
export function getObjectOAMListById(modelId: number, objectId: number) {
  return apiRequest({
    url: `/model/object/oam/${modelId}/${objectId}`,
    method: 'GET',
  })
}


/**
 * 添加ObjectOAM
 * @param data
 * @returns
 */
export function createObjectOAM(data: any) {
  return apiRequest({
    url: '/model/object/oam/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新ObjectOAM
 * @param data
 * @returns
 */
export function updateObjectOAM(data: any) {
  return apiRequest({
    url: '/model/object/oam/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除ObjectOAM
 * @param modelId
 * @param objectId
 * @param oamId
 * @returns
 */
export function deleteObjectOAMById(modelId: number, objectId: number, oamId: number) {
  return apiRequest({
    url: `/model/object/oam/${modelId}/${objectId}/${oamId}`,
    method: 'DELETE',
  })
}
