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

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

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

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

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

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

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