Skip to content
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

modify - 챌린지 생성 시 일수만큼 일별챌린지 생성되도록 수정 #132

Merged
merged 3 commits into from
May 20, 2024

Conversation

jumining
Copy link
Collaborator

Related issue 🚀

Work Description 💚

  • 챌린지 생성 시 챌린지 일수만큼 일별챌린지가 생성되도록 수정했습니다.(앱정보는 X, STATUS는 NONE으로)
  • 그에 따라 status 정보들을 불러오는 api에서 일수만큼의 정보가 모두 불러오도록 수정이 되었고 todayIndex구하는 로직도 수정하였습니다.

PR 참고 사항

  • 현재 postman이 되지 않아 테스트를 해보지 못했습니다만 이게 외국에 있어서 그런건지 토큰이 이상한건지 확인을 해봐야할 것 같습니다🥲

@jumining jumining added 👩🏻‍💻 주민 주민이가 작성한 Label 🔧 Modify 코드 수정 (기능의 변화가 있을 때) 🔥 Pull Request labels May 17, 2024
@jumining jumining requested a review from kseysh May 17, 2024 01:13
@jumining jumining self-assigned this May 17, 2024
Challenge challenge = challengeRepository.save(Challenge.builder()
.userId(userId)
.period(period)
.goalTime(goalTime)
.build());

Optional<Challenge> previousChallenge = challengeRepository.findFirstByUserIdOrderByCreatedAtDesc(userId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

챌린지 조회는 유저서비스에서 가장 최근의 challenge값을 가져오는 로직으로 구현하기로 했었어요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다😮

Comment on lines +136 to +138
private Integer calculateTodayIndex(LocalDateTime challengeCreateAt, int period) {
int daysBetween = (int) ChronoUnit.DAYS.between(challengeCreateAt.toLocalDate(), LocalDate.now());
return (daysBetween >= period) ? -1 : daysBetween;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수 분리해서 가독성이 더 좋아졌네요 👍

@jumining jumining merged commit 60c4f71 into develop May 20, 2024
1 check passed
@jumining jumining deleted the feat/#121-create-all-dailychallenges branch May 26, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👩🏻‍💻 주민 주민이가 작성한 Label 🔧 Modify 코드 수정 (기능의 변화가 있을 때)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat - 챌린지 생성시 일수만큼 모든 dailyChallenge를 생성하도록 수정
2 participants