From 67952af52ec32888087e2764c18c1642a307d50e Mon Sep 17 00:00:00 2001 From: wangziqi Date: Mon, 6 Jul 2026 18:00:46 +0800 Subject: [PATCH] feat(archive): log PDF report generation in operation logs --- apps/server/src/archive/archive.controller.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/server/src/archive/archive.controller.ts b/apps/server/src/archive/archive.controller.ts index e1d7079..68f198e 100644 --- a/apps/server/src/archive/archive.controller.ts +++ b/apps/server/src/archive/archive.controller.ts @@ -345,7 +345,19 @@ export class ArchiveController { async generateReport( @Param('studentId') studentId: string, @Res() res: Response, + @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', + targetId: +studentId, + targetType: 'student', + ipAddress, + userAgent, + }); return this.reportService.generateReport(+studentId, res); } }