added new endpoints delete scanned history, delete all scanned histories, delete bookmarks, delete all bookmarks
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@@ -25,8 +26,14 @@ public class ScanBookmarkEntity {
|
||||
private String userId;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "status", nullable = false)
|
||||
private BookmarkStatus scanStatus;
|
||||
@Column(name = "status")
|
||||
private BookmarkStatus bookmarkStatus;
|
||||
|
||||
@Column(name = "date_created", updatable = false)
|
||||
private OffsetDateTime dateCreated;
|
||||
|
||||
@Column(name = "date_updated")
|
||||
private OffsetDateTime dateUpdated;
|
||||
|
||||
public enum BookmarkStatus {
|
||||
ACTIVE,
|
||||
@@ -36,4 +43,11 @@ public class ScanBookmarkEntity {
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "qr_code_id", referencedColumnName = "id", insertable = false, updatable = false)
|
||||
private QRCodeEntity qrCodeEntity;
|
||||
|
||||
@PrePersist
|
||||
public void prePersist() {
|
||||
OffsetDateTime now = OffsetDateTime.now();
|
||||
dateCreated = now;
|
||||
dateUpdated = now;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@@ -28,6 +29,12 @@ public class ScanHistoryEntity {
|
||||
@Column(name = "status")
|
||||
private ScanStatus scanStatus;
|
||||
|
||||
@Column(name = "date_created", updatable = false)
|
||||
private OffsetDateTime dateCreated;
|
||||
|
||||
@Column(name = "date_updated")
|
||||
private OffsetDateTime dateUpdated;
|
||||
|
||||
public enum ScanStatus {
|
||||
ACTIVE,
|
||||
INACTIVE
|
||||
@@ -35,4 +42,11 @@ public class ScanHistoryEntity {
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "qr_code_id", referencedColumnName = "id", insertable = false, updatable = false)
|
||||
private QRCodeEntity qrCodeEntity;
|
||||
|
||||
@PrePersist
|
||||
public void prePersist() {
|
||||
OffsetDateTime now = OffsetDateTime.now();
|
||||
dateCreated = now;
|
||||
dateUpdated = now;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user