mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-30 02:25:11 +00:00
添加配置校验
This commit is contained in:
@@ -6,8 +6,11 @@
|
||||
*/
|
||||
package com.egridcloud.udf.core;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 描述 : 系统配置
|
||||
@@ -17,26 +20,31 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "com.egridcloud.application.config")
|
||||
@Validated
|
||||
public class ApplicationConfig {
|
||||
|
||||
/**
|
||||
* 描述 : 是否输出异常堆栈
|
||||
*/
|
||||
@NotNull
|
||||
private boolean outputExceptionStackTrace = false;
|
||||
|
||||
/**
|
||||
* 描述 : 编码
|
||||
*/
|
||||
@NotNull
|
||||
private String encoding = "UTF-8";
|
||||
|
||||
/**
|
||||
* 描述 : 时区
|
||||
*/
|
||||
@NotNull
|
||||
private String timeZone = "Asia/Shanghai";
|
||||
|
||||
/**
|
||||
* 描述 : 日期格式
|
||||
*/
|
||||
@NotNull
|
||||
private String dateFormat = "yyyy-MM-dd'T'HH:mm:ss:SSSZ";
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,11 +9,14 @@ package com.egridcloud.udf.core.cors;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@@ -27,11 +30,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "com.egridcloud.cors")
|
||||
@Validated
|
||||
public class CorsConfig {
|
||||
|
||||
/**
|
||||
* 描述 : 跨域信息
|
||||
*/
|
||||
@NotNull
|
||||
private Map<String, CorsRegistrationConfig> config;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,10 +6,13 @@
|
||||
*/
|
||||
package com.egridcloud.udf.rms;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@@ -23,11 +26,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "com.egridcloud.rms.config")
|
||||
@Validated
|
||||
public class RmsConfig {
|
||||
|
||||
/**
|
||||
* 描述 : rms扫描路径
|
||||
*/
|
||||
@NotNull
|
||||
private String rmsPathPatterns;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user