import { Controller, Get, Query } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { AuthUser, CurrentUser } from '../../common/current-user.decorator';
import { RequirePermissions } from '../../common/permissions.decorator';
import { DashboardService } from './dashboard.service';

@ApiBearerAuth()
@ApiTags('数据看板')
@RequirePermissions('dashboard:view')
@Controller('dashboard')
export class DashboardController {
  constructor(private readonly dashboardService: DashboardService) {}

  @Get('summary')
  summary(@CurrentUser() user: AuthUser, @Query() query: any) {
    return this.dashboardService.summary(user, query);
  }
}
