46 lines
2.0 KiB
Java
46 lines
2.0 KiB
Java
|
|
package com.chinaweal.youfool.devops;
|
|||
|
|
|
|||
|
|
import lombok.extern.slf4j.Slf4j;
|
|||
|
|
import org.springframework.beans.factory.annotation.Value;
|
|||
|
|
import org.springframework.boot.SpringApplication;
|
|||
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
|
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|||
|
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
|||
|
|
import org.springframework.context.ApplicationListener;
|
|||
|
|
import org.springframework.context.event.ContextRefreshedEvent;
|
|||
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
|
|
|
|||
|
|
@SpringBootApplication(scanBasePackages = {"com.chinaweal"})
|
|||
|
|
@Slf4j
|
|||
|
|
@EnableScheduling
|
|||
|
|
public class DevOpsApplication extends SpringBootServletInitializer implements ApplicationListener<ContextRefreshedEvent> {
|
|||
|
|
@Value("${applicationName}")
|
|||
|
|
private String applicationName;
|
|||
|
|
@Value("${version}")
|
|||
|
|
private String version;
|
|||
|
|
@Value("${description}")
|
|||
|
|
private String description;
|
|||
|
|
|
|||
|
|
@Override
|
|||
|
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
|
|||
|
|
return applicationBuilder.sources(DevOpsApplication.class);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@Override
|
|||
|
|
public void onApplicationEvent(ContextRefreshedEvent event) {
|
|||
|
|
if (event.getApplicationContext().getParent() == null) {
|
|||
|
|
log.info("========================== 程序启动成功! ==========================");
|
|||
|
|
log.info("====== 程 序:{} !", applicationName);
|
|||
|
|
log.info("====== 版本号:{} ", version);
|
|||
|
|
log.info("====== 描 述:{} ", description);
|
|||
|
|
log.info("====== 接口文档路径:/doc.html,账号:admin、密码:123456。注:如果乱码请指定VM -Dfile.encoding=UTF-8");
|
|||
|
|
log.info("====== Druid Monitor路径:/druid,账号:admin、密码:123456");
|
|||
|
|
log.info("====================================================================");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static void main(String[] args) {
|
|||
|
|
SpringApplication.run(DevOpsApplication.class, args);
|
|||
|
|
}
|
|||
|
|
}
|