修改容器内部路径
parent
5ed432358b
commit
1c0c586546
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu.basic;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.basic.handler.DataEngineHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 规则引擎基准
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
public interface BasicEngine<V> {
|
|
||||||
|
|
||||||
public void set(V dataValue);
|
|
||||||
|
|
||||||
public V get();
|
|
||||||
|
|
||||||
public default void remove() {
|
|
||||||
DataEngineHandler.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void execution();
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu.basic.abstracts;
|
|
||||||
|
|
||||||
import com.muyu.basic.BasicEngine;
|
|
||||||
import com.muyu.basic.handler.DataEngineRowHandler;
|
|
||||||
import com.muyu.core.domain.DataValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 数据值处理对象
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public abstract class DataEngineRowActuator implements BasicEngine<DataValue[]> {
|
|
||||||
|
|
||||||
public void set(DataValue[] dataValue) {
|
|
||||||
DataEngineRowHandler.set(dataValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataValue[] get() {
|
|
||||||
return DataEngineRowHandler.get();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.basic.abstracts;
|
|
||||||
|
|
||||||
import com.muyu.basic.BasicEngine;
|
|
||||||
import com.muyu.basic.handler.DataEngineValueHandler;
|
|
||||||
import com.muyu.core.domain.DataValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 数据值处理对象
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
public abstract class DataEngineValueActuator implements BasicEngine<DataValue> {
|
|
||||||
|
|
||||||
public void set(DataValue dataValue) {
|
|
||||||
DataEngineValueHandler.set(dataValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataValue get() {
|
|
||||||
return DataEngineValueHandler.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execution() {
|
|
||||||
this.run();
|
|
||||||
this.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void run();
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
package com.muyu.basic.handler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 规则引擎作用域
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class DataEngineHandler {
|
|
||||||
|
|
||||||
private static final ThreadLocal<Object> dataEngineHandler = new ThreadLocal<>();
|
|
||||||
|
|
||||||
public static void set(final Object handler) {
|
|
||||||
dataEngineHandler.set(handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> T get() {
|
|
||||||
return (T) dataEngineHandler.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void remove() {
|
|
||||||
dataEngineHandler.remove();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package com.muyu.basic.handler;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.core.domain.DataValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 数据记录/行作用域
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
public class DataEngineRowHandler {
|
|
||||||
|
|
||||||
public static void set(DataValue[] dataValue) {
|
|
||||||
DataEngineHandler.set(dataValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DataValue[] get() {
|
|
||||||
return DataEngineHandler.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
package com.muyu.basic.handler;
|
|
||||||
|
|
||||||
import com.muyu.core.domain.DataValue;
|
|
||||||
import com.muyu.core.utils.Convert;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: DongZeLiang
|
|
||||||
* @date: 2024/8/29
|
|
||||||
* @Description: 数据值作用域
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
public class DataEngineValueHandler {
|
|
||||||
|
|
||||||
public static void set(DataValue dataValue) {
|
|
||||||
DataEngineHandler.set(dataValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DataValue get() {
|
|
||||||
return DataEngineHandler.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void remove() {
|
|
||||||
DataEngineHandler.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Object getValue() {
|
|
||||||
return get().getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getIntegerValue() {
|
|
||||||
return Convert.toInt(getValue(), null);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.test;
|
package com.muyu.test;
|
||||||
|
import com.muyu.BasicEngine;
|
||||||
import com.muyu.basic.BasicEngine;
|
|
||||||
import com.muyu.core.domain.DataValue;
|
import com.muyu.core.domain.DataValue;
|
||||||
import com.muyu.domain.EngineVersion;
|
import com.muyu.domain.EngineVersion;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.test;
|
package com.muyu.test;
|
||||||
|
|
||||||
|
import com.muyu.BasicEngine;
|
||||||
import com.muyu.access.data.base.DataValue;
|
import com.muyu.access.data.base.DataValue;
|
||||||
import com.muyu.basic.BasicEngine;
|
|
||||||
import com.muyu.domain.EngineVersion;
|
import com.muyu.domain.EngineVersion;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* @Author: DongZeLiang
|
||||||
* @date: 2024/8/29
|
* @date: 2024com/8/29
|
||||||
* @Description: 测试类
|
* @Description: 测试类
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
*/
|
*/
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue