Skip to content

Commit

Permalink
fix: fixed a bug where Seq didn't change if you brushed your teeth on…
Browse files Browse the repository at this point in the history
… the same day.
  • Loading branch information
Lunawood committed Dec 5, 2024
1 parent a82bb53 commit c749091
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.server.controller;

import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -96,7 +97,7 @@ public class ToothController {

// 5. Check Date if Date yesterday or after, change value
LocalDate userDateRenew = user.getToothDateRenew();
LocalDate nowDate = LocalDate.now();
LocalDate nowDate = LocalDate.now(ZoneId.of("Asia/Seoul"));
if(!userDateRenew.isEqual(nowDate)) {
if(userDateRenew.plusDays(1).isEqual(nowDate)) {
// Seq += 1
Expand All @@ -114,9 +115,6 @@ else if (userDateRenew.plusDays(1).isAfter(nowDate)) {
throw new CException(ErrorBase.INTERNAL_SERVER_ERROR);
}
}




ToothDataAnalyzer toothDataAnalyzer = new ToothDataAnalyzer();
toothDataAnalyzer.setReports(toothReports);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void createUserInfo(
PetWeight,
RandomID,
0,
LocalDate.now(ZoneId.of("Asia/Seoul"))
LocalDate.now(ZoneId.of("Asia/Seoul")).minusDays(1)
);

// Database에 Data 저장.
Expand Down

0 comments on commit c749091

Please sign in to comment.