-
Notifications
You must be signed in to change notification settings - Fork 5
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
[refactor] 랭크 스케줄러 수정 #488
Conversation
* 랭크 스케줄러로 인해 답변이 (수정됨) 으로 바뀌는 현상 -> 엔티티 타지 않고 바로 repository 로 update
|
||
alertService.sendToBroker(alertDtoMapper.from(AlertDto.RankAnswerAlert.of(question, answer, rank))); | ||
answerRepository.updateAnswerRank(rank, answer.getId()); |
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.
레포지토리 메서드를 바로 호출하기 보단 answerStore 사용 가능하십니까? ㅎㅎ
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.
반영했습니다
@Modifying | ||
@Query("UPDATE Answer a SET a.rank = :rank WHERE a.id = :answerId") | ||
void updateAnswerRank(@Param("rank") Rank rank, @Param("answerId") Long answerId); |
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.
Answer 엔티티에 UpdateRank 방식으로 수정하는 방법은 생각해보셨나요?
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.
말씀해주신 방법이 (수정됨) 표시가 되어 위 방법을 적용했습니다.
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.
Answer 엔티티에 UpdateRank 방식으로 수정하는 방법은 생각해보셨나요?
이렇게 하면 답변 랭킹 산정 과정에서 modifiedDate가 변경되어 화면에서 수정됨이 뜨게 되는 문제가 있었습니다.
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.
아아 알겠습니다
@@ -24,6 +25,11 @@ public Answer store(Answer answer) { | |||
return answerRepository.save(answer); | |||
} | |||
|
|||
@Override | |||
public void upRank(Rank rank, Long answerId) { | |||
answerRepository.updateAnswerRank(rank, answerId); |
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.
왜 내부 로직이랑 메서드 이름이 다르죠?
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.
제가 병룡님 대신 혼쭐 내드렸습니다 ^-^
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을 보내기 전에 확인해주세요!!
관련 이슈
close: #487
개요
상세 내용