2019-11-06 21:34:55 +08:00
|
|
|
package co.yixiang;
|
2020-05-12 09:37:52 +08:00
|
|
|
import co.yixiang.modules.activity.service.YxStoreCouponUserService;
|
2020-01-07 23:24:01 +08:00
|
|
|
import co.yixiang.annotation.AnonymousAccess;
|
2019-11-06 21:34:55 +08:00
|
|
|
import co.yixiang.utils.SpringContextHolder;
|
2020-05-14 00:55:29 +08:00
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
2019-11-06 21:34:55 +08:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2020-01-07 23:24:01 +08:00
|
|
|
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
|
|
|
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
2019-11-06 21:34:55 +08:00
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
2020-01-07 23:24:01 +08:00
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
2019-11-06 21:34:55 +08:00
|
|
|
|
|
|
|
/**
|
2020-05-14 12:36:32 +08:00
|
|
|
* @author hupeng
|
2019-11-06 21:34:55 +08:00
|
|
|
* @date 2018/11/15 9:20:19
|
|
|
|
*/
|
|
|
|
@EnableAsync
|
2020-01-07 23:24:01 +08:00
|
|
|
@RestController
|
2019-11-06 21:34:55 +08:00
|
|
|
@SpringBootApplication
|
|
|
|
@EnableTransactionManagement
|
2020-05-14 00:55:29 +08:00
|
|
|
@MapperScan(basePackages = "co.yixiang.*.mapper")
|
2019-11-06 21:34:55 +08:00
|
|
|
public class AppRun {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
SpringApplication.run(AppRun.class, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
public SpringContextHolder springContextHolder() {
|
|
|
|
return new SpringContextHolder();
|
|
|
|
}
|
2020-01-07 23:24:01 +08:00
|
|
|
|
|
|
|
@Bean
|
|
|
|
public ServletWebServerFactory webServerFactory() {
|
|
|
|
TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory();
|
|
|
|
fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}"));
|
|
|
|
return fa;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 访问首页提示
|
|
|
|
* @return /
|
|
|
|
*/
|
|
|
|
@GetMapping("/")
|
|
|
|
@AnonymousAccess
|
|
|
|
public String index() {
|
|
|
|
return "Backend service started successfully";
|
|
|
|
}
|
2019-11-06 21:34:55 +08:00
|
|
|
}
|