-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] - 자신이 좋아요를 누른 게시글을 조회하는 기능 구현 (#540)
* feat: 내가 좋아요 한 여행기 조회 기능 구현 * test: 내가 좋아요 한 여행기 조회 테스트 코드 추가 * refactor: 다른 dto 와 형식 통일
- Loading branch information
1 parent
c0d4c0b
commit ff555a3
Showing
7 changed files
with
116 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
backend/src/main/java/kr/touroot/member/dto/response/MyLikeTravelogueResponse.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,31 @@ | ||
package kr.touroot.member.dto.response; | ||
|
||
import java.time.format.DateTimeFormatter; | ||
import kr.touroot.travelogue.domain.Travelogue; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record MyLikeTravelogueResponse( | ||
long id, | ||
String title, | ||
String thumbnailUrl, | ||
String createdAt, | ||
String authorName, | ||
String authorProfileImageUrl | ||
) { | ||
|
||
public static MyLikeTravelogueResponse from(Travelogue travelogue) { | ||
String createdAt = travelogue.getCreatedAt() | ||
.toLocalDate() | ||
.format(DateTimeFormatter.ofPattern("yyyy.MM.dd")); | ||
|
||
return MyLikeTravelogueResponse.builder() | ||
.id(travelogue.getId()) | ||
.title(travelogue.getTitle()) | ||
.thumbnailUrl(travelogue.getThumbnail()) | ||
.createdAt(createdAt) | ||
.authorName(travelogue.getAuthorNickname()) | ||
.authorProfileImageUrl(travelogue.getAuthorProfileImageUrl()) | ||
.build(); | ||
} | ||
} |
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