BusinessWebapiApplication.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.hz3r.infrastructure.park;
  2. import lombok.extern.slf4j.Slf4j;
  3. import org.mybatis.spring.annotation.MapperScan;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.boot.CommandLineRunner;
  6. import org.springframework.boot.SpringApplication;
  7. import org.springframework.boot.autoconfigure.SpringBootApplication;
  8. import org.springframework.context.ConfigurableApplicationContext;
  9. import org.springframework.context.annotation.Bean;
  10. import org.springframework.context.annotation.ComponentScan;
  11. import org.springframework.context.annotation.ComponentScans;
  12. import org.springframework.core.env.Environment;
  13. import org.springframework.scheduling.annotation.EnableScheduling;
  14. import org.springframework.security.crypto.password.PasswordEncoder;
  15. import java.math.BigDecimal;
  16. import java.net.InetAddress;
  17. import java.util.ArrayList;
  18. import java.util.Arrays;
  19. import java.util.List;
  20. @SpringBootApplication
  21. @EnableScheduling
  22. @ComponentScans({@ComponentScan(basePackages = {"com.hz3r"})})
  23. @MapperScan(basePackages = "com.hz3r.infrastructure.park.**.mapper")
  24. @Slf4j
  25. public class BusinessWebapiApplication {
  26. @Bean
  27. public CommandLineRunner commandLineRunner() {
  28. return new CommandLineRunner() {
  29. @Autowired
  30. private PasswordEncoder passwordEncoder;
  31. @Override
  32. public void run(String... args) {
  33. }
  34. };
  35. }
  36. public static void main(String[] args) throws Exception{
  37. ConfigurableApplicationContext application = SpringApplication.run(BusinessWebapiApplication.class, args);
  38. log.info("\n--------------------------启动成功--------------------------------\n\t" );
  39. Environment env = application.getEnvironment();
  40. log.info("\n----------------------------------------------------------\n\t" +
  41. "Application '{}' is running! Access URLs:\n\t" +
  42. "Login: \thttp://{}:{}/manager\n\t" +
  43. "Doc: \thttp://{}:{}/manager/doc.html\n" +
  44. "----------------------------------------------------------",
  45. env.getProperty("spring.application.name"),
  46. InetAddress.getLocalHost().getHostAddress(),
  47. env.getProperty("server.port"),
  48. InetAddress.getLocalHost().getHostAddress(),
  49. env.getProperty("server.port"));
  50. }
  51. }