english-back/src/progress/progress.controller.ts
hyoseung930 2549334adb
Some checks are pending
Build and Deploy / build-and-deploy (push) Waiting to run
feat: XP/레벨/뱃지/콤보 시스템 + Progress 모듈 + 오늘의단어10개 + 퀴즈 난이도/학습단어기반
2026-05-14 13:12:47 +09:00

33 lines
1.2 KiB
TypeScript

import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { ProgressService } from './progress.service';
@Controller('progress')
export class ProgressController {
constructor(private readonly service: ProgressService) {}
@Get('stats')
getStats(@Query('session') session: string) {
return this.service.getStats(session || 'default');
}
@Post('word')
recordWord(@Body() body: { session_id: string; word_id: number }) {
return this.service.recordWordStudied(body.session_id, body.word_id);
}
@Post('quiz-answer')
recordAnswer(@Body() body: { session_id: string; word_id: number; is_correct: boolean; word?: { english: string; korean: string } }) {
return this.service.recordQuizAnswer(body.session_id, body.word_id, body.is_correct, body.word);
}
@Post('quiz-complete')
recordComplete(@Body() body: { session_id: string; score: number; total: number }) {
return this.service.recordQuizComplete(body.session_id, body.score, body.total);
}
@Get('studied-words')
getStudiedWords(@Query('session') session: string, @Query('date') date?: string) {
return this.service.getStudiedWordIds(session || 'default', date);
}
}