医院废弃物信息化管理平台
“mitao”
2025-12-24 3763145f34d7706923d55edc32f5cfbc8bc08b92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package cn.besteam;
 
import cn.besteam.common.api.vo.Result;
import cn.besteam.common.aspect.annotation.OpenApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.concurrent.Executor;
 
@EnableSwagger2
@SpringBootApplication
@EnableAsync
// @EnableScheduling
public class BackendApplication {
 
    public static void main(String[] args) {
 
        SpringApplication.run(BackendApplication.class, args);
    }
 
    @Bean
    public Executor taskExecutor() {
 
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(2);
        executor.setMaxPoolSize(200);
        executor.setQueueCapacity(500);
        executor.setThreadNamePrefix("Task-");
        executor.initialize();
        return executor;
    }
 
    @Controller
    public class MainController {
 
        @GetMapping("/echo")
        @ResponseBody
        @OpenApi
        public Result<String> echo() {
 
            return Result.ok("在线中...");
        }
 
        @GetMapping("/")
        @OpenApi
        public void index(HttpServletResponse response) throws IOException {
 
            response.sendRedirect("doc.html");
        }
 
    }
 
}