22
33import java .time .LocalDate ;
44import java .time .LocalDateTime ;
5+ import java .time .ZoneId ;
56import java .util .Date ;
67import 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 )
0 commit comments