Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] #37 편지 조회 API 간 LetterResponseDTO 값 추가 (door, color, decoration) #50

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading