Merge branch 'Be/Board' into 'backend'

[Back-End] feat : timestamp 수정

See merge request s11-webmobile1-sub2/S11P12A701!134
This commit is contained in:
김기창 2024-08-09 13:38:33 +09:00
commit 1b6e2965fc
4 changed files with 14 additions and 8 deletions

View File

@ -8,6 +8,8 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@ -41,11 +43,11 @@ public class Board {
private int viewCount;
@Column(columnDefinition = "TIMESTAMP")
@CreatedDate
@CreationTimestamp
LocalDateTime createdAt;
@Column(columnDefinition = "TIMESTAMP")
@LastModifiedDate
@UpdateTimestamp
LocalDateTime modifiedAt;
@ManyToOne(fetch = FetchType.LAZY)

View File

@ -9,6 +9,8 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
@ -29,11 +31,11 @@ public class Comment {
private String content;
@Column(columnDefinition = "TIMESTAMP")
@CreatedDate
@CreationTimestamp
private LocalDateTime createdAt;
@Column(columnDefinition = "TIMESTAMP")
@LastModifiedDate
@UpdateTimestamp
private LocalDateTime modifiedAt;
@ManyToOne

View File

@ -6,6 +6,7 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@ -31,7 +32,7 @@ public class Report {
private int correctCount;
@Column(columnDefinition = "TIMESTAMP")
@CreatedDate
@CreationTimestamp
private LocalDateTime testAt;
private Long lectureId;
@ -48,7 +49,7 @@ public class Report {
@JoinColumn(name = "reportset_id")
private ReportSet reportSet;
@OneToMany(mappedBy = "report", cascade = CascadeType.ALL)
@OneToMany(mappedBy = "report", cascade = CascadeType.REMOVE)
private List<Answer> answers;
public ReportResponse makeReportResponse(){

View File

@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@ -35,10 +36,10 @@ public class ReportSet {
private UUID id;
@Column(columnDefinition = "TIMESTAMP")
@CreatedDate
@CreationTimestamp
private LocalDateTime createAt;
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.ALL)
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.REMOVE)
private List<Report> reports;
@ManyToOne