forked from CSID-DGU/2024-2-OSSProj-Running-Machines-04
-
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.
- Loading branch information
1 parent
1fb43c5
commit 6d5a548
Showing
4 changed files
with
80 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
24 changes: 24 additions & 0 deletions
24
.../main/java/RunningMachines/R2R/domain/crew/post/notice/dto/CrewMainNoticeResponseDto.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,24 @@ | ||
package RunningMachines.R2R.domain.crew.post.notice.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class CrewMainNoticeResponseDto { | ||
private String crewTitle; | ||
private int postCount; | ||
private int memberCount; | ||
private List<NoticePostSimpleResponseDto> noticePost; | ||
|
||
public static CrewMainNoticeResponseDto of(String crewTitle, int postCount, int memberCount, List<NoticePostSimpleResponseDto> noticePost) { | ||
return CrewMainNoticeResponseDto.builder() | ||
.crewTitle(crewTitle) | ||
.postCount(postCount) | ||
.memberCount(memberCount) | ||
.noticePost(noticePost) | ||
.build(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ain/java/RunningMachines/R2R/domain/crew/post/notice/dto/NoticePostSimpleResponseDto.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 RunningMachines.R2R.domain.crew.post.notice.dto; | ||
|
||
import RunningMachines.R2R.domain.crew.post.entity.CrewPost; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Builder | ||
public class NoticePostSimpleResponseDto { | ||
private long crewPostId; | ||
private String title; | ||
private String author; | ||
private LocalDateTime lastModified; | ||
|
||
public static NoticePostSimpleResponseDto fromEntity(CrewPost crewPost) { | ||
return NoticePostSimpleResponseDto.builder() | ||
.crewPostId(crewPost.getId()) | ||
.title(crewPost.getTitle()) | ||
.author(crewPost.getUser().getNickname()) | ||
.lastModified(crewPost.getUpdatedAt()) | ||
.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