added image for post
This commit is contained in:
@@ -3,6 +3,7 @@ package com.krylov.refound.entity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.krylov.refound.enums.PostStatus;
|
||||
import com.krylov.refound.enums.PostType;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EnumType;
|
||||
@@ -11,8 +12,11 @@ import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -25,24 +29,19 @@ public class Post {
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PostType type;
|
||||
|
||||
private String title;
|
||||
|
||||
@Column(length = 2000)
|
||||
private String description;
|
||||
|
||||
private String category;
|
||||
|
||||
private String city;
|
||||
|
||||
private String district;
|
||||
|
||||
private Double latitude;
|
||||
private Double longitude;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String phone;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PostType type;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PostStatus status;
|
||||
@@ -51,5 +50,8 @@ public class Post {
|
||||
@JsonIgnore
|
||||
private User user;
|
||||
|
||||
private String phone;
|
||||
@OneToMany(mappedBy = "post", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<Image> images = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user