forked from codesquad-members-2023/issue-tracker-max
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#80 refactor: 이슈 참여자 목록 조회 응답 dto 리스트 포함하게 구조 변경
- Loading branch information
1 parent
6b59bc4
commit bc7991a
Showing
6 changed files
with
45 additions
and
20 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
20 changes: 8 additions & 12 deletions
20
be/issue/src/main/java/codesquad/issueTracker/issue/dto/IssueUserResponseDto.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,27 +1,23 @@ | ||
package codesquad.issueTracker.issue.dto; | ||
|
||
import codesquad.issueTracker.user.domain.User; | ||
import codesquad.issueTracker.issue.vo.IssueUserVo; | ||
import java.util.List; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class IssueUserResponseDto { | ||
private Long id; | ||
private String name; | ||
private String imageUrl; | ||
private List<IssueUserVo> participants; | ||
|
||
|
||
@Builder | ||
public IssueUserResponseDto(Long id, String name, String imageUrl) { | ||
this.id = id; | ||
this.name = name; | ||
this.imageUrl = imageUrl; | ||
public IssueUserResponseDto(List<IssueUserVo> participants) { | ||
this.participants = participants; | ||
} | ||
|
||
public static IssueUserResponseDto from(User user) { | ||
public static IssueUserResponseDto from(List<IssueUserVo> participants) { | ||
return IssueUserResponseDto.builder() | ||
.id(user.getId()) | ||
.name(user.getName()) | ||
.imageUrl(user.getProfileImg()) | ||
.participants(participants) | ||
.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
27 changes: 27 additions & 0 deletions
27
be/issue/src/main/java/codesquad/issueTracker/issue/vo/IssueUserVo.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,27 @@ | ||
package codesquad.issueTracker.issue.vo; | ||
|
||
import codesquad.issueTracker.user.domain.User; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class IssueUserVo { | ||
private Long id; | ||
private String name; | ||
private String imageUrl; | ||
|
||
@Builder | ||
public IssueUserVo(Long id, String name, String imageUrl) { | ||
this.id = id; | ||
this.name = name; | ||
this.imageUrl = imageUrl; | ||
} | ||
|
||
public static IssueUserVo from(User user) { | ||
return IssueUserVo.builder() | ||
.id(user.getId()) | ||
.name(user.getName()) | ||
.imageUrl(user.getProfileImg()) | ||
.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