2025-12-18 15:13:23 +08:00
|
|
|
|
package com.mtkj.mtpay;
|
|
|
|
|
|
|
2025-12-23 16:03:10 +08:00
|
|
|
|
import com.mtkj.mtpay.config.PingPongProperties;
|
2025-12-19 16:52:28 +08:00
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-12-18 15:13:23 +08:00
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2025-12-23 16:03:10 +08:00
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
2025-12-19 16:52:28 +08:00
|
|
|
|
import org.springframework.core.env.Environment;
|
2025-12-18 15:13:23 +08:00
|
|
|
|
|
2025-12-19 16:52:28 +08:00
|
|
|
|
@Slf4j
|
2025-12-18 15:13:23 +08:00
|
|
|
|
@SpringBootApplication
|
2025-12-23 16:03:10 +08:00
|
|
|
|
@EnableConfigurationProperties({PingPongProperties.class})
|
2025-12-18 15:13:23 +08:00
|
|
|
|
public class MtPayApplication {
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
2025-12-19 16:52:28 +08:00
|
|
|
|
try {
|
2025-12-19 18:33:25 +08:00
|
|
|
|
log.info("""
|
|
|
|
|
|
|
|
|
|
|
|
╔══════════════════════════════════════════════════════════╗
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
║ MTKJ PAY 支付系统正在启动... ║
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
╚══════════════════════════════════════════════════════════╝
|
|
|
|
|
|
""");
|
|
|
|
|
|
|
2025-12-19 16:52:28 +08:00
|
|
|
|
SpringApplication app = new SpringApplication(MtPayApplication.class);
|
|
|
|
|
|
Environment env = app.run(args).getEnvironment();
|
|
|
|
|
|
|
|
|
|
|
|
String applicationName = env.getProperty("spring.application.name", "mt-pay");
|
2025-12-19 18:33:25 +08:00
|
|
|
|
String serverPort = env.getProperty("server.port", "8082");
|
2025-12-19 16:52:28 +08:00
|
|
|
|
String contextPath = env.getProperty("server.servlet.context-path", "");
|
|
|
|
|
|
String activeProfiles = String.join(",", env.getActiveProfiles());
|
|
|
|
|
|
|
2025-12-19 18:33:25 +08:00
|
|
|
|
// 构建完整的访问地址
|
|
|
|
|
|
String baseUrl = "http://localhost:" + serverPort + contextPath;
|
|
|
|
|
|
String apiUrl = baseUrl + "/api";
|
|
|
|
|
|
String druidUrl = baseUrl + "/druid";
|
|
|
|
|
|
|
|
|
|
|
|
// 打印醒目的启动成功标识
|
2025-12-19 16:52:28 +08:00
|
|
|
|
log.info("""
|
|
|
|
|
|
|
2025-12-19 18:33:25 +08:00
|
|
|
|
╔══════════════════════════════════════════════════════════╗
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
║ ✅ MTKJ PAY 支付系统启动成功! ✅ ║
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
╠══════════════════════════════════════════════════════════╣
|
|
|
|
|
|
║ 应用信息 ║
|
|
|
|
|
|
╠══════════════════════════════════════════════════════════╣
|
|
|
|
|
|
║ 应用名称: {:<45} ║
|
|
|
|
|
|
║ 运行环境: {:<45} ║
|
|
|
|
|
|
║ 服务端口: {:<45} ║
|
|
|
|
|
|
╠══════════════════════════════════════════════════════════╣
|
|
|
|
|
|
║ 访问地址 ║
|
|
|
|
|
|
╠══════════════════════════════════════════════════════════╣
|
|
|
|
|
|
║ 后端服务: {:<45} ║
|
|
|
|
|
|
║ API接口: {:<45} ║
|
|
|
|
|
|
║ Druid监控: {:<45} ║
|
|
|
|
|
|
╠══════════════════════════════════════════════════════════╣
|
|
|
|
|
|
║ 状态: 🟢 服务运行中,可以接收请求 ║
|
|
|
|
|
|
╚══════════════════════════════════════════════════════════╝
|
2025-12-19 16:52:28 +08:00
|
|
|
|
""",
|
2025-12-19 18:33:25 +08:00
|
|
|
|
applicationName,
|
2025-12-19 16:52:28 +08:00
|
|
|
|
activeProfiles.isEmpty() ? "default" : activeProfiles,
|
2025-12-19 18:33:25 +08:00
|
|
|
|
serverPort,
|
|
|
|
|
|
baseUrl,
|
|
|
|
|
|
apiUrl,
|
|
|
|
|
|
druidUrl);
|
|
|
|
|
|
|
|
|
|
|
|
// 额外提示信息
|
|
|
|
|
|
log.info("""
|
|
|
|
|
|
|
|
|
|
|
|
📌 提示:
|
|
|
|
|
|
- 前端代理地址: http://localhost:3000
|
|
|
|
|
|
- 后端API地址: {}
|
|
|
|
|
|
- 图片上传接口: {}/product/upload/image
|
|
|
|
|
|
- 商品管理接口: {}/product
|
|
|
|
|
|
""", apiUrl, apiUrl, apiUrl);
|
|
|
|
|
|
|
2025-12-19 16:52:28 +08:00
|
|
|
|
} catch (Exception e) {
|
2025-12-19 18:33:25 +08:00
|
|
|
|
log.error("""
|
|
|
|
|
|
|
|
|
|
|
|
╔══════════════════════════════════════════════════════════╗
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
║ ❌ MTKJ PAY 支付系统启动失败! ❌ ║
|
|
|
|
|
|
║ ║
|
|
|
|
|
|
╚══════════════════════════════════════════════════════════╝
|
|
|
|
|
|
""", e);
|
2025-12-19 16:52:28 +08:00
|
|
|
|
throw e;
|
|
|
|
|
|
}
|
2025-12-18 15:13:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|