|
@@ -1,19 +1,15 @@
|
1
|
1
|
package com.proximity.demo.eventbriteApi.Events;
|
2
|
2
|
|
3
|
|
-import com.fasterxml.jackson.annotation.JsonBackReference;
|
4
|
3
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
5
|
4
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
6
|
5
|
import com.proximity.demo.eventbriteApi.Categories.Category;
|
7
|
6
|
import com.proximity.demo.eventbriteApi.Subcategories.Subcategory;
|
8
|
|
-import com.proximity.demo.eventbriteApi.Venues.Venue;
|
9
|
|
-import io.micrometer.core.lang.Nullable;
|
10
|
7
|
|
11
|
8
|
import javax.persistence.*;
|
|
9
|
+import java.time.LocalDate;
|
12
|
10
|
import java.time.LocalDateTime;
|
13
|
11
|
import java.util.Date;
|
14
|
|
-import java.util.HashSet;
|
15
|
12
|
import java.util.Map;
|
16
|
|
-import java.util.Set;
|
17
|
13
|
|
18
|
14
|
@Entity
|
19
|
15
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
@@ -27,8 +23,8 @@ public class Event {
|
27
|
23
|
private Long category_id;
|
28
|
24
|
private Long subcategory_id;
|
29
|
25
|
private Long venue_id;
|
30
|
|
- private LocalDateTime startDate;
|
31
|
|
- private LocalDateTime endDate;
|
|
26
|
+ private LocalDate start_date;
|
|
27
|
+ private LocalDate endDate;
|
32
|
28
|
private String status;
|
33
|
29
|
private Date created;
|
34
|
30
|
private String resource_url;
|
|
@@ -51,14 +47,14 @@ public class Event {
|
51
|
47
|
public Event() { }
|
52
|
48
|
|
53
|
49
|
public Event(String eventName, String eventDescription, long category_id, long subcategory_id, long venue_id,
|
54
|
|
- LocalDateTime startDate, LocalDateTime endDate, String status, Date created, String resource_url,
|
|
50
|
+ LocalDate start_date, LocalDate endDate, String status, Date created, String resource_url,
|
55
|
51
|
String logo) {
|
56
|
52
|
this.eventName = eventName;
|
57
|
53
|
this.eventDescription = eventDescription;
|
58
|
54
|
this.category_id = category_id;
|
59
|
55
|
this.subcategory_id = subcategory_id;
|
60
|
56
|
this.venue_id = venue_id;
|
61
|
|
- this.startDate = startDate;
|
|
57
|
+ this.start_date = start_date;
|
62
|
58
|
this.endDate = endDate;
|
63
|
59
|
this.status = status;
|
64
|
60
|
this.created = created;
|
|
@@ -79,12 +75,12 @@ public class Event {
|
79
|
75
|
|
80
|
76
|
@JsonProperty("start")
|
81
|
77
|
private void unpackStart(Map<String, Object> start) {
|
82
|
|
- this.startDate = LocalDateTime.parse((String) start.get("local"));
|
|
78
|
+ this.start_date = LocalDate.from(LocalDateTime.parse((String) start.get("local")));
|
83
|
79
|
}
|
84
|
80
|
|
85
|
81
|
@JsonProperty("end")
|
86
|
82
|
private void unpackEnd(Map<String, Object> end) {
|
87
|
|
- this.endDate = LocalDateTime.parse((String) end.get("local"));
|
|
83
|
+ this.endDate = LocalDate.from(LocalDateTime.parse((String) end.get("local")));
|
88
|
84
|
}
|
89
|
85
|
//
|
90
|
86
|
// @JsonProperty("logo")
|
|
@@ -118,13 +114,21 @@ public class Event {
|
118
|
114
|
|
119
|
115
|
public void setVenue_id(long venue_id) { this.venue_id = venue_id; }
|
120
|
116
|
|
121
|
|
- public LocalDateTime getStartDate() { return startDate; }
|
|
117
|
+ public LocalDate getStart_date() {
|
|
118
|
+ return start_date;
|
|
119
|
+ }
|
122
|
120
|
|
123
|
|
- public void setStartDate(LocalDateTime startDate) { this.startDate = startDate; }
|
|
121
|
+ public void setStart_date(LocalDate start_date) {
|
|
122
|
+ this.start_date = start_date;
|
|
123
|
+ }
|
124
|
124
|
|
125
|
|
- public LocalDateTime getEndDate() { return endDate; }
|
|
125
|
+ public LocalDate getEndDate() {
|
|
126
|
+ return endDate;
|
|
127
|
+ }
|
126
|
128
|
|
127
|
|
- public void setEndDate(LocalDateTime endDate) { this.endDate = endDate; }
|
|
129
|
+ public void setEndDate(LocalDate endDate) {
|
|
130
|
+ this.endDate = endDate;
|
|
131
|
+ }
|
128
|
132
|
|
129
|
133
|
public String getStatus() { return status; }
|
130
|
134
|
|
|
@@ -154,23 +158,4 @@ public class Event {
|
154
|
158
|
//
|
155
|
159
|
// public void setVenue(Venue venue) { this.venue = venue; }
|
156
|
160
|
|
157
|
|
- @Override
|
158
|
|
- public String toString() {
|
159
|
|
- return "Event{" +
|
160
|
|
- "id=" + id +
|
161
|
|
- ", eventName='" + eventName + '\'' +
|
162
|
|
- ", eventDescription='" + eventDescription + '\'' +
|
163
|
|
- ", category_id=" + category_id +
|
164
|
|
- ", subcategory_id=" + subcategory_id +
|
165
|
|
- ", venue_id=" + venue_id +
|
166
|
|
- ", startDate=" + startDate +
|
167
|
|
- ", endDate=" + endDate +
|
168
|
|
- ", status='" + status + '\'' +
|
169
|
|
- ", created=" + created +
|
170
|
|
- ", resource_url='" + resource_url + '\'' +
|
171
|
|
- ", category=" + category +
|
172
|
|
- ", subcategory=" + subcategory +
|
173
|
|
-// ", venue=" + venue +
|
174
|
|
- '}';
|
175
|
|
- }
|
176
|
161
|
}
|