working get QRCode Details

This commit is contained in:
heyethereum
2024-07-19 21:45:13 +08:00
parent a236eb13f8
commit f7e592f8ec
6 changed files with 14 additions and 9 deletions

View File

@@ -11,6 +11,6 @@ public class APIConstants {
public static final String API_URL_QRCODE_VERIFY_URL = "/qrcodetypes/verifyurl";
public static final String API_URL_QRCODE_VIRUS_TOTAL_CHECK = "/qrcodetypes/virustotalcheck";
public static final String API_URL_QRCODE_REDIRECT_COUNT = "/qrcodetypes/redirectcount";
public static final String API_URL_QRCODE_GET_SCANNED_DETAILS = "/qrcodetypes/getScannedDetails";
public static final String API_URL_QRCODE_GET_QR_DETAILS = "/qrcodetypes/getQRDetails";
}

View File

@@ -43,7 +43,7 @@ public class QRCodeTypeController {
public ResponseEntity<List<QRCodeTypeEntity>> getAllTypes() {
return ResponseEntity.ok(qrCodeTypeService.getAllTypes());
}
@GetMapping(value = API_URL_QRCODE_GET_SCANNED_DETAILS)
@GetMapping(value = API_URL_QRCODE_GET_QR_DETAILS)
public ResponseEntity<BaseScanResponse> getScannedQRCodeDetails(@RequestHeader(name="QR-ID") UUID qrCodeId) {
logger.info("Invoking GET QRCode details endpoint, qrCodeId: {}", qrCodeId);
return ResponseEntity.ok(qrCodeTypeService.getScannedQRCodeDetails(qrCodeId));

View File

@@ -30,7 +30,7 @@ public class QRCodeEntity {
private String userId;
private String contents;
@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "qr_code_type_id", nullable = false)
private QRCodeTypeEntity info;

View File

@@ -2,6 +2,7 @@ package com.safeqr.app.qrcode.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -46,12 +47,15 @@ public class URLEntity {
private int redirect = 0;
@Type(ListArrayType.class)
@Column(name = "hsts_header", columnDefinition = "text[]")
private List<String> hstsHeader;
@Type(ListArrayType.class)
@Column(name = "ssl_stripping", columnDefinition = "boolean[]")
private List<Boolean> sslStripping;
@Type(ListArrayType.class)
@Column(name = "redirect_chain", columnDefinition = "text[]")
private List<String> redirectChain;
}