Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/example/be/service/CommentServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.springframework.transaction.annotation.Transactional;

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

@Service
Expand Down Expand Up @@ -50,7 +52,7 @@ public CommonDTO.IsSuccessDTO createComment(CommentDTO.CommentRequestDTO request

Comment comment = Comment.builder()
.comment(requestDTO.getComment())
.createDate(LocalDateTime.now())
.createDate(ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime())
.user(user)
.post(post)
.build();
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/example/be/service/PostServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -56,7 +58,7 @@ public CommonDTO.IsSuccessDTO write(PostDTO.postRequestDTO request, HttpServletR
.title(request.getTitle())
.content(request.getContent())
.user(user)
.createDate(LocalDateTime.now())
.createDate(ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime())
.build();

postRepository.save(post);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spring:
user-name-attribute: id
jpa:
hibernate:
ddl-auto: create
ddl-auto: update
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
Expand Down