add
This commit is contained in:
41
backend/src/main/java/com/flower/review/Review.java
Normal file
41
backend/src/main/java/com/flower/review/Review.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.flower.review;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "reviews")
|
||||
public class Review {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long productId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Integer rating;
|
||||
|
||||
@Column(length = 1000)
|
||||
private String content;
|
||||
|
||||
@Column(length = 1000)
|
||||
private String images;
|
||||
|
||||
@Column(length = 16)
|
||||
private String status = "PENDING";
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@PrePersist
|
||||
public void onCreate() {
|
||||
if (createdAt == null) {
|
||||
createdAt = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user