完善维护列表
parent
ec2a85ea69
commit
421cf5ada6
|
@ -0,0 +1,17 @@
|
|||
package com.muyu;
|
||||
|
||||
import com.muyu.handler.DataEngineHandler;
|
||||
|
||||
public interface BasicEngine<V> {
|
||||
|
||||
public void set(V dataValue);
|
||||
|
||||
public V get();
|
||||
|
||||
public default void remove() {
|
||||
DataEngineHandler.remove();
|
||||
}
|
||||
|
||||
public void execution();
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.muyu.abstracts;
|
||||
|
||||
|
||||
import com.muyu.BasicEngine;
|
||||
import com.muyu.handler.DataEngineDataSetHandler;
|
||||
|
||||
public abstract class DataEngineDataSetActuator implements BasicEngine<DataValue[][]> {
|
||||
|
||||
public void set(DataValue[][] dataValue) {
|
||||
DataEngineDataSetHandler.set(dataValue);
|
||||
}
|
||||
|
||||
public DataValue[][] get() {
|
||||
return DataEngineDataSetHandler.get();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.abstracts;
|
||||
|
||||
import com.muyu.BasicEngine;
|
||||
import com.muyu.handler.DataEngineRowHandler;
|
||||
|
||||
public abstract class DataEngineRowActuator implements BasicEngine<DataValue[]> {
|
||||
|
||||
public void set(DataValue[] dataValue) {
|
||||
DataEngineRowHandler.set(dataValue);
|
||||
}
|
||||
|
||||
public DataValue[] get() {
|
||||
return DataEngineRowHandler.get();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.abstracts;
|
||||
|
||||
import com.muyu.BasicEngine;
|
||||
import com.muyu.handler.DataEngineValueHandler;
|
||||
|
||||
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();
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.abstracts;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.abstracts
|
||||
* @Project:cloud-etl-engine
|
||||
* @name:DataValue
|
||||
* @Date:2024/9/2 19:26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public abstract class DataValue {
|
||||
/**
|
||||
* 键
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String label;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.engine.row;
|
||||
|
||||
import com.muyu.abstracts.DataEngineRowActuator;
|
||||
import com.muyu.abstracts.DataValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class ENGINE_ROW_HANG_R1 extends DataEngineRowActuator {
|
||||
@Override
|
||||
public void execution() {
|
||||
DataValue[] dataValues = get();
|
||||
|
||||
// 使用 HashSet 去重
|
||||
Set<DataValue> uniquePeople = new HashSet<>(Arrays.asList(dataValues));
|
||||
|
||||
// 将 Set 转换回数组
|
||||
DataValue[] uniqueArray = uniquePeople.toArray(new DataValue[0]);
|
||||
|
||||
System.out.println(Arrays.toString(uniqueArray));
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package com.muyu.engine.value;
|
||||
|
||||
public class ENGINE_PHONE_TEST_V1 {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.engine.value;
|
||||
|
||||
import com.muyu.abstracts.DataEngineValueActuator;
|
||||
import com.muyu.abstracts.DataValue;
|
||||
|
||||
public class ENGINE_VALUE_VFD1000_V1 extends DataEngineValueActuator {
|
||||
@Override
|
||||
public void run() {
|
||||
DataValue dataValue = get();
|
||||
if (dataValue.getValue() == null) {
|
||||
System.out.println("数据为空");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
//package com.muyu.engine.value;
|
||||
//
|
||||
//import com.muyu.abstracts.DataEngineValueActuator;
|
||||
//import com.muyu.abstracts.DataValue;
|
||||
//
|
||||
//public class ENGINE_VALUE_VFD1000_V2 extends DataEngineValueActuator {
|
||||
// @Override
|
||||
// public void run() {
|
||||
//
|
||||
// DataValue dataValue = get();
|
||||
//
|
||||
// String string = Desensitization.mobilePhoneDesensitization((String) dataValue.getValue());
|
||||
// System.out.println("手机号脱敏的结果是====>" + string);
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,14 @@
|
|||
package com.muyu.engine.value;
|
||||
|
||||
import com.muyu.abstracts.DataEngineValueActuator;
|
||||
import com.muyu.abstracts.DataValue;
|
||||
|
||||
public class ENGINE_phone_zzzzz_V9 extends DataEngineValueActuator {
|
||||
@Override
|
||||
public void run() {
|
||||
DataValue dataValue = get();
|
||||
if (dataValue.getValue() == null) {
|
||||
System.out.println("数据为空");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.handler;
|
||||
|
||||
import com.muyu.abstracts.DataValue;
|
||||
|
||||
public class DataEngineDataSetHandler {
|
||||
|
||||
public static void set(DataValue[][] dataDescribe){DataEngineHandler.set(dataDescribe);}
|
||||
|
||||
public static DataValue[][] get(){
|
||||
return DataEngineHandler.get();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.handler;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.handler;
|
||||
|
||||
import com.muyu.abstracts.DataValue;
|
||||
|
||||
public class DataEngineRowHandler {
|
||||
|
||||
public static void set(DataValue[] dataDescribe){DataEngineHandler.set(dataDescribe);}
|
||||
|
||||
public static DataValue[] get(){
|
||||
return DataEngineHandler.get();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.handler;
|
||||
|
||||
import com.muyu.abstracts.DataValue;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
|
||||
|
||||
public class DataEngineValueHandler {
|
||||
|
||||
|
||||
public static void set(DataValue dataDescribe) {
|
||||
|
||||
DataEngineHandler.set(dataDescribe);
|
||||
}
|
||||
|
||||
public static DataValue get() {
|
||||
return DataEngineHandler.get();
|
||||
}
|
||||
|
||||
|
||||
public static void remove() {
|
||||
DataEngineHandler.remove();
|
||||
}
|
||||
|
||||
|
||||
public static Object getValue() {
|
||||
return get().getValue();
|
||||
}
|
||||
|
||||
public static Integer getInt() {
|
||||
return Convert.toInt(getValue(), null);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue