-
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
#92 [refactor] GET - 임시저장된 글 조회 시 글감 리스트 반환
- Loading branch information
Showing
4 changed files
with
45 additions
and
7 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
13 changes: 7 additions & 6 deletions
13
module-domain/src/main/java/com/mile/post/service/dto/TemporaryPostGetResponse.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 |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package com.mile.post.service.dto; | ||
|
||
import com.mile.moim.domain.Moim; | ||
import com.mile.post.domain.Post; | ||
import com.mile.utils.DateUtil; | ||
import com.mile.topic.service.dto.ContentWithIsSelectedResponse; | ||
import java.util.List; | ||
|
||
|
||
public record TemporaryPostGetResponse( | ||
TemporaryPostTopicGetResponse topic, | ||
List<ContentWithIsSelectedResponse> topicList, | ||
String title, | ||
String content, | ||
String imageUrl, | ||
boolean anonymous | ||
) { | ||
public static TemporaryPostGetResponse of(Post post) { | ||
|
||
public static TemporaryPostGetResponse of(Post post, List<ContentWithIsSelectedResponse> contentResponse) { | ||
return new TemporaryPostGetResponse( | ||
TemporaryPostTopicGetResponse.of(post.getTopic()), | ||
contentResponse, | ||
post.getTitle(), | ||
post.getContent(), | ||
post.getImageUrl(), | ||
post.isAnonymous() | ||
); | ||
} | ||
|
||
|
||
} |
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
17 changes: 17 additions & 0 deletions
17
module-domain/src/main/java/com/mile/topic/service/dto/ContentWithIsSelectedResponse.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,17 @@ | ||
package com.mile.topic.service.dto; | ||
|
||
import com.mile.topic.domain.Topic; | ||
|
||
public record ContentWithIsSelectedResponse( | ||
Long topicid, | ||
String topicName, | ||
boolean isSelected | ||
) { | ||
public static ContentWithIsSelectedResponse of( | ||
final Topic topic, | ||
final boolean isSelected | ||
) { | ||
return new ContentWithIsSelectedResponse(topic.getId(), topic.getContent(), isSelected); | ||
} | ||
} | ||
|