package com.zioinfo.esn.controller;

import com.zioinfo.esn.common.ApiResponse;
import com.zioinfo.esn.domain.DashboardVo;
import com.zioinfo.esn.mapper.DashboardMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/dashboard")
@RequiredArgsConstructor
public class DashboardController {
    private final DashboardMapper mapper;

    @GetMapping
    public ApiResponse<DashboardVo> summary(@RequestParam(required = false) String tenantCode) {
        return ApiResponse.ok(mapper.getSummary(tenantCode));
    }
}
