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

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

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

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

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

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