-
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
fix: 타임라인 커서 기준 memoryPK -> recordAt로 변경 #103
Conversation
Test Results24 tests 24 ✅ 1s ⏱️ Results for commit 41a30ff. ♻️ This comment has been updated with latest results. |
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.
수고하셨습니다
|
||
@Getter | ||
@NoArgsConstructor | ||
public class Timeline<T extends Memory> { |
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.
다시 생각해보니 굳이 제네릭으로 구현할 필요가 없네요 수정했습니다.
Slice<Memory> findPrevMemoryByMemberId( | ||
Long memberId, Long cursorId, Pageable pageable, LocalDate recordAt); | ||
Timeline<Memory> findPrevMemoryByMemberId( | ||
Long memberId, LocalDate cursorRecordAt, LocalDate recordAt); |
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.
프론트엔드에서 마지막 기록의 날짜를 넘겨주면 되는건데 id로 조회하고 해당 기록의 날짜를 뽑아서 굳이 넘기는 이유가 있나요?
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.
프론트에게 혼란을 줄 수 있을거 같아서 파라미터를 그래도 사용하려 했는데 그냥 한 번 더 이야기 하면 될 문제네요 수정 했습니다.
@@ -47,7 +47,7 @@ public ApiResponse<MemoryResponse> update( | |||
|
|||
@GetMapping("/timeline") | |||
public ApiResponse<?> timeline( | |||
@LoginMember Long memberId, @ModelAttribute TimelineRequestDto timelineRequestDto) { | |||
@LoginMember Long memberId, TimelineRequestDto timelineRequestDto) { |
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.
여긴 왜 @ModelAttribute를 제거하셨죠?
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.
확인 결과 ModelAttribute 없이도 동작하여 삭제하였습니다.
@@ -47,7 +47,7 @@ public ApiResponse<MemoryResponse> update( | |||
|
|||
@GetMapping("/timeline") | |||
public ApiResponse<?> timeline( | |||
@LoginMember Long memberId, @ModelAttribute TimelineRequestDto timelineRequestDto) { | |||
@LoginMember Long memberId, TimelineRequestDto timelineRequestDto) { |
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.
여긴 왜 @ModelAttribute 를 제거하셨나요?
memoryRepository | ||
.findById(timeline.getCursorId()) | ||
.orElseThrow(() -> new NotFoundException(MemoryErrorType.NOT_FOUND)); | ||
cursorRecordAt = memory.getRecordAt(); |
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.
왜 굳이 id로 넘겨서 recordAt을 조회하는 쿼리 한번을 써야 할까요? 그냥 프론트엔드에서 recordAt 데이터를 넘기면 될거 같다고 생각합니다
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.
수고하셨습니다~
🌱 관련 이슈
📌 작업 내용 및 특이사항
📝 참고사항
처음 최신순 조회 결과
cursorId를 파라미터로 추가한 후, 조회