28 行
960 B
Java
28 行
960 B
Java
|
|
package com.xuqm.tenant.controller;
|
||
|
|
|
||
|
|
import com.xuqm.common.model.ApiResponse;
|
||
|
|
import com.xuqm.tenant.service.DashboardService;
|
||
|
|
import org.springframework.http.ResponseEntity;
|
||
|
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/api/dashboard")
|
||
|
|
public class DashboardController {
|
||
|
|
|
||
|
|
private final DashboardService dashboardService;
|
||
|
|
|
||
|
|
public DashboardController(DashboardService dashboardService) {
|
||
|
|
this.dashboardService = dashboardService;
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/stats")
|
||
|
|
public ResponseEntity<ApiResponse<Map<String, Object>>> stats(@AuthenticationPrincipal String tenantId) {
|
||
|
|
return ResponseEntity.ok(ApiResponse.success(dashboardService.stats(tenantId)));
|
||
|
|
}
|
||
|
|
}
|