Skip to content

Commit c9bb666

Browse files
committed
Feat: 썸네일 DTO 및 Swagger 문서 추가 수정
1 parent 9494e75 commit c9bb666

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public record PostDetailResponse(
2525
AuthorResponse author,
2626
String title,
2727
String content,
28+
String thumbnailUrl,
2829
List<CategoryResponse> categories,
2930
long likeCount,
3031
long bookmarkCount,
@@ -44,6 +45,7 @@ public static PostDetailResponse from(Post post, boolean likedByMe, boolean book
4445
AuthorResponse.from(post.getUser()),
4546
post.getTitle(),
4647
post.getContent(),
48+
post.getThumbnailUrl(),
4749
post.getCategories().stream()
4850
.map(CategoryResponse::from)
4951
.toList(),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public record PostResponse(
2121
AuthorResponse author,
2222
String title,
2323
String content,
24+
String thumbnailUrl,
2425
List<CategoryResponse> categories,
2526
LocalDateTime createdAt,
2627
LocalDateTime updatedAt
@@ -31,6 +32,7 @@ public static PostResponse from(Post post) {
3132
AuthorResponse.from(post.getUser()),
3233
post.getTitle(),
3334
post.getContent(),
35+
post.getThumbnailUrl(),
3436
post.getCategories().stream()
3537
.map(CategoryResponse::from)
3638
.toList(),

0 commit comments

Comments
 (0)