2022-07-06 18:32:05 +08:00
|
|
|
package org.nl;
|
|
|
|
|
|
2022-08-05 13:53:58 +08:00
|
|
|
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
|
|
|
|
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
2022-07-06 18:32:05 +08:00
|
|
|
import io.swagger.annotations.Api;
|
2022-09-23 17:11:09 +08:00
|
|
|
import org.nl.modules.common.annotation.rest.AnonymousGetMapping;
|
|
|
|
|
import org.nl.wql.util.SpringContextHolder;
|
2022-07-06 18:32:05 +08:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
|
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.data.jpa.repository.config.EnableJpaAuditing;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开启审计功能 -> @EnableJpaAuditing
|
|
|
|
|
* https://www.cnblogs.com/niceyoo/p/10908647.html
|
|
|
|
|
*
|
|
|
|
|
* @author ldjun
|
|
|
|
|
* @date 2021/2/22 9:20:19
|
|
|
|
|
*/
|
|
|
|
|
@EnableAsync
|
|
|
|
|
@RestController
|
|
|
|
|
@Api(hidden = true)
|
|
|
|
|
@SpringBootApplication(exclude = {
|
|
|
|
|
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
|
|
|
|
})
|
|
|
|
|
@ServletComponentScan
|
|
|
|
|
@EnableTransactionManagement
|
|
|
|
|
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
2022-08-05 13:53:58 +08:00
|
|
|
@EnableMethodCache(basePackages = "org.nl")
|
|
|
|
|
@EnableCreateCacheAnnotation
|
2022-07-06 18:32:05 +08:00
|
|
|
public class AppRun {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
SpringApplication.run(AppRun.class, args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public SpringContextHolder springContextHolder() {
|
|
|
|
|
return new SpringContextHolder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public ServletWebServerFactory webServerFactory() {
|
|
|
|
|
TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory();
|
|
|
|
|
fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}"));
|
|
|
|
|
return fa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 访问首页提示
|
|
|
|
|
*
|
|
|
|
|
* @return /
|
|
|
|
|
*/
|
|
|
|
|
@AnonymousGetMapping("/")
|
|
|
|
|
public String index() {
|
|
|
|
|
return "Backend service started successfully";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|