-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat] 작성한 게시글미디어 조회 기능 구현
- Loading branch information
Showing
15 changed files
with
200 additions
and
36 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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/leets/xcellentbe/domain/article/dto/ArticlesResponseDto.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,43 @@ | ||
package com.leets.xcellentbe.domain.article.dto; | ||
|
||
import java.util.List; | ||
|
||
import com.leets.xcellentbe.domain.article.domain.Article; | ||
import com.leets.xcellentbe.domain.hashtag.domain.Hashtag; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class ArticlesResponseDto { | ||
private String writer; | ||
private String content; | ||
private Boolean isPinned; | ||
private List<Hashtag> hashtags; | ||
private Article rePost; | ||
private List<String> filePath; | ||
|
||
@Builder | ||
private ArticlesResponseDto(String writer, String content, Boolean isPinned, List<Hashtag> hashtags, | ||
Article rePost, | ||
List<String> filePath) { | ||
this.writer = writer; | ||
this.content = content; | ||
this.isPinned = isPinned; | ||
this.hashtags = hashtags; | ||
this.rePost = rePost; | ||
this.filePath = filePath; | ||
} | ||
|
||
public static ArticlesResponseDto of(Article article, List<String> filePath) { | ||
return ArticlesResponseDto.builder() | ||
.writer(article.getWriter().getUserName()) | ||
.content(article.getContent()) | ||
.hashtags(article.getHashtags()) | ||
.rePost(article.getRePost()) | ||
.filePath(filePath) | ||
.build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/leets/xcellentbe/domain/article/dto/ArticlesWithMediaDto.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,13 @@ | ||
package com.leets.xcellentbe.domain.article.dto; | ||
|
||
import com.leets.xcellentbe.domain.article.domain.Article; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class ArticlesWithMediaDto { | ||
private Article article; | ||
private String filePath; | ||
} |
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.