fix: (规则引擎版本初级)
parent
6b69b29567
commit
7006a8ba97
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.model;
|
||||
|
||||
/** 记录模型
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 17
|
||||
* @Author: zhangxu
|
||||
* @Created: 2024/5/6 20:31
|
||||
*/
|
||||
public class RecordModel {
|
||||
|
||||
private RecordModel(int dataModelLength){
|
||||
dataModelArr = new DataModel[dataModelLength];
|
||||
}
|
||||
|
||||
private RecordModel(DataModel[] dataModelArr){
|
||||
dataModelArr=dataModelArr;
|
||||
}
|
||||
|
||||
private DataModel[] dataModelArr=null;
|
||||
|
||||
public static RecordModel build(int dataModelLength){
|
||||
return new RecordModel(dataModelLength);
|
||||
}
|
||||
|
||||
public static RecordModel build(DataModel[] dataModelArr){
|
||||
return new RecordModel(dataModelArr);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -61,7 +61,7 @@ public class EngineMaintenanceController extends BaseController
|
|||
|
||||
/**
|
||||
* 测试方法
|
||||
* @param code
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/TestMethod")
|
||||
|
|
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 engine_maintenance
|
||||
*
|
||||
|
@ -58,6 +60,30 @@ public class EngineMaintenance extends BaseEntity {
|
|||
@Excel(name = "编辑代码文本")
|
||||
private String codeText;
|
||||
|
||||
/***
|
||||
* 引擎编码
|
||||
*
|
||||
*/
|
||||
private String engineCode;
|
||||
|
||||
|
||||
private List<EngineVersion> engineVersionList;
|
||||
|
||||
public String getEngineCode() {
|
||||
return engineCode;
|
||||
}
|
||||
|
||||
public void setEngineCode(String engineCode) {
|
||||
this.engineCode = engineCode;
|
||||
}
|
||||
|
||||
public List<EngineVersion> getEngineVersionList() {
|
||||
return engineVersionList;
|
||||
}
|
||||
|
||||
public void setEngineVersionList(List<EngineVersion> engineVersionList) {
|
||||
this.engineVersionList = engineVersionList;
|
||||
}
|
||||
|
||||
public String getCodeText() {
|
||||
return codeText;
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package com.muyu.rule.engine.mapper;
|
||||
|
||||
import com.muyu.rule.engine.domain.EngineVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** 引擎版本
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 17
|
||||
* @Author: zhangxu
|
||||
* @Created: 2024/5/6 20:03
|
||||
*/
|
||||
|
||||
public interface EngineVersionMapper {
|
||||
|
||||
/***
|
||||
* 查询详细信息
|
||||
*
|
||||
*/
|
||||
public EngineVersion selectEngineVersionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询类表
|
||||
* */
|
||||
public List<EngineVersion> selectEngineVersionList(EngineVersion engineVersion);
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* */
|
||||
public int insertEngineVersion(EngineVersion engineVersion);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* */
|
||||
public int updateEngineVersion(EngineVersion engineVersion);
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* */
|
||||
public int deleteEngineVersionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* */
|
||||
public int deleteEngineVersionByIds(Long[] ids);
|
||||
|
||||
|
||||
}
|
|
@ -116,6 +116,11 @@ public class EngineMaintenanceServiceImpl implements IEngineMaintenanceService
|
|||
return engineMaintenanceMapper.deleteEngineMaintenanceById(id);
|
||||
}
|
||||
|
||||
|
||||
//***
|
||||
//
|
||||
// 初始化
|
||||
// */
|
||||
@Override
|
||||
public Result initializeRuleEngine(EngineMaintenance engineMaintenance) {
|
||||
try {
|
||||
|
@ -168,6 +173,10 @@ public class EngineMaintenanceServiceImpl implements IEngineMaintenanceService
|
|||
return Result.error("初始化失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试
|
||||
* */
|
||||
@Override
|
||||
public Result testMethod(String code) {
|
||||
String className = "com.muyu.rule.engine.domain.Rule"+Character.toUpperCase(code.charAt(0)) + code.substring(1)+"Class";
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>untitled</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue