|
@@ -5,11 +5,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
|
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
|
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
|
|
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.examwork.base.enums.ExamProperty;
|
|
|
import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
@@ -21,9 +24,9 @@ import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
|
@EnableTransactionManagement
|
|
|
@EnableEurekaClient
|
|
|
@EnableDiscoveryClient
|
|
|
-@ComponentScan(basePackages = { "cn.com.qmth" })
|
|
|
-@EntityScan(basePackages = { "cn.com.qmth" })
|
|
|
-@EnableJpaRepositories(basePackages = { "cn.com.qmth" })
|
|
|
+@ComponentScan(basePackages = {"cn.com.qmth"})
|
|
|
+@EntityScan(basePackages = {"cn.com.qmth"})
|
|
|
+@EnableJpaRepositories(basePackages = {"cn.com.qmth"})
|
|
|
public class CoreExamWorkApp {
|
|
|
|
|
|
static {
|
|
@@ -47,4 +50,14 @@ public class CoreExamWorkApp {
|
|
|
AppBootstrap.run(CoreExamWorkApp.class, args);
|
|
|
}
|
|
|
|
|
|
+ @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;
|
|
|
+ }
|
|
|
+
|
|
|
}
|