|
@@ -1,6 +1,10 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.student.starter;
|
|
|
|
|
|
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.dao.UniqueRuleHolder;
|
|
|
+import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
+import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
|
+import cn.com.qmth.examcloud.web.jpa.DataIntegrityViolationTransverter;
|
|
|
+import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
|
|
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
|
|
@@ -16,13 +20,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
import org.springframework.web.multipart.MultipartResolver;
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.core.oe.student.dao.UniqueRuleHolder;
|
|
|
-import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
-import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
|
-import cn.com.qmth.examcloud.web.jpa.DataIntegrityViolationTransverter;
|
|
|
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
-
|
|
|
-@SpringBootApplication
|
|
|
@Configuration
|
|
|
@EnableJpaAuditing
|
|
|
@EnableTransactionManagement
|
|
@@ -32,36 +29,38 @@ import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
@EntityScan(basePackages = {"cn.com.qmth"})
|
|
|
@EnableJpaRepositories(basePackages = {"cn.com.qmth"})
|
|
|
@EnableMongoRepositories(basePackages = {"cn.com.qmth"})
|
|
|
-@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
|
|
|
+@SpringBootApplication(exclude = {MultipartAutoConfiguration.class})
|
|
|
public class OEStudentApp {
|
|
|
- static {
|
|
|
- String runtimeLevel = System.getProperty("log.commonLevel");
|
|
|
- if (null == runtimeLevel) {
|
|
|
- System.setProperty("log.commonLevel", "INFO");
|
|
|
- }
|
|
|
- System.setProperty("hibernate.dialect.storage_engine", "innodb");
|
|
|
- DataIntegrityViolationTransverter.setUniqueRules(UniqueRuleHolder.getUniqueRuleList());
|
|
|
- }
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- AppBootstrap.run(OEStudentApp.class, args);
|
|
|
- FileStorageUtil.initYunSite();
|
|
|
- FileStorageUtil.initYunClient();
|
|
|
- test();
|
|
|
- }
|
|
|
+ static {
|
|
|
+ String runtimeLevel = System.getProperty("log.commonLevel");
|
|
|
+ if (null == runtimeLevel) {
|
|
|
+ System.setProperty("log.commonLevel", "INFO");
|
|
|
+ }
|
|
|
+ System.setProperty("hibernate.dialect.storage_engine", "innodb");
|
|
|
+ DataIntegrityViolationTransverter.setUniqueRules(UniqueRuleHolder.getUniqueRuleList());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ AppBootstrap.run(OEStudentApp.class, args);
|
|
|
+ FileStorageUtil.initYunSite();
|
|
|
+ FileStorageUtil.initYunClient();
|
|
|
+ test();
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void test() {
|
|
|
+ Tester tester = SpringContextHolder.getBean(Tester.class);
|
|
|
+ tester.test();
|
|
|
+ }
|
|
|
|
|
|
- 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(200 * 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(200 * 1024 * 1024);
|
|
|
- return resolver;
|
|
|
- }
|
|
|
}
|