From 405e45b9d198742eff81a9fe28088e5849623585 Mon Sep 17 00:00:00 2001 From: yulmam <70622601+yulmam@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:20:31 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20timezone=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../board/entity/dto/ResponseBoardDetailDto.java | 5 +++-- .../board/entity/dto/ResponseBoardSummaryDto.java | 3 ++- .../board/entity/dto/ResponseCommentDto.java | 5 +++-- .../com/edufocus/edufocus/board/entity/vo/Board.java | 11 +++++++---- .../edufocus/edufocus/board/entity/vo/Comment.java | 12 +++++++----- .../report/entity/dto/ReportDetailResponseDto.java | 2 +- .../edufocus/report/entity/dto/ReportResponse.java | 2 +- .../report/entity/dto/ReportSetResponse.java | 3 ++- .../edufocus/edufocus/report/entity/vo/Report.java | 5 +++-- .../edufocus/report/entity/vo/ReportSet.java | 6 ++++-- 10 files changed, 33 insertions(+), 21 deletions(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardDetailDto.java b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardDetailDto.java index 7a6e8fe..c0e1f28 100644 --- a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardDetailDto.java +++ b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardDetailDto.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; import java.time.LocalDateTime; +import java.util.Date; @Builder @Getter @@ -17,6 +18,6 @@ public class ResponseBoardDetailDto { private String title; private String content; private boolean isMine; - private LocalDateTime createdAt; - private LocalDateTime modifiedAt; + private Date createdAt; + private Date modifiedAt; } diff --git a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardSummaryDto.java b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardSummaryDto.java index bcd1f11..0e50f01 100644 --- a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardSummaryDto.java +++ b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseBoardSummaryDto.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; import java.time.LocalDateTime; +import java.util.Date; @Builder @Getter @@ -14,5 +15,5 @@ public class ResponseBoardSummaryDto { private long id; private String name; private String title; - private LocalDateTime createdAt; + private Date createdAt; } diff --git a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseCommentDto.java b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseCommentDto.java index 2e0ec6e..ee99823 100644 --- a/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseCommentDto.java +++ b/backend/src/main/java/com/edufocus/edufocus/board/entity/dto/ResponseCommentDto.java @@ -6,6 +6,7 @@ import lombok.Setter; import java.time.LocalDateTime; import java.time.LocalTime; +import java.util.Date; @Builder @Getter @@ -15,6 +16,6 @@ public class ResponseCommentDto { private String name; private String content; private boolean isMine; - private LocalDateTime createAt; - private LocalDateTime modifiedAt; + private Date createAt; + private Date modifiedAt; } diff --git a/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Board.java b/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Board.java index bc05d56..f7ee473 100644 --- a/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Board.java +++ b/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Board.java @@ -15,6 +15,7 @@ import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.time.LocalDateTime; +import java.util.Date; import java.util.List; @Entity @@ -42,13 +43,15 @@ public class Board { @Column(nullable = true) private int viewCount; - @Column(columnDefinition = "TIMESTAMP") + @Column @CreationTimestamp - LocalDateTime createdAt; + @Temporal(TemporalType.TIMESTAMP) + private Date createdAt; - @Column(columnDefinition = "TIMESTAMP") + @Column @UpdateTimestamp - LocalDateTime modifiedAt; + @Temporal(TemporalType.TIMESTAMP) + private Date modifiedAt; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") diff --git a/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Comment.java b/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Comment.java index 4928800..80bb200 100644 --- a/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Comment.java +++ b/backend/src/main/java/com/edufocus/edufocus/board/entity/vo/Comment.java @@ -15,6 +15,7 @@ import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import java.time.LocalDateTime; +import java.util.Date; @Entity @Builder @@ -30,13 +31,14 @@ public class Comment { @Column(columnDefinition = "TEXT", nullable = false) private String content; - @Column(columnDefinition = "TIMESTAMP") + @Column @CreationTimestamp - private LocalDateTime createdAt; + @Temporal(TemporalType.TIMESTAMP) + private Date createdAt; - @Column(columnDefinition = "TIMESTAMP") - @UpdateTimestamp - private LocalDateTime modifiedAt; + @Column + @Temporal(TemporalType.TIMESTAMP) + private Date modifiedAt; @ManyToOne @JoinColumn(name = "user_id") diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportDetailResponseDto.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportDetailResponseDto.java index 6ef9d9c..6cd671f 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportDetailResponseDto.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportDetailResponseDto.java @@ -14,6 +14,6 @@ public class ReportDetailResponseDto { private int allCount; private String title; private int correctCount; - private LocalDateTime testAt; + private Date testAt; private List quizzes; } \ No newline at end of file diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportResponse.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportResponse.java index 0740a0b..9248eef 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportResponse.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportResponse.java @@ -16,5 +16,5 @@ public class ReportResponse { private String title; private int allCount; private int correctCount; - private LocalDateTime date; + private Date date; } diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportSetResponse.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportSetResponse.java index a7ea791..119a662 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportSetResponse.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportSetResponse.java @@ -4,6 +4,7 @@ package com.edufocus.edufocus.report.entity.dto; import lombok.*; import java.time.LocalDateTime; +import java.util.Date; import java.util.UUID; @Builder @@ -14,5 +15,5 @@ import java.util.UUID; public class ReportSetResponse { private UUID reportSetId; private String quizSetTitle; - private LocalDateTime testAt; + private Date testAt; } diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java index 32a5b5c..df47ac2 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java @@ -31,9 +31,10 @@ public class Report { private int correctCount; - @Column(columnDefinition = "TIMESTAMP") + @Column @CreationTimestamp - private LocalDateTime testAt; + @Temporal(TemporalType.TIMESTAMP) + private Date testAt; private Long lectureId; diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/ReportSet.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/ReportSet.java index d263393..fb293ec 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/ReportSet.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/ReportSet.java @@ -14,6 +14,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.time.LocalDateTime; +import java.util.Date; import java.util.List; import java.util.UUID; @@ -35,9 +36,10 @@ public class ReportSet { ) private UUID id; - @Column(columnDefinition = "TIMESTAMP") + @Column @CreationTimestamp - private LocalDateTime createAt; + @Temporal(TemporalType.TIMESTAMP) + private Date createAt; @OneToMany(mappedBy = "reportSet", cascade = CascadeType.REMOVE) private List reports;