Skip to content

Commit

Permalink
DTO 이름 변경 및 response select 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gidskql6671 committed Dec 12, 2023
1 parent 8e364d0 commit e6b632e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/admins/admins.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Controller, Get, Query } from '@nestjs/common';
import { AdminsService } from './admins.service';
import { ApiTags } from '@nestjs/swagger';
import { LoggingService } from '../logging/logging.service';
import { GetLogsDto } from './dto/getLogs.dto';
import { GetLogsRequestDto } from './dto/getLogsRequest.dto';

@ApiTags('Admins')
@Controller('api/admins')
Expand Down Expand Up @@ -41,7 +41,7 @@ export class AdminsController {
}

@Get('logs')
getLogs(@Query() req: GetLogsDto) {
getLogs(@Query() req: GetLogsRequestDto) {
return this.loggingService.getLogs(req);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsOptional, Max, Min } from 'class-validator';

export class GetLogsDto {
export class GetLogsRequestDto {
@ApiProperty({
required: false,
description: '한 페이지 당 로그 수',
Expand Down
1 change: 1 addition & 0 deletions src/logging/logging.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class LoggingService implements LoggerService {
sort: { timestamp: -1 }, // 최신 순 정렬
limit, // 개수 제한
page, // 페이지 번호
select: 'message timestamp level',
},
);
}
Expand Down

0 comments on commit e6b632e

Please sign in to comment.