-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
콕 찌르기 및 알림 전송 추가 #69
콕 찌르기 및 알림 전송 추가 #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다!
대부분 간단한 컨벤션 수정이고, 골 초대 알림 보내기의 경우 골 팀원 수정시에 추가된 팀원에게도 보내야해서 추가로 구현이 필요할 것 같아 rc로 남깁니다.
그리고 아래는 질문주신 고민에 대한 답변입니다.
- 콕 찌르기 uri는 저도 좋은 것 같습니다. 코멘트에도 적어두었지만, 지금의 uri가 프론트쪽에서도 구별이 쉬울 것 같습니다. 오히려 스탬프 조회쪽에서도 이렇게 uri를 설정하는 것이 좋은지 고민하게 되네요..! 스탬프도
goals/{goalId}/stamp
와 같은 형식이 나을지 질문드립니다! - 팀원 목록을 가져오는 로직이
Goal
과 관련된 로직이어서 저는Goal
에 있으면 좋을 것 같습니다!
public void poke(final PokeDto pokeDto) { | ||
final User sender = getUser(pokeDto.senderId()); | ||
final User receiver = getUser(pokeDto.receiverId()); | ||
final Goal goal = getGaol(pokeDto.goalId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오타가 있네요!
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개행이 하나 더 들어갔네요!
|
||
private final PokeService pokeService; | ||
|
||
// TODO: 2/17/24 API의 URI 상 이 패키지가 적절하다고 생각했는데, 괜찮을까요? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전 좋은 것 같습니다! 확실히 잘 구별되는 것 같아서 좋은 것 같습니다.
다만 제가 이번 스탬프 조회 기능을 구현하면서 stamps/{goalId} 이런 식으로 api 패키지를 설정했는데, 부적절하다고 판단되면 수정하도록 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 리뷰를 먼저 보지 못하고, 효선님 pr을 리뷰해 동일한 의견이 있는 줄 몰랐네요..!
저도 효선님과 동일하게, /goals/{goalId}/stamps
가 더 자연스럽지 않나? 하는 의문이 있었습니다.
그래서 uri 상 위 형태가 되면 더 좋겠다는 생각을 했습니다.
다만, 그랬을 때 스탬프 관련 코드들을 골로 옮겨야 할까? 하는 고민이 있었습니다.
해당 부분에 대해 어떻게 생각하시나요?
p.s. 스탬프와 관련된 이야기니, 해당 pr에 의견을 작성해주시면, 나중에 다시 확인하고 싶을 때 빨리 찾을 수 있을 것 같습니다!
|
||
public Long createGoal(final CreateGoalDto createGoalDto) { | ||
final List<User> users = getUsers(createGoalDto.teamUserIds()); | ||
final Goal goal = persistGoal(createGoalDto, users); | ||
|
||
notificationService.sendRequestGoalNotification(goal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
골 팀 목록 수정시에도 sendRequestGoalNotification
을 해줘야할 것 같습니다!
이 부분은 골 수정/삭제 부분 머지가 늦어지는 바람에 develop
에 포함이 안되어 있었던 것 같네요...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇네요!
그런데, 해당 부분을 진행하려면 update()
를 통해 추가된 팀원이 누구인지 알아야 합니다.
그래서 updateTeams()
를 void가 아닌 List<GoalTeam>
을 반환하게 하면 어떨지 의견 구하고 싶습니다.
해당 부분은 효선님의 의견을 구한 뒤 결정된 방법으로 수정 진행하려 합니다.
또한, 다른 update
메서드들과는 다르게 updateTeams
만 반환값이 있어도 어떻게 생각하시는 지 궁금합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다! �수정 로직 구현 과정에서 추가된 팀원을 반환해야하는 경우가 딱히 없을거라 판단해 반환값을 주지 않았는데 이 경우에는 수정된 내용을 반환받아야겠네요. updateTeams
와 updateTeams()
에 반환값을 부여하는 것에 동의합니다. 그럼 이 부분은 제가 리팩토링 pr을 파서 수정을 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
간단한 수정 사항이기에 이번 pr에서 제가 진행하도록 하겠습니다!
final User 콕_찌르기_요청자 = User.builder() | ||
.oAuthId("12345") | ||
.oAuthType(OAuthType.KAKAO) | ||
.name(new Name("사용자1")) | ||
.email(new Email("[email protected]")) | ||
.build(); | ||
final User 콕_찌르기_수신자 = User.builder() | ||
.oAuthId("12346") | ||
.oAuthType(OAuthType.KAKAO) | ||
.name(new Name("사용자2")) | ||
.email(new Email("[email protected]")) | ||
.build(); | ||
final User 팀원이_아닌_사용자 = User.builder() | ||
.oAuthId("12347") | ||
.oAuthType(OAuthType.KAKAO) | ||
.name(new Name("사용자3")) | ||
.email(new Email("[email protected]")) | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final 붙여줘야겠군요...! 리팩토링 진행하면서 수정하도록 하겠습니다!
import com.backend.blooming.user.infrastructure.repository.UserRepository; | ||
import org.assertj.core.api.SoftAssertions; | ||
import org.assertj.core.api.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
별이 보이네요!
# Conflicts: # src/main/java/com/backend/blooming/exception/ExceptionMessage.java # src/main/java/com/backend/blooming/exception/GlobalExceptionHandler.java # src/main/resources/static/docs/goal.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정사항 모두 확인했습니다! approve 하겠습니다!
위 코멘트에서 이야기한 대로, 골 업데이트에 대해 반환값을 만들어, 이에 해당하는 사용자들에게만 알림을 보내도록 수정했습니다. |
|
콕 찌르기 기능의 경우 알림을 보내는 게 끝이기에 다른 이슈로 빼기가 애매하다 판단해 함께 진행하겠습니다.
콕 찌르기 및 알림 관련 내용에 대해선
3차 스프린트 1주차
회의록에 작성해 두었습니다. 확인해 주시면 감사하겠습니다!또한,
TODO
를 통해 고민을 한 가지 작성했는데 내용은 아래와 같습니다.코드는
TODO
를 검색해 확인하시면 보다 편하게 확인하실 수 있습니다.추가로, 팀원인지 확인하는 로직에 대해
Goal
에서 확인할 수 있도록 했습니다.해당 부분이 어떤지 확인하신 후 의견 주시면 감사하겠습니다.
또한, 괜찮다면 효선님께서도 해당 메서드를 통해 검증하셔도 좋을 것 같습니다!
고민
NotificationService
에서 가져오도록 하고 있는데, 이를Goal
을 통해 수행하는 것이 더 적절할까요?