YouJiaApplication.java
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.youjia;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.net.InetAddress;
/**
* 优加系统启动类。
*
* <p>业务主线:导入门店信息 → 单级审批 → 门店列表展示;权限基座:RBAC0 + 组织数据域。</p>
*/
@Slf4j
@EnableDiscoveryClient
@EnableTransactionManagement
@SpringBootApplication
public class YouJiaApplication {
public static void main(String[] args) {
Environment env = SpringApplication.run(YouJiaApplication.class, args).getEnvironment();
String port = env.getProperty("server.port", "8080");
String contextPath = env.getProperty("server.servlet.context-path", "");
try {
String host = InetAddress.getLocalHost().getHostAddress();
log.info("""
----------------------------------------------------------
优加系统启动成功
本地访问: http://localhost:{}{}
外部访问: http://{}:{}{}
接口文档: http://localhost:{}{}/doc.html
当前环境: {}
----------------------------------------------------------""",
port, contextPath, host, port, contextPath, port, contextPath,
String.join(",", env.getActiveProfiles()));
} catch (Exception e) {
log.info("优加系统启动成功,端口 {}", port);
}
}
}