数字化大屏初始化
This commit is contained in:
24
src/main/java/cn/com/v2/common/config/CorsConfig.java
Normal file
24
src/main/java/cn/com/v2/common/config/CorsConfig.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package cn.com.v2.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
//重写WebMvcConfigurer实现全局跨域配置
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer{
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
// 是否发送Cookie
|
||||
.allowCredentials(true)
|
||||
// 放行哪些原始域
|
||||
.allowedOrigins("*")
|
||||
// 放行哪些请求方式
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE")
|
||||
// 放行哪些原始请求头部信息
|
||||
.allowedHeaders("*")
|
||||
// 暴露哪些头部信息
|
||||
.exposedHeaders("*");
|
||||
}
|
||||
}
|
||||
20
src/main/java/cn/com/v2/common/config/MybatisPlusConfig.java
Normal file
20
src/main/java/cn/com/v2/common/config/MybatisPlusConfig.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package cn.com.v2.common.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
/**
|
||||
* 新的分页插件,一缓和二缓遵循mybatis的规则,
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.SQLITE));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
72
src/main/java/cn/com/v2/common/config/V2Config.java
Normal file
72
src/main/java/cn/com/v2/common/config/V2Config.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package cn.com.v2.common.config;
|
||||
|
||||
import java.util.Map;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 读取项目相关配置
|
||||
*
|
||||
* @author fuce
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "v2")
|
||||
public class V2Config {
|
||||
|
||||
/**
|
||||
* 存储路径
|
||||
*/
|
||||
private String fileurl;
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
private String httpurl;
|
||||
/**
|
||||
* 虚拟路径map
|
||||
*/
|
||||
private Map<String, String> xnljmap;
|
||||
|
||||
/**
|
||||
* 默认文件格式
|
||||
*/
|
||||
private String defaultFormat;
|
||||
|
||||
|
||||
public String getFileurl() {
|
||||
return fileurl;
|
||||
}
|
||||
|
||||
public void setFileurl(String fileurl) {
|
||||
this.fileurl = fileurl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getHttpurl() {
|
||||
return httpurl;
|
||||
}
|
||||
|
||||
public void setHttpurl(String httpurl) {
|
||||
this.httpurl = httpurl;
|
||||
}
|
||||
|
||||
public Map<String, String> getXnljmap() {
|
||||
return xnljmap;
|
||||
}
|
||||
|
||||
public void setXnljmap(Map<String, String> xnljmap) {
|
||||
this.xnljmap = xnljmap;
|
||||
}
|
||||
|
||||
public String getDefaultFormat() {
|
||||
return defaultFormat;
|
||||
}
|
||||
|
||||
public void setDefaultFormat(String defaultFormat) {
|
||||
this.defaultFormat = defaultFormat;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user