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

fix: missionRecord -> mission startedAt으로 변경하여 sinceDay 계산 수정 #203

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

char-yb
Copy link
Member

@char-yb char-yb commented Jan 22, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

📝 참고사항

📚 기타

@char-yb char-yb added 🥇 P1 급하고 꼭 필요한 이슈 🐛 bug/error 버그 및 에러 픽스 labels Jan 22, 2024
@char-yb char-yb added this to the 2.5차 스프린트 milestone Jan 22, 2024
@char-yb char-yb requested a review from kdomo January 22, 2024 16:44
@char-yb char-yb self-assigned this Jan 22, 2024
Comment on lines 87 to 90
long sinceDay =
Duration.between(missionRecord.getMission().getStartedAt(), LocalDateTime.now())
.toDays()
+ 1;
Copy link
Member

Choose a reason for hiding this comment

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

상단에 매직넘버 상수로 빼는게 좋을 것 같아용
private static final int DAYS_ADJUSTMENT = 1;

Suggested change
long sinceDay =
Duration.between(missionRecord.getMission().getStartedAt(), LocalDateTime.now())
.toDays()
+ 1;
long sinceDay =
Duration.between(missionRecord.getMission().getStartedAt(), LocalDateTime.now())
.toDays() + DAYS_ADJUSTMENT;

또는

Suggested change
long sinceDay =
Duration.between(missionRecord.getMission().getStartedAt(), LocalDateTime.now())
.toDays()
+ 1;
long sinceDay =
Duration.between(missionRecord.getMission().getStartedAt(), LocalDateTime.now().minusDays(DAYS_ADJUSTMENT))
.toDays();

와 같이 처리할수도 있을 것 같네용

Copy link
Member Author

Choose a reason for hiding this comment

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

1번 내용으로 수정하겠습니당

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

41 New issues
0 Security Hotspots
52.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@char-yb char-yb merged commit c608c93 into develop Jan 23, 2024
2 checks passed
@github-actions github-actions bot added the merged 머지된 PR label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug/error 버그 및 에러 픽스 merged 머지된 PR 🥇 P1 급하고 꼭 필요한 이슈
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

🐛 미션 상세 조회 시 sinceDay값이 항상 0일차로 나오는 문제
2 participants