import request from '@/utils/request'

export function getRuleList() {
  return request({
    url: '/rule/engine/getRuleEngineList',
    method: 'get'
  })
}

export function insertRuleEngine(ruleEngine) {
  return request({
    url: '/rule/engine/insertOrUpdateRuleEngine',
    method: 'post',
    data: ruleEngine
  })
}

export function getRuleConfigList() {
  return request({
    url: '/data/ruleConfig/getRuleConfigList',
    method: 'get'
  })
}

export function testCompile(testWord) {
  return request({
    url: '/data/test/testCompile',
    method: 'post',
    data: testWord
  })
}

export function getRuleJavaCode(ruleEngineId) {
  return request({
    url: '/data/rule/getRuleJavaCode?ruleEngineId=' + ruleEngineId,
    method: 'get'
  })
}
