forked from wangziqi/gongxue-base
新增考试归档与恢复功能
This commit is contained in:
@@ -71,6 +71,48 @@ export class ExamsController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Put(':id/archive')
|
||||
@RequirePermission('exam:view')
|
||||
async archive(
|
||||
@Param('id', ParseIntPipe) id: number,
|
||||
@Request() req: AuthenticatedRequest,
|
||||
) {
|
||||
const result = await this.service.archive(id, req.user.id, this.canManageAll(req));
|
||||
const { ipAddress, userAgent } = extractRequestInfo(req);
|
||||
await this.logService.log({
|
||||
userId: req.user.id,
|
||||
username: req.user.username,
|
||||
module: '考试管理',
|
||||
action: '归档考试',
|
||||
targetId: id,
|
||||
targetType: 'exam',
|
||||
ipAddress,
|
||||
userAgent,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Put(':id/restore')
|
||||
@RequirePermission('exam:view')
|
||||
async restore(
|
||||
@Param('id', ParseIntPipe) id: number,
|
||||
@Request() req: AuthenticatedRequest,
|
||||
) {
|
||||
const result = await this.service.restore(id, req.user.id, this.canManageAll(req));
|
||||
const { ipAddress, userAgent } = extractRequestInfo(req);
|
||||
await this.logService.log({
|
||||
userId: req.user.id,
|
||||
username: req.user.username,
|
||||
module: '考试管理',
|
||||
action: '恢复考试',
|
||||
targetId: id,
|
||||
targetType: 'exam',
|
||||
ipAddress,
|
||||
userAgent,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Put(':examId/scores/:scoreId')
|
||||
@RequirePermission('exam:view')
|
||||
async updateScore(
|
||||
@@ -100,5 +142,4 @@ export class ExamsController {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user