feat: 支持上课统计功能;优化会员管理默认筛选状态
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user