package com.zyxx; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.env.Environment; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import springfox.documentation.spring.web.SpringfoxWebMvcConfiguration; import java.net.InetAddress; import java.net.UnknownHostException; /** * 项目启动类 * * @EnableCaching 启用了缓存机制 * 开放了接口文档静态资源 * @Author Lizhou */ @Slf4j @SpringBootApplication @EnableCaching public class SpringBootMiniApplication { public static void main(String[] args) throws UnknownHostException { ConfigurableApplicationContext application = SpringApplication.run(SpringBootMiniApplication.class, args); Environment env = application.getEnvironment(); String ip = InetAddress.getLocalHost().getHostAddress(); String port = env.getProperty("server.port"); String path = env.getProperty("server.servlet.context-path"); log.info("\n----------------------------------------------------------\n\t" + "Application Declare is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path + "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n\t" + "Swagger-UI: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" + "----------------------------------------------------------"); } }
最近下载更多
13521878735 LV3
3月26日
森sdfgf LV8
2月8日
skook7 LV2
2023年12月14日
qwerdf963 LV3
2023年11月20日
JAVA小菜雀 LV7
2023年11月9日
edpwyg LV14
2023年10月22日
asdsasddas LV6
2023年4月20日
ming_123_9715 LV23
2023年4月9日
huangkexin LV1
2023年4月4日
Brilion LV6
2023年2月22日