Skip to content

Commit b225017

Browse files
authored
Merge pull request #65 from Nexters/dev
Dev
2 parents 1feae40 + 72d9870 commit b225017

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/main/java/donmani/donmani_server/expense/service/ExpenseService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.time.LocalDate;
44
import java.time.LocalDateTime;
55
import java.time.YearMonth;
6+
import java.time.ZoneId;
67
import java.util.*;
78
import java.util.stream.Collectors;
89
import java.util.stream.IntStream;
@@ -34,7 +35,7 @@ public class ExpenseService {
3435
@Transactional
3536
public void addExpense(ExpenseRequestDTO request) {
3637
Long userId = userService.getUserIdByUserKey(request.getUserKey());
37-
LocalDateTime localDateTime = LocalDateTime.now();
38+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
3839

3940
List<Expense> expenses = request.getRecords().stream()
4041
.flatMap(record -> {

src/main/java/donmani/donmani_server/user/service/UserService.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.time.LocalDate;
44
import java.time.LocalDateTime;
5+
import java.time.ZoneId;
56
import java.util.Date;
67
import java.util.Optional;
78

@@ -48,7 +49,7 @@ public UserRegisterResponseDTOV1 registerUserV1(String userKey) {
4849
UserRegisterResponseDTOV1 response;
4950
Optional<User> user = userRepository.findByUserKey(userKey);
5051

51-
LocalDateTime localDateTime = LocalDateTime.now();
52+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
5253

5354
// 1. 신규 유저
5455
if (user.isEmpty()) {
@@ -80,7 +81,7 @@ public UserRegisterResponseDTOV1 registerUserV1(String userKey) {
8081

8182
@Transactional
8283
public UpdateUsernameResponseDTO updateUsername(String userKey, String newUserName) {
83-
LocalDateTime localDateTime = LocalDateTime.now();
84+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
8485

8586
User user = userRepository
8687
.findByUserKey(userKey)
@@ -110,7 +111,7 @@ public Long getUserIdByUserKeyV1(String userKey) {
110111

111112
@Transactional
112113
public void markNoticeAsRead(String userKey) {
113-
LocalDateTime localDateTime = LocalDateTime.now();
114+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
114115

115116
User user = userRepository.findByUserKey(userKey)
116117
.orElseThrow(() -> new IllegalArgumentException("User not found"));
@@ -131,7 +132,7 @@ public NoticeReadDTO getNoticeReadStatus(String userKey) {
131132

132133
@Transactional
133134
public void updateUserNoticeEnable(String userKey, boolean isNoticeEnable) {
134-
LocalDateTime localDateTime = LocalDateTime.now();
135+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
135136

136137
User user = userRepository
137138
.findByUserKey(userKey)
@@ -143,7 +144,7 @@ public void updateUserNoticeEnable(String userKey, boolean isNoticeEnable) {
143144

144145
@Transactional
145146
public void updateUserLastLoginDate(String userKey) {
146-
LocalDateTime localDateTime = LocalDateTime.now();
147+
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Seoul"));
147148

148149
User user = userRepository
149150
.findByUserKey(userKey)

src/main/java/donmani/donmani_server/webhook/service/WebHookService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.time.LocalDate;
44
import java.time.LocalDateTime;
5+
import java.time.ZoneId;
56
import java.time.format.DateTimeFormatter;
67
import java.util.List;
78
import java.util.Map;
@@ -25,7 +26,7 @@ public class WebHookService {
2526
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy년 MM월 dd일");
2627

2728
public void sendDailyUserStatsReport() {
28-
LocalDate today = LocalDate.now();
29+
LocalDate today = LocalDate.now(ZoneId.of("Asia/Seoul"));
2930

3031
LocalDateTime yesterday = today.atStartOfDay().minusDays(1);
3132
LocalDateTime endOfYesterday = today.atStartOfDay().minusNanos(1);

0 commit comments

Comments
 (0)