Skip to content

Commit 3bfdadf

Browse files
committed
feat: 날짜 올해에 맞게 수정
1 parent 5a39411 commit 3bfdadf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/java/cmf/commitField/domain/commit/sinceCommit/controller/SinceCommitController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public ResponseEntity<CommitAnalysisResponseDto> getSpringSeasonCommits(
5151
@RequestParam String repo
5252
) {
5353
int currentYear = LocalDateTime.now().getYear();
54-
LocalDateTime since = LocalDateTime.of(2024, 3, 1, 0, 0);
55-
LocalDateTime until = LocalDateTime.of(2024, 5, 31, 23, 59, 59);
54+
LocalDateTime since = LocalDateTime.of(2025, 3, 1, 0, 0);
55+
LocalDateTime until = LocalDateTime.of(2025, 5, 31, 23, 59, 59);
5656

5757
CommitAnalysisResponseDto analysis = sinceCommitService.getCommitAnalysis(owner, repo, since, until);
5858
return ResponseEntity.ok(analysis);
@@ -93,7 +93,7 @@ public ResponseEntity<CommitAnalysisResponseDto> getWinterSeasonCommits(
9393
@RequestParam String repo
9494
) {
9595
int currentYear = LocalDateTime.now().getYear();
96-
LocalDateTime since = LocalDateTime.of(2023, 12, 1, 0, 0);
96+
LocalDateTime since = LocalDateTime.of(2024, 12, 1, 0, 0);
9797
LocalDateTime until = LocalDateTime.of(2024 + 1, 2, 1, 23, 59, 59)
9898
.with(TemporalAdjusters.lastDayOfMonth());
9999

src/main/java/cmf/commitField/domain/commit/totalCommit/controller/TotalCommitController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public TotalCommitResponseDto getTotalCommits(@AuthenticationPrincipal CustomOAu
4141
@GetMapping("/api/commits/spring")
4242
public TotalCommitResponseDto getSpringSeasonCommits(@AuthenticationPrincipal CustomOAuth2User oAuth2User) {
4343
String username = oAuth2User.getName();
44-
int currentYear = LocalDateTime.now().getYear(); // 현재는 테스트용으로 2024 대입
45-
LocalDateTime since = LocalDateTime.of(2024, 3, 1, 0, 0);
46-
LocalDateTime until = LocalDateTime.of(2024, 5, 31, 23, 59, 59);
44+
int currentYear = LocalDateTime.now().getYear(); // 올해 대입
45+
LocalDateTime since = LocalDateTime.of(2025, 3, 1, 0, 0);
46+
LocalDateTime until = LocalDateTime.of(2025, 5, 31, 23, 59, 59);
4747
return totalCommitService.getSeasonCommits(username, since, until);
4848
}
4949

@@ -71,9 +71,9 @@ public TotalCommitResponseDto getFallSeasonCommits(@AuthenticationPrincipal Cust
7171
@GetMapping("/api/commits/winter")
7272
public TotalCommitResponseDto getWinterSeasonCommits(@AuthenticationPrincipal CustomOAuth2User oAuth2User) {
7373
String username = oAuth2User.getName();
74-
int currentYear = LocalDateTime.now().getYear(); // 현재는 테스트용으로 2024 대입
75-
LocalDateTime since = LocalDateTime.of(2024 - 1, 12, 1, 0, 0);
76-
LocalDateTime until = LocalDateTime.of(2024, 2, 1, 23, 59, 59)
74+
int currentYear = LocalDateTime.now().getYear(); // 2024.12 ~ 2025.2 대입
75+
LocalDateTime since = LocalDateTime.of(2025 - 1, 12, 1, 0, 0);
76+
LocalDateTime until = LocalDateTime.of(2025, 2, 1, 23, 59, 59)
7777
.with(TemporalAdjusters.lastDayOfMonth());
7878
return totalCommitService.getSeasonCommits(username, since, until);
7979
}

0 commit comments

Comments
 (0)