首页>代码>spring boot微信公众号开发案例>/tyf-wechat/ruoyi-admin/src/main/java/com/ruoyi/ApplicationRun.java
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);
    }
}
最近下载更多
wdrfgddds  LV1 4月13日
shuangfu  LV24 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日
阿达asdw1  LV4 2023年5月18日
爱德华诺曼底  LV2 2023年3月26日
mwh1001  LV15 2023年3月10日
最近浏览更多
youwuzuichen  LV10 4月17日
wdrfgddds  LV1 4月13日
plecon  LV1 3月29日
江小鱼  LV14 3月19日
暂无贡献等级
zhujunnan  LV12 3月8日
玖零定制问题修复  LV34 3月3日
段贤锐  LV8 2月29日
Raymond030 2月22日
暂无贡献等级
liiiyou  LV1 1月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友