-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 종료된 할일 포함해 모든 목표, 할일, 인증 가져오기 #122
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
Conversation
bbbbooo
left a comment
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.
고생하셨습니다.
페이지네이션이나 무한스크롤을 구현할지 안 할지 따로 이야기를 안 나눴어서, 우선은 그냥 리스트로 응답받았는데 회의 때 어떻게 할지 정해야 할 것 같습니다.
음.. 대부분의 페이징 처리가 무한스크롤로 돼있어서 아마 무한스크롤로 해도 무관할 듯 싶습니다. 프론트분들께 한번 물어보는 것도 좋을거같아요
목표와 할 일을 다 가져와서 정렬하는 기준이 필요할 것 같습니다. 일단 제가 생각해 본 기준으로는
목표의 progress가 낮은 순
completeStatus가 "진행" 인 순
todo의 startDate가 가장 최신인 순
등이 있을 것 같은데 이 부분도 회의 때 이야기 나누면 좋겠습니다.
이 부분은 잘 이해가 안되는데 무엇때문에 기준을 나누는걸까요? 정렬 자체는 쿼리에서 하면 될 듯 싶어서 여쭤봅니다.
| return Response.ok(goalService.deleteGoal(userId, goalId)); | ||
| } | ||
|
|
||
| @Transactional |
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.
소희님은 컨트롤러에 @Transactional 많이 쓰시나요? 이 글 참고해보시면 좋을 것 같습니다!
저는 서비스 클래스에 @Transactional 붙이고 조회하는 메소드는 readOnly = true 옵션을 활성화해요.
@Transactional
public class TodoServiceImpl implements TodoService {
private static final String COMPLETE = "인증";
private final TodoRepository todoRepository;
private final GoalRepository goalRepository;
private final CompleteRepository completeRepository;
private final StorageService storageService;
@Transactional(readOnly = true)
@Override
public Slice<ReadTodosResponse> findTodoList(int userId, ReadTodoRequest request) {
List<Goal> goals = goalRepository.findByUser_UserId(userId);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.
감사합니다~ 서비스 클래스로 옮겨두었습니다.
#️⃣연관된 이슈
📝작업 내용
스크린샷 (선택)
응답값 입니다.
💬리뷰 요구사항(선택)
페이지네이션이나 무한스크롤을 구현할지 안 할지 따로 이야기를 안 나눴어서, 우선은 그냥 리스트로 응답받았는데 회의 때 어떻게 할지 정해야 할 것 같습니다.
코드가
대시보드에서 목표 조회와 상당히 비슷합니다.차이점을 설명하자면, 할 일 가져올 때 날짜를 확인하는 것이 제 API에는 구현되지 않고, 그냥 모든 할일을 가져온다는 차이가 있습니다.
그래서 2번 이상 사용되는 코드는 따로 메소드로 뺐고, 다른 클라스에서도 이용되다보니 public으로 만들었습니다.
목표에 대해 조회하는 만큼, 목표 콘트롤러, 서비스에 들어가는게 맞다고 생각해
api/v1/goals/all로 URL만들었습니다.목표와 할 일을 다 가져와서 정렬하는 기준이 필요할 것 같습니다. 일단 제가 생각해 본 기준으로는
등이 있을 것 같은데 이 부분도 회의 때 이야기 나누면 좋겠습니다.