1 | package mk.profesori.springapp.Model;
|
---|
2 |
|
---|
3 | import lombok.NoArgsConstructor;
|
---|
4 |
|
---|
5 | import javax.persistence.*;
|
---|
6 | import java.time.LocalDateTime;
|
---|
7 |
|
---|
8 | @Entity
|
---|
9 | @NoArgsConstructor
|
---|
10 | public class PostReport {
|
---|
11 |
|
---|
12 | @Id
|
---|
13 | @SequenceGenerator(name = "post_report_sequence", sequenceName = "post_report_sequence", allocationSize = 1)
|
---|
14 | @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "post_report_sequence")
|
---|
15 | private Long postReportId;
|
---|
16 |
|
---|
17 | @ManyToOne
|
---|
18 | @JoinColumn(name = "custom_user_details_id")
|
---|
19 | private CustomUserDetails user;
|
---|
20 |
|
---|
21 | @ManyToOne
|
---|
22 | @JoinColumn(name = "post_id")
|
---|
23 | private Post post;
|
---|
24 |
|
---|
25 | LocalDateTime time;
|
---|
26 |
|
---|
27 | @Column(name = "description", columnDefinition = "TEXT")
|
---|
28 | private String description;
|
---|
29 |
|
---|
30 | @Column(name = "resolved")
|
---|
31 | private boolean resolved;
|
---|
32 |
|
---|
33 | public PostReport(CustomUserDetails user, Post post, String description) {
|
---|
34 | this.user = user;
|
---|
35 | this.post = post;
|
---|
36 | this.time = LocalDateTime.now();
|
---|
37 | this.description = description;
|
---|
38 | this.resolved=false;
|
---|
39 | }
|
---|
40 |
|
---|
41 | public boolean isResolved() {
|
---|
42 | return resolved;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public void setResolved(boolean resolved) {
|
---|
46 | this.resolved = resolved;
|
---|
47 | }
|
---|
48 |
|
---|
49 | public Long getPostReportId() {
|
---|
50 | return postReportId;
|
---|
51 | }
|
---|
52 |
|
---|
53 | public void setPostReportId(Long postReportId) {
|
---|
54 | this.postReportId = postReportId;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public CustomUserDetails getUser() {
|
---|
58 | return user;
|
---|
59 | }
|
---|
60 |
|
---|
61 | public void setUser(CustomUserDetails user) {
|
---|
62 | this.user = user;
|
---|
63 | }
|
---|
64 |
|
---|
65 | public Post getPost() {
|
---|
66 | return post;
|
---|
67 | }
|
---|
68 |
|
---|
69 | public void setPost(Post post) {
|
---|
70 | this.post = post;
|
---|
71 | }
|
---|
72 |
|
---|
73 | public LocalDateTime getTime() {
|
---|
74 | return time;
|
---|
75 | }
|
---|
76 |
|
---|
77 | public void setTime(LocalDateTime time) {
|
---|
78 | this.time = time;
|
---|
79 | }
|
---|
80 |
|
---|
81 | public String getDescription() {
|
---|
82 | return description;
|
---|
83 | }
|
---|
84 |
|
---|
85 | public void setDescription(String description) {
|
---|
86 | this.description = description;
|
---|
87 | }
|
---|
88 | } |
---|