初始化

This commit is contained in:
2026-02-22 18:56:10 +08:00
commit 26677972a6
3112 changed files with 255972 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package tech.easyflow.log.config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import tech.easyflow.log.reporter.ActionLogReporterProperties;
import tech.easyflow.log.reporter.ActionReportInterceptor;
@MapperScan("tech.easyflow.log.mapper")
@Configuration
public class LogModuleConfig implements WebMvcConfigurer {
private final ActionLogReporterProperties logProperties;
private final ActionReportInterceptor actionReportInterceptor;
public LogModuleConfig(ActionLogReporterProperties logProperties,
ActionReportInterceptor actionReportInterceptor) {
this.logProperties = logProperties;
this.actionReportInterceptor = actionReportInterceptor;
System.out.println("启用模块 >>>>>>>>>> module-log");
}
/**
* 注册日志拦截器
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
if (!logProperties.isEnabled()) {
return;
}
registry.addInterceptor(actionReportInterceptor)
.addPathPatterns(logProperties.getIncludePatterns().toArray(new String[0]))
.excludePathPatterns(logProperties.getExcludePatterns().toArray(new String[0]));
}
}