Skip to content

Commit

Permalink
Fix: 채팅 전송 시간 한국 기준으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
nohy6630 committed May 10, 2024
1 parent e87e529 commit 4eb0bba
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;

@Service
Expand Down Expand Up @@ -58,12 +60,13 @@ public ChatMessageRes sendEmoticonChatting(EmoticonChatMessageReq emoticonChatMe
public ChatMessageRes sendAppointmentChatting(AppointmentChatMessageReq appointmentChatMessageReq, String chatRoomId) {
User sender = userRepository.findById(appointmentChatMessageReq.getSenderId())
.orElseThrow(() -> new CustomException(ExceptionContent.NOT_FOUND_USER));
LocalDateTime nowInKorea = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
AppointmentChatMessage message = chattingRepository.insert(AppointmentChatMessage.of(
chatRoomId,
appointmentChatMessageReq.getSenderId(),
sender.getName(),
sender.getImageUrl(),
LocalDateTime.now(),
nowInKorea,
appointmentChatMessageReq.getExperienceType(),
appointmentChatMessageReq.getAppointmentTime(),
appointmentChatMessageReq.getLocation()
Expand Down

0 comments on commit 4eb0bba

Please sign in to comment.