import { Controller , Get , UseGuards , Param , Query , UseInterceptors } from "@nestjs/common" ; import { AuthGuard } from "@nestjs/passport" ; import { ResultList , NullableParseIntPipe , RolesGuard , LoggingInterceptor } from "nestx-common" ; import { LogsService } from "./logs.service" ; import { Log } from "./../interfaces" ; import { Tags } from "nest-swagger" ; @ Tags ( "core" ) @ Controller ( "log" ) @ UseGuards ( AuthGuard ( "jwt" ) , RolesGuard ) @ UseInterceptors ( LoggingInterceptor ) export class LogsController { constructor ( private readonly logService ) { } @ Get ( "query" ) async query ( @ Query ( "keyword" ) keyword ? , @ Query ( "page" , new NullableParseIntPipe ( ) ) page = 1 , @ Query ( "size" , new NullableParseIntPipe ( ) ) size = 10 , @ Query ( "sort" ) sort ? ) { return this . logService . querySearch ( keyword , page , size , sort ) ; } @ Get ( ":id" ) async findOne ( @ Param ( "id" ) id ) { return this . logService . findById ( id ) ; } }