package com.nanjing.water.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.nanjing" })
|
@ServletComponentScan
|
@MapperScan("com.nanjing.water.repository.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);
|
}
|
}
|