feat: 支持上课统计功能;优化会员管理默认筛选状态

This commit is contained in:
richarjiang
2026-09-09 10:04:29 +08:00
parent 30ebc1c344
commit 99c5c211ad
17 changed files with 594 additions and 20 deletions

View File

@@ -1,4 +1,5 @@
import { Controller, Get, UseGuards } from '@nestjs/common'
import { TeachingAnalyticsService } from './teaching-analytics.service'
import { Controller, Get, Query, UseGuards } from '@nestjs/common'
import { JwtAuthGuard } from '../auth/jwt-auth.guard'
import { Roles } from '../auth/roles.decorator'
import { RolesGuard } from '../auth/roles.guard'
@@ -15,7 +16,12 @@ interface AdminStats {
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(UserRole.ADMIN)
export class AdminController {
constructor(private readonly prisma: PrismaService) {}
constructor(private readonly prisma: PrismaService, private readonly analytics: TeachingAnalyticsService) {}
@Get('teaching-analytics')
getTeachingAnalytics(@Query('month') month: string) {
return this.analytics.getMonthly(month)
}
@Get('stats')
async getStats(): Promise<AdminStats> {