Open
Conversation
Dae-Hwa
reviewed
Dec 7, 2021
| } | ||
|
|
||
| public static GroupReadAllResponse from(Group group) { | ||
| return new GroupReadAllResponse(group.getId(), group.getName(), group.getDescription()); |
| } | ||
|
|
||
| @GetMapping | ||
| public GroupReadAllResponses readAll(@LoggedInUser User user) { |
| @Mapping(target = "owner", source = "owner") | ||
| Group map(GroupCreationRequest groupCreationRequest, User owner); | ||
|
|
||
| GroupReadAllResponse map(Group group); |
Collaborator
There was a problem hiding this comment.
별도의 매퍼를 정의해야 할 것 같아요
파라미터가 Group으로 고정되면 오버로딩이 힘들 것 같습니다
Comment on lines
55
to
61
| return GroupReadAllResponses | ||
| .builder() | ||
| .groupReadAllResponse( | ||
| loggedInUser.getJoinedGroups().stream() | ||
| .map(GroupMapper.INSTANCE::map) | ||
| .collect(Collectors.toList())) | ||
| .build(); |
Collaborator
There was a problem hiding this comment.
이런 부분도 매퍼로 처리할 수 있는 것 같았는데, 살펴보고 한 번 정리해볼게요 ㅎㅎ
Comment on lines
+440
to
+441
| Group group = Group.builder().name("name").description("").owner(testUser).schedules(new ArrayList<>()).build(); | ||
| Group group2 = Group.builder().name("group2").description("group2").owner(testUser).schedules(new ArrayList<>()).build(); |
Collaborator
There was a problem hiding this comment.
여기는 Provider에 넣지 않으신 이유가 있나요?
Comment on lines
+77
to
+79
| if (!user.getJoinedGroups().contains(this)) { | ||
| user.getJoinedGroups().add(this); | ||
| } |
janeljs
previously approved these changes
Dec 7, 2021
| @Data | ||
| public class GroupReadAllResponses { | ||
|
|
||
| private List<GroupReadAllResponse> groupReadAllResponse; |
Contributor
There was a problem hiding this comment.
groupReadAllResponses가 되어야 할 것 같아요!
Comment on lines
+77
to
+79
| if (!user.getJoinedGroups().contains(this)) { | ||
| user.getJoinedGroups().add(this); | ||
| } |
#231 (comment) ✅ Closes: #226
#231 (comment) ✅ Closes: #226
✅ Closes: #226
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
우선 예정보다 많이 늦어진 점 죄송합니다..ㅠㅠ:bow:
그룹과 유저를
@ManyToMany어노테이션을 이용해 관계를 맺도록 했습니다.그룹서비스에서는 유저를 찾을 때마다 유저레파지토리를 사용하지 않고 유저 서비스에 findById를 구현해놓고 이를 사용하도록 했습니다.
그룹 인수테스트에서 생성과 수정부분에 group.members를 인식하지 못해 우선 ignoringFields에 넣어두었습니다.