write to scan_history table
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package com.safeqr.app.qrcode.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.UUID;
|
||||
@Entity
|
||||
@Table(name = "qr_code", schema = "safeqr")
|
||||
@Data
|
||||
@Builder
|
||||
public class QRCode {
|
||||
|
||||
@Id
|
||||
@@ -18,10 +20,8 @@ public class QRCode {
|
||||
@Column(updatable = false, nullable = false)
|
||||
private UUID id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "qr_code_type_id", nullable = false)
|
||||
private QRCodeType qrCodeType;
|
||||
|
||||
@Column(name = "qr_code_type_id", nullable = false)
|
||||
private Long qrCodeTypeId;
|
||||
private String userId;
|
||||
private String contents;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ public class QRCodeType {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private String type;
|
||||
private String description;
|
||||
private String prefix;
|
||||
|
||||
31
src/main/java/com/safeqr/app/qrcode/entity/ScanHistory.java
Normal file
31
src/main/java/com/safeqr/app/qrcode/entity/ScanHistory.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.safeqr.app.qrcode.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Builder;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@Builder
|
||||
@Table(name = "scan_history", schema = "safeqr")
|
||||
public class ScanHistory {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "qr_code_id", nullable = false)
|
||||
private UUID qrCodeId;
|
||||
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private String userId;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "status")
|
||||
private ScanStatus scanStatus;
|
||||
|
||||
public enum ScanStatus {
|
||||
ACTIVE,
|
||||
INACTIVE
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user