import request from '@/utils/request'

// 查询规则引擎版本列表
export function listEdition(data) {
  return request({
    url: '/rule/edition/list',
    method: 'get',
    data
  })
}
// 获取相应的规则引擎版本
export function selectListRuleId(ruleId) {
  return request({
    url: '/rule/edition/selectListRuleId/' + ruleId,
    method: 'post'
  })
}

// 查询规则引擎版本详细
export function getEdition(id) {
  return request({
    url: '/rule/edition/' + id,
    method: 'get'
  })
}

// 新增规则引擎版本
export function addEdition(data) {
  return request({
    url: '/rule/edition',
    method: 'post',
    data: data
  })
}

// 修改规则引擎版本
export function updateEdition(data) {
  return request({
    url: '/rule/edition',
    method: 'put',
    data: data
  })
}

//  测试
export function updRuleSsTest(id, ruleIsTest) {
  return request({
    url: '/rule/edition/updRuleSsTest?id=' + id + "&ruleIsTest=" + ruleIsTest,
    method: 'post'
  })
}

//  激活
export function updRuleStatus(id, ruleStatus) {
  return request({
    url: '/rule/edition/updRuleStatus?id=' + id + "&ruleStatus=" + ruleStatus,
    method: 'post'
  })
}

// 发布版本
export function updEditionStatus(id) {
  return request({
    url: '/rule/edition/updEditionStatus?id=' + id,
    method: 'put'
  })
}

// 删除规则引擎版本
export function delEdition(id) {
  return request({
    url: '/rule/edition/' + id,
    method: 'delete'
  })
}
