67 lines
2.1 KiB
Java
67 lines
2.1 KiB
Java
|
|
package org.nl;
|
||
|
|
|
||
|
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||
|
|
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
||
|
|
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
||
|
|
|
||
|
|
import org.dromara.dynamictp.core.spring.EnableDynamicTp;
|
||
|
|
import org.mybatis.spring.annotation.MapperScan;
|
||
|
|
import org.nl.common.annotation.Limit;
|
||
|
|
import org.nl.config.SpringContextHolder;
|
||
|
|
import org.springframework.boot.SpringApplication;
|
||
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||
|
|
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
|
||
|
|
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||
|
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||
|
|
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
||
|
|
import org.springframework.context.annotation.Bean;
|
||
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 开启审计功能 -> @EnableJpaAuditing
|
||
|
|
* https://www.cnblogs.com/niceyoo/p/10908647.html
|
||
|
|
* https://blog.csdn.net/qq_36850813/article/details/101194250
|
||
|
|
*
|
||
|
|
* @author ldjun
|
||
|
|
* @date 2021/2/22 9:20:19
|
||
|
|
*/
|
||
|
|
@EnableAsync
|
||
|
|
@RestController
|
||
|
|
@SpringBootApplication(exclude = {
|
||
|
|
QuartzAutoConfiguration.class,
|
||
|
|
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||
|
|
})
|
||
|
|
@EnableDynamicTp
|
||
|
|
@ServletComponentScan
|
||
|
|
@EnableTransactionManagement
|
||
|
|
@EnableMethodCache(basePackages = "org.nl")
|
||
|
|
@EnableCreateCacheAnnotation
|
||
|
|
@MapperScan("org.nl.**.mapper")
|
||
|
|
public class AppRun {
|
||
|
|
|
||
|
|
public static void main(String[] args) {
|
||
|
|
SpringApplication.run(AppRun.class, args);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Bean
|
||
|
|
public SpringContextHolder springContextHolder() {
|
||
|
|
return new SpringContextHolder();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 访问首页提示
|
||
|
|
*
|
||
|
|
* @return /
|
||
|
|
*/
|
||
|
|
@GetMapping("/")
|
||
|
|
@Limit(period = 2, count = 1)
|
||
|
|
@SaIgnore
|
||
|
|
public String index() {
|
||
|
|
return "Backend service started successfully";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|