Merge branch 'Be/Board' into 'backend'
[Back-End] feat : timestamp 수정 See merge request s11-webmobile1-sub2/S11P12A701!134
This commit is contained in:
commit
1b6e2965fc
@ -8,6 +8,8 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
|
|||||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
import org.springframework.data.annotation.LastModifiedDate;
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
@ -41,11 +43,11 @@ public class Board {
|
|||||||
private int viewCount;
|
private int viewCount;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@CreatedDate
|
@CreationTimestamp
|
||||||
LocalDateTime createdAt;
|
LocalDateTime createdAt;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@LastModifiedDate
|
@UpdateTimestamp
|
||||||
LocalDateTime modifiedAt;
|
LocalDateTime modifiedAt;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@ -9,6 +9,8 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
import org.springframework.data.annotation.LastModifiedDate;
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
|
||||||
@ -29,11 +31,11 @@ public class Comment {
|
|||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@CreatedDate
|
@CreationTimestamp
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@LastModifiedDate
|
@UpdateTimestamp
|
||||||
private LocalDateTime modifiedAt;
|
private LocalDateTime modifiedAt;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@ -6,6 +6,7 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
|
|||||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ public class Report {
|
|||||||
private int correctCount;
|
private int correctCount;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@CreatedDate
|
@CreationTimestamp
|
||||||
private LocalDateTime testAt;
|
private LocalDateTime testAt;
|
||||||
|
|
||||||
private Long lectureId;
|
private Long lectureId;
|
||||||
@ -48,7 +49,7 @@ public class Report {
|
|||||||
@JoinColumn(name = "reportset_id")
|
@JoinColumn(name = "reportset_id")
|
||||||
private ReportSet reportSet;
|
private ReportSet reportSet;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "report", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "report", cascade = CascadeType.REMOVE)
|
||||||
private List<Answer> answers;
|
private List<Answer> answers;
|
||||||
|
|
||||||
public ReportResponse makeReportResponse(){
|
public ReportResponse makeReportResponse(){
|
||||||
|
@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
|||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
@ -35,10 +36,10 @@ public class ReportSet {
|
|||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
@CreatedDate
|
@CreationTimestamp
|
||||||
private LocalDateTime createAt;
|
private LocalDateTime createAt;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.REMOVE)
|
||||||
private List<Report> reports;
|
private List<Report> reports;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
Loading…
Reference in New Issue
Block a user