Skip to content

Commit d020987

Browse files
committed
feat: 좋아요 리스트 조회 응답값 변경
1 parent 939a456 commit d020987

4 files changed

+16
-15
lines changed

src/post-like/dtos/get-post-like.response.dto.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class GetPostLikesResponseDto {
88
example: 2,
99
description: '전체 좋아요 개수',
1010
})
11-
totalLikes: number;
11+
totalCount: number;
1212

1313
@ApiProperty({
1414
example: [
@@ -43,7 +43,7 @@ export class GetPostLikesResponseDto {
4343
meta: PageMetaDto; // 페이지 메타 정보 추가
4444

4545
constructor(totalLikes: number, likes: any[], meta: PageMetaDto) {
46-
this.totalLikes = totalLikes;
46+
this.totalCount = totalLikes;
4747
this.likes = likes;
4848
this.meta = meta;
4949
}

src/post-like/post-like.controller.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
CreatePostLikeSwagger,
1313
GetPostLikesSwagger,
1414
} from './post-like.swagger';
15-
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
15+
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
1616
import { PostLikeResponseDto } from './dtos/post-like.response';
1717
import { BaseResponse } from 'src/common/response/dto';
1818
import { GetPostLikesResponseDto } from './dtos/get-post-like.response.dto';
@@ -31,17 +31,6 @@ export class PostLikeController {
3131
private readonly postService: PostService,
3232
) {}
3333

34-
@ApiQuery({
35-
name: 'page',
36-
required: false,
37-
description: '페이지 번호',
38-
type: Number,
39-
})
40-
@ApiQuery({
41-
name: 'take',
42-
required: false,
43-
description: '한 페이지에 불러올 데이터 개수',
44-
})
4534
@Get(':postId')
4635
@GetPostLikesSwagger('게시글 좋아요 리스트 조회 API')
4736
async getPostLikes(

src/post-like/post-like.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class PostLikeService {
6767
});
6868

6969
return {
70-
totalLikes: totalLikes,
70+
totalCount: totalLikes,
7171
likes: likes,
7272
meta: meta, // 페이지 메타 정보 반환
7373
};

src/post-like/post-like.swagger.ts

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ApiInternalServerErrorResponse,
66
ApiOperation,
77
ApiParam,
8+
ApiQuery,
89
ApiResponse,
910
ApiUnauthorizedResponse,
1011
} from '@nestjs/swagger';
@@ -39,6 +40,17 @@ export function GetPostLikesSwagger(apiSummary: string) {
3940
description: '서버 오류입니다.',
4041
type: BaseResponse,
4142
}),
43+
ApiQuery({
44+
name: 'page',
45+
required: false,
46+
description: '페이지 번호',
47+
type: Number,
48+
}),
49+
ApiQuery({
50+
name: 'take',
51+
required: false,
52+
description: '한 페이지에 불러올 데이터 개수',
53+
}),
4254
],
4355
);
4456
}

0 commit comments

Comments
 (0)