liulin
2024-07-29 b65029f9d6e351a714682c110343a8c23eb4e793
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
package com.lunhan.xxx.host;
 
import com.yomahub.tlog.core.enhance.AspectLogEnhance;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
 
@SpringBootApplication(scanBasePackages = { "com.lunhan" })
@ServletComponentScan
@MapperScan("com.baomidou.mybatisplus.samples.quickstart.mapper")
// 开启缓存
@EnableCaching
public class ApplicationStarter extends SpringBootServletInitializer {
    static {
        // 进行日志增强,自动判断日志框架。自动给每条日志加上一个全局唯一的traceId
        AspectLogEnhance.enhance();
    }
 
    public static void main(String[] args) {
        SpringApplication.run(ApplicationStarter.class, args);
    }
 
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ApplicationStarter.class);
    }
}