30 lines
867 B
TypeScript
30 lines
867 B
TypeScript
import { Controller, Get, Query } from '@nestjs/common';
|
|
import { AuditService } from './audit.service';
|
|
|
|
@Controller('audit-logs')
|
|
export class AuditController {
|
|
constructor(private readonly service: AuditService) {}
|
|
|
|
@Get()
|
|
getTenantAuditLogs(
|
|
@Query('tenantId') tenantId?: string,
|
|
@Query('userId') userId?: string,
|
|
@Query('entity') entity?: string,
|
|
@Query('action') action?: string,
|
|
@Query('page') page?: number,
|
|
@Query('limit') limit?: number,
|
|
) {
|
|
return this.service.getTenantAuditLogs({ tenantId, userId, entity, action, page, limit });
|
|
}
|
|
|
|
@Get('platform')
|
|
getPlatformAuditLogs(
|
|
@Query('adminId') adminId?: string,
|
|
@Query('action') action?: string,
|
|
@Query('page') page?: number,
|
|
@Query('limit') limit?: number,
|
|
) {
|
|
return this.service.getPlatformAuditLogs({ adminId, action, page, limit });
|
|
}
|
|
}
|