-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from UniBond-jijijin/feature/56-get-liked-letter
[feature/56-get-liked-letter] 즐겨찾기 한 편지들 조회
- Loading branch information
Showing
15 changed files
with
459 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
unibond/src/main/java/com/unibond/unibond/letter_room/dto/GetAllLikedLetterResDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.unibond.unibond.letter_room.dto; | ||
|
||
import com.unibond.unibond.common.PageInfo; | ||
import com.unibond.unibond.letter.domain.Letter; | ||
import com.unibond.unibond.member.domain.Member; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.domain.Page; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class GetAllLikedLetterResDto { | ||
private PageInfo pageInfo; | ||
private List<LikedLetterPreviewDto> likedLetterList; | ||
|
||
public GetAllLikedLetterResDto(Page<Letter> letterPage) { | ||
this.pageInfo = new PageInfo(letterPage); | ||
this.likedLetterList = letterPage.getContent().stream().map( | ||
LikedLetterPreviewDto::new | ||
).collect(Collectors.toList()); | ||
} | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
private class LikedLetterPreviewDto { | ||
private String senderImg; | ||
private LocalDateTime sentDate; | ||
private String letterTitle; | ||
private String senderName; | ||
|
||
public LikedLetterPreviewDto(Letter letter) { | ||
Member sender = letter.getSender(); | ||
this.senderImg = sender.getProfileImage(); | ||
this.sentDate = letter.getCreatedDate(); | ||
this.letterTitle = letter.getTitle(); | ||
this.senderName = sender.getNickname(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.