package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.ansi.AnsiColor;
import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
/**
* 启动程序
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class ApplicationRun
{
public static void main(String[] args)
{
ConfigurableApplicationContext context = SpringApplication.run(ApplicationRun.class, args);
System.out.println(transColor("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙"));
System.out.println(transColor(getProperties(context.getEnvironment())));
}
private static String getProperties(Environment environment) {
String appName=environment.getProperty("spring.application.name");
String active=environment.getProperty("spring.profiles.active");
String server=environment.getProperty("server.port");
String contextPath=environment.getProperty("server.servlet.context-path");
StringBuffer sb=new StringBuffer();
sb.append("activeProfiles=").append(active).append(",");
sb.append("appName=").append(appName).append(",");
sb.append("serverPort=").append(server).append(",");
sb.append("contextPath=").append(contextPath).append(";");
return sb.toString();
}
private static String transColor(String str){
return AnsiOutput.toString(AnsiColor.BRIGHT_YELLOW,str);
}
}
最近下载更多
daniellx LV3
2024年7月19日
微信网友_6985185949847552 LV2
2024年5月8日
rentoXSW LV1
2024年4月28日
wdrfgddds LV1
2024年4月13日
shuangfu LV25
2023年10月19日
微信网友_6561552570798080 LV1
2023年7月14日
suxin123_123 LV5
2023年5月29日
笑得很美 LV11
2023年5月29日
茫茫人海中的小牛 LV10
2023年5月29日
wxm4252 LV12
2023年5月29日
最近浏览更多
不一样的程序猿 LV11
8月16日
china_0221 LV41
3月19日
wen435301369 LV17
2024年12月7日
zolscy LV24
2024年11月27日
qitianjie
2024年11月25日
暂无贡献等级
fzlzxc LV10
2024年11月1日
Peny_ZH LV5
2024年9月22日
汤汤汤要学编程 LV11
2024年8月12日
daniellx LV3
2024年7月19日
leiyuexiang
2024年7月12日
暂无贡献等级

