From 5beeb30a5bff29e32c4dddc99603c45eccd3a660 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Dec 2024 20:27:21 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#37=20=ED=8E=B8=EC=A7=80=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20API=20=EA=B0=84=20LetterResponseDTO=20=EA=B0=92=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(door,=20color,=20decoration)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blism/controller/LetterController.java | 3 ++ .../blism/dto/response/LetterResponseDTO.java | 3 ++ .../example/blism/service/LetterService.java | 28 +++++++++++-------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/example/blism/controller/LetterController.java b/src/main/java/com/example/blism/controller/LetterController.java index f4e7410..83ea8ba 100644 --- a/src/main/java/com/example/blism/controller/LetterController.java +++ b/src/main/java/com/example/blism/controller/LetterController.java @@ -163,6 +163,9 @@ public ResponseEntity getLetters(@PathVariable Long letterId) { .content(letter.getContent()) .photoUrl(letter.getPhotoUrl()) .font(letter.getFont()) + .doorDesign(letter.getDoorNum()) + .colorDesign(letter.getColorNum()) + .decorationDesign(letter.getDecorationNum()) .senderId(letter.getSender().getId()) .senderNickname(letter.getSender().getNickname()) .receiverId(letter.getReceiver().getId()) diff --git a/src/main/java/com/example/blism/dto/response/LetterResponseDTO.java b/src/main/java/com/example/blism/dto/response/LetterResponseDTO.java index 6c665f0..86491b6 100644 --- a/src/main/java/com/example/blism/dto/response/LetterResponseDTO.java +++ b/src/main/java/com/example/blism/dto/response/LetterResponseDTO.java @@ -17,6 +17,9 @@ public class LetterResponseDTO { private String content; private String photoUrl; private Integer font; + private Integer doorDesign; + private Integer colorDesign; + private Integer decorationDesign; private Integer visibility; private LocalDateTime createdAt; } diff --git a/src/main/java/com/example/blism/service/LetterService.java b/src/main/java/com/example/blism/service/LetterService.java index 892decd..9fe87b6 100644 --- a/src/main/java/com/example/blism/service/LetterService.java +++ b/src/main/java/com/example/blism/service/LetterService.java @@ -47,17 +47,17 @@ public String createLetter(MultipartFile image, CreateLetterRequestDTO dto) { String photoUrl = s3Service.upload(image); - Letter letter = Letter.builder() - .sender(sender.get()) - .receiver(receiver.get()) - .mailbox(mailbox.get()) - .doorNum(dto.getDoorDesign()) - .colorNum(dto.getColorDesign()) - .decorationNum(dto.getDecorationDesign()) - .photoUrl(photoUrl) - .content(dto.getContent()) - .font(dto.getFont()) - .visibility(dto.getVisibility()) + Letter letter = Letter.builder() + .sender(sender.get()) + .receiver(receiver.get()) + .mailbox(mailbox.get()) + .doorNum(dto.getDoorDesign()) + .colorNum(dto.getColorDesign()) + .decorationNum(dto.getDecorationDesign()) + .photoUrl(photoUrl) + .content(dto.getContent()) + .font(dto.getFont()) + .visibility(dto.getVisibility()) .build(); letterRepository.save(letter); @@ -78,6 +78,9 @@ public List getSentLetters(Long userId) { .content(letter.getContent()) .photoUrl(letter.getPhotoUrl()) .font(letter.getFont()) + .doorDesign(letter.getDoorNum()) + .colorDesign(letter.getColorNum()) + .decorationDesign(letter.getDecorationNum()) .senderId(letter.getSender().getId()) .senderNickname(letter.getSender().getNickname()) .receiverId(letter.getReceiver().getId()) @@ -97,6 +100,9 @@ public List getReceivedLetters(Long userId) { .content(letter.getContent()) .photoUrl(letter.getPhotoUrl()) .font(letter.getFont()) + .doorDesign(letter.getDoorNum()) + .colorDesign(letter.getColorNum()) + .decorationDesign(letter.getDecorationNum()) .senderId(letter.getSender().getId()) .senderNickname(letter.getSender().getNickname()) .receiverId(letter.getReceiver().getId())