/** * Copyright (C) 2018-2020 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制,未经购买不得使用 * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) * 一经发现盗用、分享等行为,将追究法律责任,后果自负 */ package co.yixiang; import co.yixiang.annotation.AnonymousAccess; import co.yixiang.utils.SpringContextHolder; import org.mybatis.spring.annotation.MapperScan; 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; 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; /** * @author hupeng * @date 2018/11/15 9:20:19 */ @EnableAsync @RestController @SpringBootApplication @EnableTransactionManagement @MapperScan(basePackages ={"co.yixiang.modules.*.service.mapper", "co.yixiang.config"}) public class AppRun { public static void main(String[] args) { SpringApplication.run(AppRun.class, args); System.out.println( " __ \n" + " __ __ ___ / / ___ ___ \n" + " / // /(_-< / _ \\/ _ \\ / _ \\ \n" + " \\_, //___//_//_/\\___// .__/ \n" + "/___/ /_/ \n "+ "\n意象yshop电商系统管理后台启动成功 \n官网:https://www.yixiang.co 提供技术支持゙ \n"); } @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"; } }