-
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.
Merge pull request #153 from Gongjakso/refactor/qa
fix: 내가 참여한 팀 조회 API 비즈니스 로직 수정
- Loading branch information
Showing
4 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
15 changes: 11 additions & 4 deletions
15
src/main/java/com/gongjakso/server/domain/apply/dto/ParticipationList.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,21 +1,28 @@ | ||
package com.gongjakso.server.domain.apply.dto; | ||
|
||
import com.gongjakso.server.domain.post.entity.Post; | ||
import com.gongjakso.server.domain.post.enumerate.CategoryType; | ||
import com.gongjakso.server.domain.post.enumerate.PostStatus; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Builder | ||
public record ParticipationList( | ||
String title, | ||
CategoryType recruit_part, | ||
String leaderName, | ||
LocalDateTime startDate, | ||
LocalDateTime finishDate, | ||
PostStatus postStatus, | ||
Boolean postType | ||
) { | ||
public static ParticipationList of(Post post,CategoryType recruit_part) { | ||
return new ParticipationList(post.getTitle(), recruit_part,post.getMember().getName(),post.getStartDate(),post.getFinishDate(),post.getStatus(), post.isPostType()); | ||
public static ParticipationList of(Post post) { | ||
return ParticipationList.builder() | ||
.title(post.getTitle()) | ||
.leaderName(post.getMember().getName()) | ||
.startDate(post.getStartDate()) | ||
.finishDate(post.getFinishDate()) | ||
.postStatus(post.getStatus()) | ||
.postType(post.isPostType()) | ||
.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