package com.ruoyi.safe.controller; import com.ruoyi.framework.web.domain.R; import com.ruoyi.safe.service.SafeDashboardService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * 安全生产-安全数据驾驶舱 */ @RestController @RequestMapping("/safeDashboard") @AllArgsConstructor @Tag(name = "安全生产-安全数据驾驶舱") public class SafeDashboardController { private final SafeDashboardService safeDashboardService; @GetMapping("/getOverview") @Operation(summary = "安全驾驶舱-顶部总览") public R getOverview() { return R.ok(safeDashboardService.getOverview()); } @GetMapping("/getLatestEvents") @Operation(summary = "安全驾驶舱-最新安全动态") public R getLatestEvents(@RequestParam(required = false) Integer limit) { return R.ok(safeDashboardService.getLatestEvents(limit)); } @GetMapping("/getHiddenTypeDistribution") @Operation(summary = "安全驾驶舱-隐患类型分布") public R getHiddenTypeDistribution() { return R.ok(safeDashboardService.getHiddenTypeDistribution()); } @GetMapping("/getHiddenTrend") @Operation(summary = "安全驾驶舱-近6个月隐患趋势") public R getHiddenTrend() { return R.ok(safeDashboardService.getHiddenTrend()); } @GetMapping("/getHazardRiskDistribution") @Operation(summary = "安全驾驶舱-危险源风险等级分布") public R getHazardRiskDistribution() { return R.ok(safeDashboardService.getHazardRiskDistribution()); } @GetMapping("/getHazardTypeRanking") @Operation(summary = "安全驾驶舱-危险源类型排名") public R getHazardTypeRanking(@RequestParam(required = false) Integer limit) { return R.ok(safeDashboardService.getHazardTypeRanking(limit)); } @GetMapping("/getHiddenRectifyRanking") @Operation(summary = "安全驾驶舱-隐患整改责任人排名") public R getHiddenRectifyRanking(@RequestParam(required = false) Integer limit) { return R.ok(safeDashboardService.getHiddenRectifyRanking(limit)); } }