|
@@ -4,20 +4,11 @@ import org.activiti.spring.boot.SecurityAutoConfiguration;
|
4
|
4
|
import org.mybatis.spring.annotation.MapperScan;
|
5
|
5
|
import org.springframework.boot.SpringApplication;
|
6
|
6
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
7
|
|
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
8
|
|
-import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
9
|
7
|
import org.springframework.cache.annotation.EnableCaching;
|
10
|
8
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
11
|
9
|
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
12
|
10
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
13
|
|
-import org.springframework.context.annotation.Bean;
|
14
|
|
-import org.springframework.context.annotation.ComponentScan;
|
15
|
|
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
16
|
11
|
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
17
|
|
-import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
18
|
|
-import org.springframework.web.servlet.DispatcherServlet;
|
19
|
|
-
|
20
|
|
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
21
|
12
|
|
22
|
13
|
|
23
|
14
|
@EnableEurekaClient
|
|
@@ -25,7 +16,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
25
|
16
|
@EnableCaching
|
26
|
17
|
@EnableRedisHttpSession
|
27
|
18
|
@EnableFeignClients
|
28
|
|
-@EnableSwagger2
|
29
|
19
|
@SpringBootApplication(
|
30
|
20
|
//exclude = {DataSourceAutoConfiguration.class} // 禁止自动配置数据源,多数据源需采用手动配置
|
31
|
21
|
exclude = SecurityAutoConfiguration.class
|
|
@@ -37,33 +27,5 @@ public class DepotBusinessApplication {
|
37
|
27
|
public static void main(String[] args) {
|
38
|
28
|
SpringApplication.run(DepotBusinessApplication.class, args);
|
39
|
29
|
}
|
40
|
|
-
|
41
|
|
-
|
42
|
|
- /**
|
43
|
|
- * 注册一个dispatcherServlet,解决增加ws之后https接口访问不了问题
|
44
|
|
- */
|
45
|
|
- /*@Bean
|
46
|
|
- public ServletRegistrationBean restServlet(){
|
47
|
|
- //注解扫描上下文
|
48
|
|
- AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
|
49
|
|
- //base package
|
50
|
|
- applicationContext.scan("com.chinaitop.depot.unissoft");
|
51
|
|
- //通过构造函数指定dispatcherServlet的上下文
|
52
|
|
- DispatcherServlet rest_dispatcherServlet = new DispatcherServlet(applicationContext);
|
53
|
|
- //用ServletRegistrationBean包装servlet
|
54
|
|
- ServletRegistrationBean registrationBean = new ServletRegistrationBean(rest_dispatcherServlet);
|
55
|
|
- registrationBean.setLoadOnStartup(1);
|
56
|
|
- //指定urlmapping
|
57
|
|
- registrationBean.addUrlMappings("/*");
|
58
|
|
- //指定name,如果不指定默认为dispatcherServlet
|
59
|
|
- registrationBean.setName("rest");
|
60
|
|
- return registrationBean;
|
61
|
|
- }
|
62
|
|
-*/
|
63
|
|
- /*@Bean
|
64
|
|
- public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
|
65
|
|
- return new ThreadPoolTaskScheduler();
|
66
|
|
- }*/
|
67
|
|
-
|
68
|
30
|
|
69
|
31
|
}
|