/** * 审计日志查询入口只返回脱敏后的最近记录。 */ import { Controller, Get, UseGuards } from '@nestjs/common'; import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { AdminOnlyMessage } from '../auth/admin-only-message.decorator'; import { AuthGuard } from '../auth/auth.guard'; import { PasswordChangeGuard } from '../auth/password-change.guard'; import { SuperAdminGuard } from '../auth/super-admin.guard'; import { AuditRecordSummary, AuditService } from './audit.service'; @ApiTags('审计日志') @Controller('audit-logs') @UseGuards(AuthGuard, PasswordChangeGuard, SuperAdminGuard) @AdminOnlyMessage('无权限访问审计日志') export class AuditController { constructor(private readonly auditService: AuditService) {} @Get() @ApiOkResponse({ description: '查询最近的脱敏审计记录。' }) async listRecentRecords(): Promise { return this.auditService.getRecentRecords(); } }