package com.chaozhanggui.system.cashierservice; import lombok.extern.slf4j.Slf4j; import org.mybatis.spring.annotation.MapperScan; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.client.RestTemplate; @SpringBootApplication @EnableScheduling @EnableAsync //@EntityScan(basePackageClasses = {Shell.class}) //@EnableAspectJAutoProxy(proxyTargetClass = true) @Slf4j @MapperScan({"com.chaozhanggui.system.cashierservice.mybatis", "com.chaozhanggui.system.cashierservice.mapper", "com.chaozhanggui.system.cashierservice.dao"}) public class Shell { private static Logger logger = LoggerFactory.getLogger(Shell.class); public static void main(String[] args) { SpringApplication springApplication = new SpringApplication(Shell.class); springApplication.run(args); } @Bean public RestTemplate restTemplate(){ return new RestTemplate(); } @Bean public CommandLineRunner commandLineRunner(ApplicationContext ctx) { return (args) -> { logger.info("=========================启动完成=========================="); }; } @Bean public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer(); propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(true); return propertySourcesPlaceholderConfigurer; } }