Files

69 lines
2.4 KiB
Java
Raw Normal View History

/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.yixiang.co
2020-06-27 16:29:35 +08:00
* 注意
* 本软件为www.yixiang.co开发研制未经购买不得使用
* 购买后可获得全部源代码禁止转卖分享上传到码云github等开源平台
* 一经发现盗用分享等行为将追究法律责任后果自负
*/
package co.yixiang;
2020-05-26 22:27:01 +08:00
import co.yixiang.annotation.AnonymousAccess;
2019-11-06 21:34:55 +08:00
import co.yixiang.utils.SpringContextHolder;
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;
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;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
2019-11-06 21:34:55 +08:00
/**
* @author hupeng
2019-11-06 21:34:55 +08:00
* @date 2018/11/15 9:20:19
*/
@EnableAsync
@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();
}
@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
}