com.healthy.common.log.OperationLogAutoConfiguration Maven / Gradle / Ivy
package com.healthy.common.log;
import com.healthy.common.log.operation.aspect.OperationLogAspect;
import com.healthy.common.log.operation.handler.OperationLogHandler;
import com.healthy.common.log.operation.properties.OperationLogProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
/**
* 操作日志自动配置
*
* @author xm.z
*/
@EnableConfigurationProperties(OperationLogProperties.class)
@ConditionalOnProperty(prefix = OperationLogProperties.PREFIX, name = "enabled", matchIfMissing = true,
havingValue = "true")
public class OperationLogAutoConfiguration {
/**
* 注册操作日志Aspect
* @param Type of the parameter.
* @param operationLogHandler 操作日志处理器.
* @return OperationLogAspect
*/
@Bean
@ConditionalOnBean(OperationLogHandler.class)
public OperationLogAspect operationLogAspect(OperationLogHandler operationLogHandler) {
return new OperationLogAspect<>(operationLogHandler);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy