AOP的注入从@Component改为@Configuration
This commit is contained in:
parent
912bea0c53
commit
00bcb50ba9
@ -16,7 +16,6 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
*/
|
*/
|
||||||
@Aspect
|
@Aspect
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Configuration
|
|
||||||
public class BizTracingAop {
|
public class BizTracingAop {
|
||||||
|
|
||||||
@Around(value = "@annotation(bizTracing)")
|
@Around(value = "@annotation(bizTracing)")
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.dashboard.framework.tracer.config;
|
||||||
|
|
||||||
|
import cn.iocoder.dashboard.framework.tracer.annotation.BizTracingAop;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConditionalOnClass({BizTracingAop.class})
|
||||||
|
@EnableConfigurationProperties(BizTracerProperties.class)
|
||||||
|
@ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true)
|
||||||
|
public class BizTracerAutoConfiguration {
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public BizTracerProperties bizTracerProperties() {
|
||||||
|
return new BizTracerProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public BizTracingAop enableBizTracingAop() {
|
||||||
|
return new BizTracingAop();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.iocoder.dashboard.framework.tracer.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
@ConfigurationProperties("yudao.tracer")
|
||||||
|
@Data
|
||||||
|
public class BizTracerProperties {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user