package com.hz3r.infrastructure.park; import lombok.extern.slf4j.Slf4j; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScans; import org.springframework.core.env.Environment; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.security.crypto.password.PasswordEncoder; import java.math.BigDecimal; import java.net.InetAddress; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @SpringBootApplication @EnableScheduling @ComponentScans({@ComponentScan(basePackages = {"com.hz3r"})}) @MapperScan(basePackages = "com.hz3r.infrastructure.park.**.mapper") @Slf4j public class BusinessWebapiApplication { @Bean public CommandLineRunner commandLineRunner() { return new CommandLineRunner() { @Autowired private PasswordEncoder passwordEncoder; @Override public void run(String... args) { } }; } public static void main(String[] args) throws Exception{ ConfigurableApplicationContext application = SpringApplication.run(BusinessWebapiApplication.class, args); log.info("\n--------------------------启动成功--------------------------------\n\t" ); Environment env = application.getEnvironment(); log.info("\n----------------------------------------------------------\n\t" + "Application '{}' is running! Access URLs:\n\t" + "Login: \thttp://{}:{}/manager\n\t" + "Doc: \thttp://{}:{}/manager/doc.html\n" + "----------------------------------------------------------", env.getProperty("spring.application.name"), InetAddress.getLocalHost().getHostAddress(), env.getProperty("server.port"), InetAddress.getLocalHost().getHostAddress(), env.getProperty("server.port")); } }