implemented fetch qr code scanned details
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.safeqr.app.qrcode.service;
|
||||
|
||||
import static com.safeqr.app.constants.CommonConstants.*;
|
||||
import com.safeqr.app.qrcode.dto.QRCodePayload;
|
||||
|
||||
import com.safeqr.app.exceptions.QRCodeExceptions;
|
||||
import com.safeqr.app.qrcode.dto.request.QRCodePayload;
|
||||
import com.safeqr.app.qrcode.dto.URLVerificationResponse;
|
||||
import com.safeqr.app.qrcode.entity.URLEntity;
|
||||
import com.safeqr.app.qrcode.repository.URLRepository;
|
||||
@@ -25,6 +27,12 @@ public class URLVerificationService {
|
||||
this.urlRepository = urlRepository;
|
||||
}
|
||||
|
||||
public URLEntity getURLEntityByQRCodeId(UUID qrCodeId) {
|
||||
logger.info("qrCodeId retrieving: {}", qrCodeId);
|
||||
return urlRepository.findByQrCodeId(qrCodeId)
|
||||
.orElseThrow(() -> new QRCodeExceptions("URL not found for QR Code id: " + qrCodeId));
|
||||
}
|
||||
|
||||
public void insertDB(URLEntity urlEntity) {
|
||||
urlRepository.save(urlEntity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user