-
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
#71 [feat] GET - 임시저장글 조회
- Loading branch information
Showing
7 changed files
with
82 additions
and
1 deletion.
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
25 changes: 25 additions & 0 deletions
25
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.mile.post.service.dto; | ||
|
||
import com.mile.moim.domain.Moim; | ||
import com.mile.post.domain.Post; | ||
import com.mile.utils.DateUtil; | ||
|
||
|
||
public record TemporaryPostGetResponse( | ||
TemporaryPostTopicGetResponse topic, | ||
String title, | ||
String content, | ||
String imageUrl, | ||
boolean anonymous | ||
) { | ||
public static TemporaryPostGetResponse of(Post post) { | ||
|
||
return new TemporaryPostGetResponse( | ||
TemporaryPostTopicGetResponse.of(post.getTopic()), | ||
post.getTitle(), | ||
post.getContent(), | ||
post.getImageUrl(), | ||
post.isAnonymous() | ||
); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
module-domain/src/main/java/com/mile/post/service/dto/TemporaryPostTopicGetResponse.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,9 @@ | ||
package com.mile.post.service.dto; | ||
|
||
import com.mile.topic.domain.Topic; | ||
|
||
public record TemporaryPostTopicGetResponse(Long topicId, String topicContent) { | ||
public static TemporaryPostTopicGetResponse of(Topic topic) { | ||
return new TemporaryPostTopicGetResponse(topic.getId(), topic.getContent()); | ||
} | ||
} |