feat: add GET /archive/:studentId/report-html endpoint

This commit is contained in:
2026-07-07 09:50:05 +08:00
parent 9f43f50867
commit 36978813cf
2 changed files with 48 additions and 0 deletions

View File

@@ -360,4 +360,25 @@ export class ArchiveController {
});
return this.reportService.generateReport(+studentId, res);
}
@Get(':studentId/report-html')
@RequirePermission('student:view')
async generateReportHtml(
@Param('studentId') studentId: string,
@Request() req: AuthenticatedRequest,
) {
const { ipAddress, userAgent } = extractRequestInfo(req);
await this.logService.log({
userId: req.user?.id,
username: req.user?.username,
module: 'archive',
action: 'generate_report_html',
targetId: +studentId,
targetType: 'student',
ipAddress,
userAgent,
});
const html = await this.reportService.generateReportHtml(+studentId);
return { html };
}
}