package com.org.flashsalesystem.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; /** * 测试控制器 * 用于验证应用程序是否正常启动 */ @Tag(name = "系统测试", description = "系统健康检查和测试接口") @RestController @RequestMapping("/test") public class TestController { @Operation(summary = "系统问候", description = "测试系统是否正常运行") @GetMapping("/hello") public Map hello() { Map response = new HashMap<>(); response.put("message", "Hello! 秒杀系统运行正常"); response.put("status", "success"); response.put("timestamp", System.currentTimeMillis()); return response; } @Operation(summary = "健康检查", description = "检查系统健康状态") @GetMapping("/health") public Map health() { Map response = new HashMap<>(); response.put("status", "UP"); response.put("application", "FlashSaleSystem"); response.put("version", "1.0.0"); return response; } }