|
@@ -1,6 +1,7 @@
|
|
|
package cn.com.qmth.examcloud.task.starter;
|
|
|
|
|
|
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
+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.domain.EntityScan;
|
|
|
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
|
|
@@ -15,10 +16,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.web.bootstrap.AppBootstrap;
|
|
|
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
-
|
|
|
-@SpringBootApplication
|
|
|
@Configuration
|
|
|
@EnableJpaAuditing
|
|
|
@EnableTransactionManagement
|
|
@@ -27,46 +24,46 @@ import cn.com.qmth.examcloud.web.support.SpringContextHolder;
|
|
|
@ComponentScan(basePackages = {"cn.com.qmth"})
|
|
|
@EntityScan(basePackages = {"cn.com.qmth.examcloud.task.dao.entity"})
|
|
|
@EnableJpaRepositories(basePackages = {"cn.com.qmth.examcloud.task.dao"})
|
|
|
-@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
|
|
|
+@SpringBootApplication(exclude = {MultipartAutoConfiguration.class})
|
|
|
public class TaskApp {
|
|
|
|
|
|
- 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
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param args
|
|
|
- */
|
|
|
- public static void main(String[] args) {
|
|
|
- AppBootstrap.run(TaskApp.class, args);
|
|
|
- test();
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * main
|
|
|
+ *
|
|
|
+ * @param args
|
|
|
+ * @author WANGWEI
|
|
|
+ */
|
|
|
+ public static void main(String[] args) {
|
|
|
+ AppBootstrap.run(TaskApp.class, args);
|
|
|
+ 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(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;
|
|
|
+ }
|
|
|
|
|
|
}
|