forked from wangziqi/gongxue-base
feat: add GET /archive/:studentId/report-html endpoint
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user