Files
his/openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java

45 lines
2.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.openhis;
import com.openhis.web.ybmanage.config.YbServiceConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* 启动程序
*
* @author system 1234
*/
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"})
@EnableConfigurationProperties(YbServiceConfig.class)
@EnableAsync
public class OpenHisApplication {
public static void main(String[] args) throws UnknownHostException {
// System.setProperty("spring.devtools.restart.enabled", "false");
// 测试 Instrument 类加载
// try {
// Class.forName("com.openhis.administration.domain.Instrument");
// System.out.println("Instrument class loaded successfully");
// } catch (ClassNotFoundException e) {
// System.err.println("Failed to load Instrument class: " + e.getMessage());
// }
ConfigurableApplicationContext application = SpringApplication.run(OpenHisApplication.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");
System.out.println("\n----------------------------------------------------------\n\t"
+ "Application OpenHis is running! Access URLs:\n\t" + "Local: \t\thttp://localhost:" + port + path
+ "/\n\t" + "External: \thttp://" + ip + ":" + port + path + "/\n"
+ "----------------------------------------------------------");
}
}