package com.battery.business.web; import java.time.Instant; import com.battery.business.service.DashboardService; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; /** 首页查询使用独立查看权限,不借用用户管理和测试编辑权限。 */ @RestController @RequestMapping("/system/dashboard") public class DashboardController extends BaseController { private final DashboardService service; public DashboardController(DashboardService service) { this.service = service; } /** 汇总当前测试、检测柜和开放异常;个人待办通过自己的负责人接口读取。 */ @GetMapping @PreAuthorize("@ss.hasAnyPermi('dashboard:workbench:list,dashboard:workbench:query')") public AjaxResult get() { return success(service.read(Instant.now())); } }