detect qr codes from URL and cid

This commit is contained in:
heyethereum
2024-07-28 00:03:53 +08:00
parent a95e5e8fcd
commit 31dbb35d00
5 changed files with 368 additions and 236 deletions

View File

@@ -5,6 +5,7 @@ import com.safeqr.app.qrcode.entity.EmailEntity;
import com.safeqr.app.qrcode.entity.QRCodeEntity;
import com.safeqr.app.qrcode.entity.URLEntity;
import com.safeqr.app.qrcode.service.URLVerificationService;
import jakarta.transaction.Transactional;
import lombok.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,7 +27,7 @@ public final class URLModel extends QRCodeModel<URLEntity> {
this.urlVerificationService = urlVerificationService;
details = null;
}
@Transactional
@Override
public void setDetails() {
String url = data.getContents();
@@ -35,11 +36,10 @@ public final class URLModel extends QRCodeModel<URLEntity> {
urlVerificationService.countAndTrackRedirects(url, details);
// set qrCode Identifier
details.setQrCodeId(data.getId());
// Insert into URL table
urlVerificationService.insertDB(details);
} catch (IOException | URISyntaxException e) {
} catch (IOException e) {
logger.error("Error: ", e);
}
}