Skip to content

Commit

Permalink
Merge pull request #13 from Lunawood/master
Browse files Browse the repository at this point in the history
fix: Fixed a bug where Seq did not change if you brushed your teeth on the same day. And Added code that uses Env files.
  • Loading branch information
Lunawood authored Dec 5, 2024
2 parents f2a98ea + 7166809 commit db4b075
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 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 @@ -15,7 +15,7 @@
@Service
public class JwtTokenService {

private String secret = "hjkdasfh;jnkladfsjkl;dasfnkl;asdfjkl;asdfjkl;";
private String secret = System.getenv("JWT_SECRET_KEY");

private int accessTokenExpMinutes = 600 * 1000; // 10분

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 db4b075

Please sign in to comment.