Spaces:
Sleeping
Sleeping
Download src/modules/stats/stats.controller.ts from jinksQspider/openWa: direct link, hf CLI and curl.
- Browser
- Download file 960 Bytes
-
https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/stats/stats.controller.ts
- Command line
-
hf download hf://spaces/jinksQspider/openWa/src/modules/stats/stats.controller.ts
-
curl -L -o stats.controller.ts https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/stats/stats.controller.ts
960 Bytes
| 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'; | |
| ('Statistics') | |
| ('stats') | |
| export class StatsController { | |
| constructor(private readonly statsService: StatsService) {} | |
| ('overview') | |
| ({ summary: 'Get overall statistics' }) | |
| async getOverview() { | |
| return this.statsService.getOverview(); | |
| } | |
| ('messages') | |
| ({ summary: 'Get message statistics with time series' }) | |
| async getMessageStats(() query: StatsQueryDto) { | |
| return this.statsService.getMessageStats(query.period || '24h'); | |
| } | |
| ('sessions/:sessionId') | |
| ({ summary: 'Get statistics for a specific session' }) | |
| async getSessionStats(('sessionId') sessionId: string) { | |
| return this.statsService.getSessionStats(sessionId); | |
| } | |
| } | |