import { Controller, Get, UseGuards, Req } from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { AuthGuard } from '@nestjs/passport';
import { LearningService } from './learning.service';

@ApiTags('学习分析')
@Controller('learning')
@UseGuards(AuthGuard('jwt'))
@ApiBearerAuth()
export class LearningController {
  constructor(private learningService: LearningService) {}

  @Get('analytics')
  async getAnalytics(@Req() req: any) {
    return this.learningService.getAnalytics(req.user.userId);
  }

  @Get('path')
  async getLearningPath(@Req() req: any) {
    return this.learningService.getLearningPath(req.user.userId);
  }
}
