瀏覽代碼

重新定位版本号,并为mongo重新添加监控埋点

刘凯雄 2 年之前
父節點
當前提交
b2006f0d6d

+ 1 - 2
elab-db/src/main/java/com/elab/core/aop/annotations/EnableElabDB.java

@@ -3,7 +3,6 @@ package com.elab.core.aop.annotations;
 import com.elab.core.spring.DaoScannerRegister;
 import com.elab.core.spring.config.BasicDaoConfig;
 import com.elab.core.spring.config.DataSourceConfigBean;
-import com.elab.core.spring.config.TransactionConfigBean;
 import org.springframework.context.annotation.Import;
 
 import java.lang.annotation.*;
@@ -11,7 +10,7 @@ import java.lang.annotation.*;
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
 @Documented
-@Import({DaoScannerRegister.class, DataSourceConfigBean.class, BasicDaoConfig.class, TransactionConfigBean.class})
+@Import({DaoScannerRegister.class, DataSourceConfigBean.class, BasicDaoConfig.class})
 public @interface EnableElabDB {
     /**
      * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation

+ 3 - 3
elab-db/src/main/java/com/elab/core/dao/BasicBaseDao.java

@@ -66,9 +66,9 @@ public class BasicBaseDao implements ApplicationContextAware, InitializingBean {
 
     @Override
     public void afterPropertiesSet() throws Exception {
-        Map<String, CheckSqlProcess> beansOfType = this.applicationContext.getBeansOfType(CheckSqlProcess.class);
+        // Map<String, CheckSqlProcess> beansOfType = this.applicationContext.getBeansOfType(CheckSqlProcess.class);
         Map<String, SQLEventHandler> SQLEventHandlerMap = this.applicationContext.getBeansOfType(SQLEventHandler.class);
-        if (SQLEventHandlerMap != null && SQLEventHandlerMap.size() > 0) {
+        if (SQLEventHandlerMap.size() > 0) {
             this.sqlEventHandlerList = new ArrayList<>();
             SQLEventHandlerMap.forEach((K, V) -> {
                 this.sqlEventHandlerList.add(V);
@@ -76,7 +76,7 @@ public class BasicBaseDao implements ApplicationContextAware, InitializingBean {
         }
 
         Map<String, SQLPostProcess> sqlPostProcessMap = this.applicationContext.getBeansOfType(SQLPostProcess.class);
-        if (sqlPostProcessMap != null && sqlPostProcessMap.size() > 0) {
+        if (sqlPostProcessMap.size() > 0) {
             this.sqlPostProcessorList = new ArrayList<>();
             sqlPostProcessMap.forEach((K, V) -> {
                 this.sqlPostProcessorList.add(V);

+ 14 - 0
elab-redis/README.md

@@ -147,6 +147,20 @@ spring.redis.elab.config-refresh.enable: true
 
 此时会注册 : `RedisRefreshConfigure` 配置
 
+
+
+直接使用: 
+
+当你类中的某个变量希望与Redis中的key进行绑定时,请在类中加入
+
+```java
+@Scope(CacheConstants.REFRESH_CONFIG_SCOPE_NAME)
+```
+
+
+
+
+
 大概流程图:
 
 ![image-20210901172831387](https://gitee.com/liukaixiong/drawing-bed/raw/master/image/image-20210901172831387.png)

+ 2 - 4
elab-spring/src/main/java/com/elab/spring/utils/RestTemplateUtils.java

@@ -32,7 +32,6 @@ import java.util.Map;
  **/
 public class RestTemplateUtils {
 
-
     private Logger logger = LoggerFactory.getLogger(RestTemplateUtils.class);
     public RestTemplate restTemplate;
 
@@ -108,7 +107,6 @@ public class RestTemplateUtils {
         //         替换String的默认字符集
         getRestTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
 
-
         //设置HTTP请求头信息,实现编码等
         headers = new HttpHeaders();
         MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
@@ -368,7 +366,7 @@ public class RestTemplateUtils {
             }
         } catch (Exception e) {
             if (!(e instanceof CoolingException)) {
-                logger.warn("第三方调用异常:"+ e.getMessage());
+                logger.warn("第三方调用异常:" + e.getMessage());
             }
             t.setStatus(e.getClass().getSimpleName());
             if (restFallback != null) {
@@ -411,7 +409,7 @@ public class RestTemplateUtils {
             }
             t.setStatus(Transaction.SUCCESS);
         } catch (Exception e) {
-            logger.warn("------ 第三方接口调用失败 : "+ e.getMessage());
+            logger.warn("------ 第三方接口调用失败 : ",e);
             t.setStatus(e.getClass().getSimpleName());
         } finally {
             t.complete();