XlyAiApplication.java
2.51 KB
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
package com.xly;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.HashMap;
import java.util.Map;
@EnableAsync
@EnableScheduling
@EnableCaching
@SpringBootApplication
@MapperScan("com.xly.mapper")
public class XlyAiApplication extends SpringBootServletInitializer { // 关键:继承 SpringBootServletInitializer
private static final Logger logger = LoggerFactory.getLogger(XlyAiApplication.class);
@Override // 关键:重写 configure 方法
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(XlyAiApplication.class);
}
/**
* 提取报修结构化信息
*/
@PostMapping("/")
public String home(@RequestBody Map<String,Object> sendMap) {
return "欢迎来到小羚羊AI系统";
}
public static void main(String[] args) {
SpringApplication.run(XlyAiApplication.class, args);
logger.info(" \n" +
" /$$ \n" +
" | $$ \n" +
" /$$ /$$ /$$ /$$ /$$ /$$$$$$$| $$ /$$$$$$$\n" +
"| $$ | $$ | $$| $$ | $$ /$$_____/| $$ /$$_____/\n" +
"| $$ | $$ | $$| $$ | $$| $$ | $$| $$$$$$ \n" +
"| $$ | $$ | $$| $$ | $$| $$ | $$ \\____ $$\n" +
"| $$$$$/$$$$/| $$$$$$$| $$$$$$$| $$ /$$$$$$$/\n" +
" \\_____/\\___/ \\____ $$ \\_______/|__/|_______/ \n" +
" /$$ | $$ \n" +
" | $$$$$$/ \n" +
" \\______/ ");
logger.info("I wish you a pleasant use of the system and never have any bugs");
}
}