51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
package com.designhub.controller;
|
|
|
|
import com.designhub.common.Result;
|
|
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.time.LocalDateTime;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 测试控制器
|
|
*/
|
|
@Tag(name = "测试接口", description = "用于测试系统是否正常运行")
|
|
@RestController
|
|
@RequestMapping("/hello")
|
|
public class HelloController {
|
|
|
|
@Operation(summary = "Hello World", description = "测试接口是否可访问")
|
|
@GetMapping
|
|
public Result<String> hello() {
|
|
return Result.success("Hello, DesignHub! 系统运行正常 ✅");
|
|
}
|
|
|
|
@Operation(summary = "系统信息", description = "获取系统基本信息")
|
|
@GetMapping("/info")
|
|
public Result<Map<String, Object>> info() {
|
|
Map<String, Object> info = new HashMap<>();
|
|
info.put("name", "DesignHub - 设计师任务管理平台");
|
|
info.put("version", "1.0.0");
|
|
info.put("time", LocalDateTime.now());
|
|
info.put("status", "running");
|
|
info.put("description", "基于 Spring Boot 3.x + Vue 3 开发");
|
|
return Result.success(info);
|
|
}
|
|
|
|
@Operation(summary = "健康检查", description = "检查系统健康状态")
|
|
@GetMapping("/health")
|
|
public Result<Map<String, String>> health() {
|
|
Map<String, String> health = new HashMap<>();
|
|
health.put("status", "UP");
|
|
health.put("database", "OK");
|
|
health.put("api", "OK");
|
|
return Result.success(health);
|
|
}
|
|
}
|
|
|