25 lines
692 B
TypeScript
25 lines
692 B
TypeScript
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { TenantId } from '../common/tenant-id.decorator';
|
|
import { AuditService, CreateOperationLogDto } from './audit.service';
|
|
|
|
@ApiTags('audit')
|
|
@Controller('admin/operation-logs')
|
|
export class AuditController {
|
|
constructor(private readonly audit: AuditService) {}
|
|
|
|
@Get()
|
|
list(
|
|
@TenantId() tenantId?: string,
|
|
@Query('page') page?: string,
|
|
@Query('pageSize') pageSize?: string,
|
|
) {
|
|
return this.audit.list(tenantId, Number(page), Number(pageSize));
|
|
}
|
|
|
|
@Post()
|
|
create(@Body() body: CreateOperationLogDto) {
|
|
return this.audit.create(body);
|
|
}
|
|
}
|