初始化
This commit is contained in:
parent
dfdae52bb1
commit
7e4726680f
@ -1,12 +1,17 @@
|
|||||||
package com.agri;
|
package com.agri;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.data.repository.init.ResourceReader;
|
import org.springframework.data.repository.init.ResourceReader;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
@ -15,22 +20,35 @@ import java.io.*;
|
|||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
public class AdminApplication
|
@Slf4j
|
||||||
{
|
public class AdminApplication {
|
||||||
public static void main(String[] args)
|
public static void main(String[] args) {
|
||||||
{
|
System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
SpringApplication.run(AdminApplication.class, args);
|
ConfigurableApplicationContext applicationContext = SpringApplication.run(AdminApplication.class, args);
|
||||||
InputStream inputStream = ResourceReader.class.getClassLoader().getResourceAsStream("logo.txt");
|
Environment env = applicationContext.getEnvironment();
|
||||||
//打印启动成功logo
|
String ip = null;
|
||||||
if (inputStream != null) {
|
try {
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
|
ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
String line;
|
} catch (UnknownHostException e) {
|
||||||
while ((line = reader.readLine()) != null) {
|
e.printStackTrace();
|
||||||
System.out.println(line);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
String port = env.getProperty("server.port");
|
||||||
|
String path = env.getProperty("server.servlet.context-path");
|
||||||
|
System.out.println("(♥◠‿◠)ノ゙ 平台PC总后台 启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||||
|
" .-------. ____ __ \n" +
|
||||||
|
" | _ _ \\ \\ \\ / / \n" +
|
||||||
|
" | ( ' ) | \\ _. / ' \n" +
|
||||||
|
" |(_ o _) / _( )_ .' \n" +
|
||||||
|
" | (_,_).' __ ___(_ o _)' \n" +
|
||||||
|
" | |\\ \\ | || |(_,_)' \n" +
|
||||||
|
" | | \\ `' /| `-' / \n" +
|
||||||
|
" | | \\ / \\ / \n" +
|
||||||
|
" ''-' `'-' `-..-' ");
|
||||||
|
log.info("\n----------------------------------------------------------\n\t" +
|
||||||
|
"Application RuoYi is running! Access URLs:\n\t" +
|
||||||
|
"Local: \t\thttp://localhost:" + port + path + "/\n\t" +
|
||||||
|
"External: \thttp://" + ip + ":" + port + path + "/\n\t" +
|
||||||
|
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
|
||||||
|
"----------------------------------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,2 +1,2 @@
|
|||||||
青蛙农业版本: ${ruoyi.version}
|
系统版本: ${ruoyi.version}
|
||||||
SpringBoot版本: ${spring-boot.version}
|
SpringBoot版本: ${spring-boot.version}
|
Loading…
x
Reference in New Issue
Block a user