优化数据源初始化和获取逻辑
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
package com.zyplayer.doc.manage.framework.config;
|
||||
|
||||
import com.zyplayer.doc.db.framework.configuration.EnableDocDb;
|
||||
import com.zyplayer.doc.db.framework.db.bean.DatabaseRegistrationBean;
|
||||
import com.zyplayer.doc.dubbo.framework.config.EnableDocDubbo;
|
||||
import com.zyplayer.doc.elasticsearch.framework.config.EnableDocEs;
|
||||
import com.zyplayer.doc.swagger.framework.configuration.EnableDocSwagger;
|
||||
import com.zyplayer.doc.wiki.framework.config.EnableDocWiki;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
@@ -36,10 +33,4 @@ public class ZyplayerDocConfig {
|
||||
|
||||
@EnableDocSwagger(selfDoc = false)
|
||||
public class enableDocSwagger{}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties(prefix = "zyplayer.doc.db")
|
||||
public DatabaseRegistrationBean databaseRegistrationBean() {
|
||||
return new DatabaseRegistrationBean();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zyplayer.doc.manage.framework.interceptor;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.zyplayer.doc.core.util.ThreadLocalUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -28,8 +29,8 @@ public class RequestInfoInterceptor implements HandlerInterceptor {
|
||||
Long startTime = startTimeThreadLocal.get();
|
||||
startTime = Optional.ofNullable(startTime).orElse(System.currentTimeMillis());
|
||||
long totalTime = System.currentTimeMillis() - startTime;// 结束时间
|
||||
logger.info("总耗时:{}ms,URI:{}", totalTime, request.getRequestURI());
|
||||
|
||||
String clientIP = HttpUtil.getClientIP(request);
|
||||
logger.info("IP:{},总耗时:{}ms,URI:{}", clientIP, totalTime, request.getRequestURI());
|
||||
ThreadLocalUtil.clean();
|
||||
startTimeThreadLocal.remove();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user