42 lines
723 B
Java
42 lines
723 B
Java
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();
|
|
}
|
|
}
|
|
}
|