feat: add logging functionality with LoggerService; implement log entity and controller; enhance query processing with logging support

This commit is contained in:
lborv
2025-10-11 16:21:03 +03:00
parent 323fc6e817
commit 57e4a8b932
19 changed files with 328 additions and 24 deletions

View File

@ -0,0 +1,32 @@
import { Body, Controller, Get, Inject, Post, UseGuards } from "@nestjs/common";
import { LoggerService } from "./logger.service";
import { ApiTokenGuard } from "src/api/guards/api-token.guard";
@Controller("logger")
@UseGuards(ApiTokenGuard)
export class LoggerController {
constructor(
@Inject(LoggerService)
private readonly loggerService: LoggerService
) {}
@Get("/:traceId")
getByTraceId(@Inject("traceId") traceId: string) {
return this.loggerService.findByTraceId(traceId);
}
@Post("/find")
find(
@Body()
body: {
traceId?: string;
fromDate?: Date;
toDate?: Date;
url?: string;
limit: number;
offset: number;
}
) {
return this.loggerService.find(body);
}
}