-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] 자기소개서 좋아요 & 조회수 기능 추가 #257
Conversation
- 좋아요한 자기소개서와 유저 파악을 위한 Like Entity 생성 - 좋아요 익명성을 위해 게시물의 좋아요를 한 유저 파악이 힘들게 Resume like count 유지(OneToMany를 고민하긴 했는데, 무엇이 좋은 방법인지 확신이 안섬)
- 정상적으로 작동하는 경우 - 삭제 권한이 없는 경우 UnauthorizedAccessLikeException 반환 - 자기소개서 count가 0인 경우 -로 내려가지 않는다.
- 좋아요 취소 기능 - 좋아요를 한 자기소개서 & 유저가 동일한 경우에만 작동
- HttpServlet에서 remoteAddress를 가져와서 Redis에 추가 - Redis에 존재 여부를 확인해 없는 경우, 추가
- redis에 존재하는 viewCount를 찾아 조회수로 등록한다.
- 특정 resume를 좋아요한 유저만 취소 가능
- viewCount update - get Like count
- view count 업데이트를 위해 매 10분간 스케줄러 동작 실행
- UpdateResumeViewCountToDb job & Step 구현
- 실질적인 배치 동작인 UpdateResumeViewCountTasklet 구현 - 매 10분 마다 redis에 존재하는 ip별 view count DB에 업데이트 예정
- Redis Template 모킹 작업 - addViewCntToRedis 불필요한 검증로직 수정
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.
수고하셨습니다! 개선사항이나 개인적으로 궁금한 점 몇 가지 리뷰 남겼으니 확인 부탁드려요 ㅎㅎ 👍👍
resumeService.likeResume( | ||
new LikeResumeRequest(resumeId, securityUtil.getCurrentMemberId())); | ||
return ResponseEntity.status(HttpStatus.OK) | ||
.body(ResponseDTO.res(HttpStatus.OK, "정상적으로 처리되었습니다.")); |
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 static final String SUCCESS_MESSAGE = "정상적으로 처리되었습니다.";
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.
requestDTO에 왜 memberId를 넣으셨는지 궁금합니다!
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.
Pull Request 요약
변경 사항
token
을 헤더에 넣어서 사용redis
에ip
를 저장해 중복 조회수 카운팅 방지관련 이슈
#206
#207
개발 유형
작업 기간
유의사항
참고문헌