result = new HashMap<>(2);
+ result.put("before",beforeBuilder.toString());
+ result.put("after",afterBuilder.toString());
+ return result;
+ }
+
+}
diff --git a/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/BeanCopyUtils.java b/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/BeanCopyUtils.java
deleted file mode 100644
index 64c0dc3..0000000
--- a/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/BeanCopyUtils.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.inscloudtech.alog.clientdemo.utils;
-
-
-
-import com.inscloudtech.alog.common.annotation.NeedRecordField;
-
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.*;
-
-/**
- * bean深拷贝工具(基于 cglib 性能优异)
- *
- * 重点 cglib 不支持 拷贝到链式对象
- * 例如: 源对象 拷贝到 目标(链式对象)
- * 请区分好`浅拷贝`和`深拷贝`再做使用
- *
- * @author inscloudtech
- */
-
-public class BeanCopyUtils {
-
- /**
- * 获取变更内容
- * @param oldBean 更改前的Bean
- * @param newBean 更改后的Bean
- * @param
- * @return
- */
- public static Map getChangedFields(T oldBean, T newBean){
- Field[] fields = newBean.getClass().getDeclaredFields();
- StringBuilder beforeBuilder = new StringBuilder();
- StringBuilder afterBuilder = new StringBuilder();
- String fieldName = "";
- for(Field field : fields) {
- field.setAccessible(true);
- if (!field.isAnnotationPresent(NeedRecordField.class)) {
- continue;
- }
-
- try {
- Object oldValue = field.get(oldBean);
- Object newValue = field.get(newBean);
- if(null != newValue && !Objects.equals(newValue, oldValue)) {
- fieldName = field.getAnnotation(NeedRecordField.class).fieldName();
- beforeBuilder.append(fieldName);
- beforeBuilder.append(": 【更改前:");
- beforeBuilder.append(oldValue);
- beforeBuilder.append("】,");
-
- afterBuilder.append(fieldName);
- afterBuilder.append(": 【更改后:");
- afterBuilder.append(newValue);
- afterBuilder.append("】,");
-
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- Map result = new HashMap<>(2);
- result.put("before",beforeBuilder.toString());
- result.put("after",afterBuilder.toString());
- return result;
- }
-
-
- /**
- * 利用反射通过get方法获取bean中字段fieldName的值
- * @param bean
- * @param fieldName
- * @return
- * @throws Exception
- */
- public static Object getFieldValue(Object bean, String fieldName)
- throws Exception {
- StringBuffer result = new StringBuffer();
- String methodName = result.append("get")
- .append(fieldName.substring(0, 1).toUpperCase())
- .append(fieldName.substring(1)).toString();
-
- Object rObject = null;
- Method method = null;
-
- @SuppressWarnings("rawtypes")
- Class[] classArr = new Class[0];
- method = bean.getClass().getMethod(methodName, classArr);
- rObject = method.invoke(bean, new Object[0]);
-
- return rObject;
- }
-
-
-
- private static void setFieldValue(Object bean, String fieldName, Object value)
- throws Exception {
- StringBuffer result = new StringBuffer();
- String methodName = result.append("set")
- .append(fieldName.substring(0, 1).toUpperCase())
- .append(fieldName.substring(1)).toString();
-
- /**
- * 利用发射调用bean.set方法将value设置到字段
- */
- Class[] classArr = new Class[1];
- classArr[0]="java.lang.String".getClass();
- Method method=bean.getClass().getMethod(methodName,classArr);
- method.invoke(bean,value);
- }
-}
diff --git a/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/StringUtils.java b/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/StringUtils.java
index b158d3d..c5722d9 100644
--- a/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/StringUtils.java
+++ b/example/src/main/java/com/inscloudtech/alog/clientdemo/utils/StringUtils.java
@@ -3,7 +3,6 @@ package com.inscloudtech.alog.clientdemo.utils;
-import org.springframework.util.AntPathMatcher;
import java.util.*;
import java.util.function.Function;
diff --git a/example/src/main/resources/application.yml b/example/src/main/resources/application.yml
index 5ea929e..1bf7d56 100644
--- a/example/src/main/resources/application.yml
+++ b/example/src/main/resources/application.yml
@@ -27,9 +27,11 @@ spring:
- #worker的地址
-aLog-workers:
- - 127.0.0.1:39999
+
+aLog:
+ appId: 4667442
+ workers:
+ - 127.0.0.1:39999
#apollo.meta=http://127.0.0.1:8080
diff --git a/worker/pom.xml b/worker/pom.xml
index 18d180d..bc87327 100644
--- a/worker/pom.xml
+++ b/worker/pom.xml
@@ -55,11 +55,11 @@
true