Skip to content

Commit 5804091

Browse files
committed
Feat: 썸네일 DTO 및 Swagger 문서 추가 수정
1 parent 000fa8a commit 5804091

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/main/java/com/back/domain/board/post/controller/PostControllerDocs.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public interface PostControllerDocs {
4848
},
4949
"title": "첫 번째 게시글",
5050
"content": "안녕하세요, 첫 글입니다!",
51+
"thumbnailUrl": null,
5152
"categories": [
5253
{ "id": 1, "name": "공지사항" },
5354
{ "id": 2, "name": "자유게시판" }
@@ -174,6 +175,7 @@ ResponseEntity<RsData<PostResponse>> createPost(
174175
"postId": 1,
175176
"author": { "id": 10, "nickname": "홍길동", "profileImageUrl": null },
176177
"title": "첫 글",
178+
"thumbnailUrl": null,
177179
"categories": [{ "id": 1, "name": "공지사항" }],
178180
"likeCount": 5,
179181
"bookmarkCount": 2,
@@ -251,6 +253,7 @@ ResponseEntity<RsData<PageResponse<PostListResponse>>> getPosts(
251253
"author": { "id": 5, "nickname": "홍길동", "profileImageUrl": null },
252254
"title": "첫 번째 게시글",
253255
"content": "안녕하세요, 첫 글입니다!",
256+
"thumbnailUrl": null,
254257
"categories": [
255258
{ "id": 1, "name": "공지사항" },
256259
{ "id": 2, "name": "자유게시판" }
@@ -327,6 +330,7 @@ ResponseEntity<RsData<PostDetailResponse>> getPost(
327330
},
328331
"title": "수정된 게시글",
329332
"content": "안녕하세요, 수정했습니다!",
333+
"thumbnailUrl": null,
330334
"categories": [
331335
{ "id": 1, "name": "공지사항" },
332336
{ "id": 2, "name": "자유게시판" }

src/main/java/com/back/domain/board/post/dto/PostDetailResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* @param author 작성자 정보
1414
* @param title 게시글 제목
1515
* @param content 게시글 내용
16+
* @param thumbnailUrl 썸네일 URL
1617
* @param categories 게시글 카테고리 목록
1718
* @param likeCount 좋아요 수
1819
* @param bookmarkCount 북마크 수
@@ -25,6 +26,7 @@ public record PostDetailResponse(
2526
AuthorResponse author,
2627
String title,
2728
String content,
29+
String thumbnailUrl,
2830
List<CategoryResponse> categories,
2931
long likeCount,
3032
long bookmarkCount,
@@ -44,6 +46,7 @@ public static PostDetailResponse from(Post post, boolean likedByMe, boolean book
4446
AuthorResponse.from(post.getUser()),
4547
post.getTitle(),
4648
post.getContent(),
49+
post.getThumbnailUrl(),
4750
post.getCategories().stream()
4851
.map(CategoryResponse::from)
4952
.toList(),

src/main/java/com/back/domain/board/post/dto/PostResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* @param author 작성자 정보
1313
* @param title 게시글 제목
1414
* @param content 게시글 내용
15+
* @param thumbnailUrl 썸네일 URL
1516
* @param categories 게시글 카테고리 목록
1617
* @param createdAt 게시글 생성 일시
1718
* @param updatedAt 게시글 수정 일시
@@ -21,6 +22,7 @@ public record PostResponse(
2122
AuthorResponse author,
2223
String title,
2324
String content,
25+
String thumbnailUrl,
2426
List<CategoryResponse> categories,
2527
LocalDateTime createdAt,
2628
LocalDateTime updatedAt
@@ -31,6 +33,7 @@ public static PostResponse from(Post post) {
3133
AuthorResponse.from(post.getUser()),
3234
post.getTitle(),
3335
post.getContent(),
36+
post.getThumbnailUrl(),
3437
post.getCategories().stream()
3538
.map(CategoryResponse::from)
3639
.toList(),

0 commit comments

Comments
 (0)