В слой domain добавлена сущность QrCode и изменены параметры сущности Visit которая теперь хранит QrCode, который был отсканрирован
This commit is contained in:
parent
438583f029
commit
a495e6a37e
@ -0,0 +1,19 @@
|
|||||||
|
package com.example.onomatopoeiaback.domain.qrcode;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Entity(name = "QR_CODE")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class QrCode {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
package com.example.onomatopoeiaback.domain.visit;
|
package com.example.onomatopoeiaback.domain.visit;
|
||||||
|
|
||||||
|
import com.example.onomatopoeiaback.domain.qrcode.QrCode;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Table(name = "code")
|
@Table(name = "code")
|
||||||
@Entity
|
@Entity
|
||||||
@Getter
|
@Getter
|
||||||
@ -11,8 +15,12 @@ import lombok.Setter;
|
|||||||
public class Visit {
|
public class Visit {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private long id;
|
private Long id;
|
||||||
|
@NonNull
|
||||||
private long value;
|
@ManyToOne
|
||||||
|
private QrCode qrCode;
|
||||||
|
@NonNull
|
||||||
private VisitType visitType;
|
private VisitType visitType;
|
||||||
|
@NonNull
|
||||||
|
private LocalDateTime visitTime;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,6 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class VisitDTO {
|
public class VisitDTO {
|
||||||
private long value;
|
private Long QrCodeId;
|
||||||
private VisitType visitType;
|
private VisitType visitType;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user