Skip to content

Commit

Permalink
Merge pull request #50 from UMC-Blism/refactor-37-nuchan
Browse files Browse the repository at this point in the history
[fix] #37 편지 조회 API 간 LetterResponseDTO 값 추가 (door, color, decoration)
  • Loading branch information
seungwon7934 authored Dec 22, 2024
2 parents 1691c37 + 5beeb30 commit 2ebb8e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ public ResponseEntity<ApiResponse> 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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
28 changes: 17 additions & 11 deletions src/main/java/com/example/blism/service/LetterService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -78,6 +78,9 @@ public List<LetterResponseDTO> 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())
Expand All @@ -97,6 +100,9 @@ public List<LetterResponseDTO> 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())
Expand Down

0 comments on commit 2ebb8e1

Please sign in to comment.