|
@@ -7,11 +7,7 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.core.print;
|
|
package cn.com.qmth.examcloud.core.print;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
|
|
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
|
|
-import cn.com.qmth.examcloud.commons.logging.SLF4JImpl;
|
|
|
|
import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
-import org.slf4j.MDC;
|
|
|
|
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.autoconfigure.domain.EntityScan;
|
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
|
@@ -22,8 +18,6 @@ import org.springframework.context.annotation.ComponentScan;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
-import org.springframework.web.multipart.MultipartResolver;
|
|
|
|
-import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: fengdesheng
|
|
* @author: fengdesheng
|
|
@@ -37,32 +31,19 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
@ComponentScan(basePackages = {"cn.com.qmth.examcloud"})
|
|
@ComponentScan(basePackages = {"cn.com.qmth.examcloud"})
|
|
@EntityScan(basePackages = {"cn.com.qmth.examcloud"})
|
|
@EntityScan(basePackages = {"cn.com.qmth.examcloud"})
|
|
@EnableJpaRepositories(basePackages = {"cn.com.qmth.examcloud"})
|
|
@EnableJpaRepositories(basePackages = {"cn.com.qmth.examcloud"})
|
|
-//@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
|
|
|
|
public class PrintApplication extends SpringBootServletInitializer {
|
|
public class PrintApplication extends SpringBootServletInitializer {
|
|
- private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(PrintApplication.class);
|
|
|
|
-
|
|
|
|
- public static void main(String[] args) throws Exception {
|
|
|
|
- if (LOG instanceof SLF4JImpl) {
|
|
|
|
- MDC.put("TRACE_ID", Thread.currentThread().getName());
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ static {
|
|
String runtimeLevel = System.getProperty("log.commonLevel");
|
|
String runtimeLevel = System.getProperty("log.commonLevel");
|
|
if (null == runtimeLevel) {
|
|
if (null == runtimeLevel) {
|
|
System.setProperty("log.commonLevel", "DEBUG");
|
|
System.setProperty("log.commonLevel", "DEBUG");
|
|
}
|
|
}
|
|
|
|
+ System.setProperty("hibernate.dialect.storage_engine", "innodb");
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public static void main(String[] args) throws Exception {
|
|
//SpringApplication.run(PrintApplication.class, args);
|
|
//SpringApplication.run(PrintApplication.class, args);
|
|
AppBootstrap.run(PrintApplication.class, args);
|
|
AppBootstrap.run(PrintApplication.class, args);
|
|
}
|
|
}
|
|
|
|
|
|
- //@Bean(name = "multipartResolver")
|
|
|
|
- public MultipartResolver multipartResolver() {
|
|
|
|
- CommonsMultipartResolver resolver = new CommonsMultipartResolver();
|
|
|
|
- resolver.setDefaultEncoding("UTF-8");
|
|
|
|
- resolver.setResolveLazily(true);
|
|
|
|
- resolver.setMaxInMemorySize(50 * 1024);
|
|
|
|
- resolver.setMaxUploadSize(100 * 1024 * 1024);
|
|
|
|
- return resolver;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|