|
|
|
@ -4,6 +4,7 @@ import cn.hippo4j.starter.config.BootstrapProperties;
|
|
|
|
|
import cn.hippo4j.starter.core.ConfigEmptyException;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.core.env.ConfigurableEnvironment;
|
|
|
|
@ -19,7 +20,9 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
|
|
|
|
public class BeforeCheckConfiguration {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(BootstrapProperties properties, ConfigurableEnvironment environment) {
|
|
|
|
|
public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(@Autowired(required = false) BootstrapProperties properties,
|
|
|
|
|
ConfigurableEnvironment environment) {
|
|
|
|
|
if (properties != null) {
|
|
|
|
|
String username = properties.getUsername();
|
|
|
|
|
if (StrUtil.isBlank(username)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
@ -67,6 +70,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
"Please check whether the [spring.application.name] configuration is empty or an empty string."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new BeforeCheckConfiguration.BeforeCheck();
|
|
|
|
|
}
|
|
|
|
|