mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
Reformat class Application
This commit is contained in:
parent
d72b5709bd
commit
27a6666f14
@ -29,15 +29,12 @@ import org.springframework.boot.Banner;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
|
|
||||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
|
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
|
||||||
import org.springframework.boot.web.servlet.ErrorPage;
|
import org.springframework.boot.web.servlet.ErrorPage;
|
||||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
|
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
import org.springframework.jms.annotation.EnableJms;
|
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
import javax.servlet.MultipartConfigElement;
|
import javax.servlet.MultipartConfigElement;
|
||||||
@ -51,16 +48,7 @@ public class Application {
|
|||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Application.class);
|
private static final Logger logger = LoggerFactory.getLogger(Application.class);
|
||||||
|
|
||||||
@Value("${web.upload-path}")
|
/*
|
||||||
private String uploaddir;
|
|
||||||
|
|
||||||
@Value("${spring.servlet.multipart.max-file-size}")
|
|
||||||
private String multipartMaxUpload;
|
|
||||||
|
|
||||||
@Value("${spring.servlet.multipart.max-request-size}")
|
|
||||||
private String multipartMaxRequest;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 记载模块
|
* 记载模块
|
||||||
*/
|
*/
|
||||||
static {
|
static {
|
||||||
@ -73,7 +61,7 @@ public class Application {
|
|||||||
// 企业聊天模块
|
// 企业聊天模块
|
||||||
MainContext.enableModule(Constants.CSKEFU_MODULE_ENTIM);
|
MainContext.enableModule(Constants.CSKEFU_MODULE_ENTIM);
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 插件组
|
* 插件组
|
||||||
*/
|
*/
|
||||||
// 外呼模块
|
// 外呼模块
|
||||||
@ -94,6 +82,13 @@ public class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Value("${web.upload-path}")
|
||||||
|
private String uploaddir;
|
||||||
|
@Value("${spring.servlet.multipart.max-file-size}")
|
||||||
|
private String multipartMaxUpload;
|
||||||
|
@Value("${spring.servlet.multipart.max-request-size}")
|
||||||
|
private String multipartMaxRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init local resources
|
* Init local resources
|
||||||
*/
|
*/
|
||||||
@ -106,6 +101,23 @@ public class Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Application.init();
|
||||||
|
|
||||||
|
/*
|
||||||
|
该APP中加载多个配置文件
|
||||||
|
http://roufid.com/load-multiple-configuration-files-different-directories-spring-boot/
|
||||||
|
*/
|
||||||
|
SpringApplication app = new SpringApplicationBuilder(Application.class)
|
||||||
|
.properties("spring.config.name:application,git")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
app.setBannerMode(Banner.Mode.CONSOLE);
|
||||||
|
app.setAddCommandLineProperties(false);
|
||||||
|
app.addListeners(new AppCtxRefreshEventListener());
|
||||||
|
MainContext.setApplicationContext(app.run(args));
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public MultipartConfigElement multipartConfigElement() {
|
public MultipartConfigElement multipartConfigElement() {
|
||||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||||
@ -117,29 +129,9 @@ public class Application {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public EmbeddedServletContainerCustomizer containerCustomizer() {
|
public EmbeddedServletContainerCustomizer containerCustomizer() {
|
||||||
return new EmbeddedServletContainerCustomizer() {
|
return container -> {
|
||||||
@Override
|
ErrorPage error = new ErrorPage("/error.html");
|
||||||
public void customize(ConfigurableEmbeddedServletContainer container) {
|
container.addErrorPages(error);
|
||||||
ErrorPage error = new ErrorPage("/error.html");
|
|
||||||
container.addErrorPages(error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
Application.init();
|
|
||||||
|
|
||||||
/************************
|
|
||||||
* 该APP中加载多个配置文件
|
|
||||||
* http://roufid.com/load-multiple-configuration-files-different-directories-spring-boot/
|
|
||||||
************************/
|
|
||||||
SpringApplication app = new SpringApplicationBuilder(Application.class)
|
|
||||||
.properties("spring.config.name:application,git")
|
|
||||||
.build();
|
|
||||||
|
|
||||||
app.setBannerMode(Banner.Mode.CONSOLE);
|
|
||||||
app.setAddCommandLineProperties(false);
|
|
||||||
app.addListeners(new AppCtxRefreshEventListener());
|
|
||||||
MainContext.setApplicationContext(app.run(args));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user