cn.lang.global.configuration.GlobalExceptionConfiguration Maven / Gradle / Ivy
package cn.lang.global.configuration;
import cn.lang.global.handler.GlobalExceptionHandler;
import cn.lang.global.properties.GlobalExceptionProperties;
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;
/**
* @author Lang [email protected]
* description GlobalExceptionConfiguration
* date 2022-06-18
*/
@Configuration
@EnableConfigurationProperties({GlobalExceptionProperties.class})
@ConditionalOnProperty(
prefix = "lang.global-exception",
name = "enabled",
havingValue = "true",
matchIfMissing = true
)
public class GlobalExceptionConfiguration {
@Bean
public GlobalExceptionHandler globalExceptionHandler(){
return new GlobalExceptionHandler();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy