added new endpoints, getUser, getUserHistories, getBookmarks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.safeqr.app.qrcode.service;
|
||||
|
||||
import com.safeqr.app.exceptions.CustomNotFoundExceptions;
|
||||
import com.safeqr.app.qrcode.entity.SMSEntity;
|
||||
import com.safeqr.app.qrcode.repository.SMSRepository;
|
||||
import org.slf4j.Logger;
|
||||
@@ -7,6 +8,8 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class SMSVerificationService {
|
||||
private final SMSRepository smsRepository;
|
||||
@@ -16,6 +19,12 @@ public class SMSVerificationService {
|
||||
public SMSVerificationService(SMSRepository smsRepository) {
|
||||
this.smsRepository = smsRepository;
|
||||
}
|
||||
|
||||
public SMSEntity getSMSEntityByQRCodeId(UUID qrCodeId) {
|
||||
logger.info("qrCodeId retrieving: {}", qrCodeId);
|
||||
return smsRepository.findByQrCodeId(qrCodeId)
|
||||
.orElseThrow(() -> new CustomNotFoundExceptions("SMS not found for QR Code id: " + qrCodeId));
|
||||
}
|
||||
public void insertDB(SMSEntity smsEntity) {
|
||||
smsRepository.save(smsEntity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user