Spaces:
Sleeping
Sleeping
File size: 960 Bytes
525d39f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { Controller, Get, Param, Query } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { StatsService } from './stats.service';
import { StatsQueryDto } from './dto/stats-query.dto';
@ApiTags('Statistics')
@Controller('stats')
export class StatsController {
constructor(private readonly statsService: StatsService) {}
@Get('overview')
@ApiOperation({ summary: 'Get overall statistics' })
async getOverview() {
return this.statsService.getOverview();
}
@Get('messages')
@ApiOperation({ summary: 'Get message statistics with time series' })
async getMessageStats(@Query() query: StatsQueryDto) {
return this.statsService.getMessageStats(query.period || '24h');
}
@Get('sessions/:sessionId')
@ApiOperation({ summary: 'Get statistics for a specific session' })
async getSessionStats(@Param('sessionId') sessionId: string) {
return this.statsService.getSessionStats(sessionId);
}
}
|