2020-05-19 12:29:07 +08:00
|
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2018-2020
|
|
|
|
|
* All rights reserved, Designed By www.yixiang.co
|
2020-06-27 16:29:35 +08:00
|
|
|
|
* 注意:
|
|
|
|
|
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
|
|
|
|
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
|
|
|
|
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
2020-05-19 12:29:07 +08:00
|
|
|
|
*/
|
|
|
|
|
package co.yixiang;
|
2020-05-26 22:27:01 +08:00
|
|
|
|
|
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-19 12:29:07 +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-19 12:29:07 +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-06-27 16:29:35 +08:00
|
|
|
|
@MapperScan(basePackages ={"co.yixiang.modules.*.service.mapper", "co.yixiang.config"})
|
2019-11-06 21:34:55 +08:00
|
|
|
|
public class AppRun {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
SpringApplication.run(AppRun.class, args);
|
2020-05-31 11:51:02 +08:00
|
|
|
|
System.out.println(
|
|
|
|
|
" __ \n" +
|
|
|
|
|
" __ __ ___ / / ___ ___ \n" +
|
|
|
|
|
" / // /(_-< / _ \\/ _ \\ / _ \\ \n" +
|
|
|
|
|
" \\_, //___//_//_/\\___// .__/ \n" +
|
|
|
|
|
"/___/ /_/ \n "+
|
|
|
|
|
|
|
|
|
|
"\n意象yshop电商系统管理后台启动成功 \n官网:https://www.yixiang.co 提供技术支持゙ \n");
|
2019-11-06 21:34:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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
|
|
|
|
}
|