|
@@ -1,6 +1,8 @@
|
|
package cn.com.qmth.examcloud.exchange;
|
|
package cn.com.qmth.examcloud.exchange;
|
|
|
|
|
|
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
|
+import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
|
|
+import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
|
|
@@ -12,67 +14,60 @@ import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.multipart.MultipartResolver;
|
|
import org.springframework.web.multipart.MultipartResolver;
|
|
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
|
-import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
|
|
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Exchange不连接除Redis外的任何数据库. 说明 by wangwei.<br>
|
|
* Exchange不连接除Redis外的任何数据库. 说明 by wangwei.<br>
|
|
- *
|
|
|
|
|
|
+ * <p>
|
|
* inner 提供云平台向南调用的中间件<br>
|
|
* inner 提供云平台向南调用的中间件<br>
|
|
* outer 提供第三方接入的中间件<br>
|
|
* outer 提供第三方接入的中间件<br>
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
-
|
|
|
|
-@SpringBootApplication
|
|
|
|
@Configuration
|
|
@Configuration
|
|
@EnableEurekaClient
|
|
@EnableEurekaClient
|
|
@EnableDiscoveryClient
|
|
@EnableDiscoveryClient
|
|
@ComponentScan(basePackages = {"cn.com.qmth"})
|
|
@ComponentScan(basePackages = {"cn.com.qmth"})
|
|
-@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class,
|
|
|
|
- MultipartAutoConfiguration.class})
|
|
|
|
|
|
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, MultipartAutoConfiguration.class})
|
|
public class ExchangeApp {
|
|
public class ExchangeApp {
|
|
|
|
|
|
- static {
|
|
|
|
- String runtimeLevel = System.getProperty("log.commonLevel");
|
|
|
|
- if (null == runtimeLevel) {
|
|
|
|
- System.setProperty("log.commonLevel", "INFO");
|
|
|
|
- }
|
|
|
|
- System.setProperty("hibernate.dialect.storage_engine", "innodb");
|
|
|
|
- }
|
|
|
|
|
|
+ static {
|
|
|
|
+ String runtimeLevel = System.getProperty("log.commonLevel");
|
|
|
|
+ if (null == runtimeLevel) {
|
|
|
|
+ System.setProperty("log.commonLevel", "INFO");
|
|
|
|
+ }
|
|
|
|
+ System.setProperty("hibernate.dialect.storage_engine", "innodb");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * main
|
|
|
|
+ *
|
|
|
|
+ * @param args
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ AppBootstrap.run(ExchangeApp.class, args);
|
|
|
|
|
|
- /**
|
|
|
|
- * main
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- * @param args
|
|
|
|
- */
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- AppBootstrap.run(ExchangeApp.class, args);
|
|
|
|
|
|
+ FileStorageUtil.initYunSite();
|
|
|
|
+ FileStorageUtil.initYunClient();
|
|
|
|
|
|
- FileStorageUtil.initYunSite();
|
|
|
|
- FileStorageUtil.initYunClient();
|
|
|
|
|
|
+ test();
|
|
|
|
+ }
|
|
|
|
|
|
- test();
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 测试方法
|
|
|
|
+ *
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ */
|
|
|
|
+ private static void test() {
|
|
|
|
+ Tester tester = SpringContextHolder.getBean(Tester.class);
|
|
|
|
+ tester.test();
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 测试方法
|
|
|
|
- *
|
|
|
|
- * @author WANGWEI
|
|
|
|
- */
|
|
|
|
- private static void test() {
|
|
|
|
- Tester tester = SpringContextHolder.getBean(Tester.class);
|
|
|
|
- tester.test();
|
|
|
|
- }
|
|
|
|
|
|
+ @Bean(name = "multipartResolver")
|
|
|
|
+ public MultipartResolver multipartResolver() {
|
|
|
|
+ CommonsMultipartResolver resolver = new CommonsMultipartResolver();
|
|
|
|
+ resolver.setDefaultEncoding("UTF-8");
|
|
|
|
+ resolver.setResolveLazily(true);
|
|
|
|
+ resolver.setMaxInMemorySize(2);
|
|
|
|
+ resolver.setMaxUploadSize(100 * 1024 * 1024);
|
|
|
|
+ return resolver;
|
|
|
|
+ }
|
|
|
|
|
|
- @Bean(name = "multipartResolver")
|
|
|
|
- public MultipartResolver multipartResolver() {
|
|
|
|
- CommonsMultipartResolver resolver = new CommonsMultipartResolver();
|
|
|
|
- resolver.setDefaultEncoding("UTF-8");
|
|
|
|
- resolver.setResolveLazily(true);
|
|
|
|
- resolver.setMaxInMemorySize(2);
|
|
|
|
- resolver.setMaxUploadSize(100 * 1024 * 1024);
|
|
|
|
- return resolver;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|