qiangdanxitong/backend/src/main/java/com/designhub/controller/SystemHealthController.java

31 lines
1.0 KiB
Java

package com.designhub.controller;
import com.designhub.common.Result;
import com.designhub.service.SystemHealthService;
import com.designhub.vo.SystemHealthVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 系统健康检查控制器
*/
@Tag(name = "系统健康", description = "系统自检与健康检查接口")
@RestController
@RequestMapping("/api/system")
@RequiredArgsConstructor
public class SystemHealthController {
private final SystemHealthService systemHealthService;
@Operation(summary = "健康检查", description = "用于部署后快速检测数据库与关键表状态")
@GetMapping("/health")
public Result<SystemHealthVO> health() {
return Result.success(systemHealthService.check());
}
}