Skip to content

Commit d6f2a2c

Browse files
authored
[25.02.07 / TASK-111] Feature - post 모델링 업데이트, 대응 개발 - slug 값 추가 (#16)
* feature: post 모델링 업데이트, 대응 개발 - slug 값 추가 * modify: swagger 쪽 타입 명시 대응 개발 * modify: swagger 쪽 타입 명시 대응 개발, 이상한거 바꿔서 롤백
1 parent 36c158d commit d6f2a2c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/repositories/post.repository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class PostRepository {
5252
SELECT
5353
p.id,
5454
p.title,
55+
p.slug,
5556
p.created_at AS post_created_at,
5657
p.released_at AS post_released_at,
5758
COALESCE(pds.daily_view_count, 0) AS daily_view_count,

src/services/post.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class PostService {
1212
const transformedPosts = result.posts.map((post) => ({
1313
id: post.id,
1414
title: post.title,
15+
slug: post.slug,
1516
views: post.daily_view_count,
1617
likes: post.daily_like_count,
1718
yesterdayViews: post.yesterday_daily_view_count,

src/types/dto/responses/postResponse.type.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import { BaseResponseDto } from '@/types/dto/responses/baseResponse.type';
1313
* description: 게시물 ID
1414
* title:
1515
* type: string
16-
* description: 게시물 제목`
16+
* description: 게시물 제목
17+
* slug:
18+
* type: string
19+
* description: 게시물 url slug 값
1720
* views:
1821
* type: integer
1922
* description: 총 조회수
@@ -38,6 +41,7 @@ import { BaseResponseDto } from '@/types/dto/responses/baseResponse.type';
3841
interface GetAllPostType {
3942
id: number;
4043
title: string;
44+
slug: string;
4145
views: number;
4246
likes: number;
4347
yesterdayViews: number;

0 commit comments

Comments
 (0)