Added new end point, edited getEmails to be Async all and return 202 status code

This commit is contained in:
heyethereum
2024-08-04 19:37:16 +08:00
parent 0fde70a4b6
commit 76036a2d91
17 changed files with 593 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
package com.safeqr.app.gmail.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.safeqr.app.qrcode.model.QRCodeModel;
import lombok.Data;
import java.util.ArrayList;
@@ -8,6 +9,7 @@ import java.util.List;
@Data
public class EmailMessage {
private String messageId;
private String threadId;
private String subject;
private String historyId;
private String date;
@@ -18,13 +20,18 @@ public class EmailMessage {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
List<QRCodeByURL> qrCodeByURL;
public EmailMessage(String messageId, String subject, String historyId, String date) {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
List<QRCodeModel<?>> decodedContentsDetails;
public EmailMessage(String messageId, String threadId ,String subject, String historyId, String date) {
this.messageId = messageId;
this.threadId = threadId;
this.subject = subject;
this.historyId = historyId;
this.date = date;
this.qrCodeByContentId = new ArrayList<>();
this.qrCodeByURL = new ArrayList<>();
this.decodedContentsDetails = new ArrayList<>();
}
public void addQRCodeByContentId(QRCodeByContentId qrCode) {
this.qrCodeByContentId.add(qrCode);
@@ -34,6 +41,10 @@ public class EmailMessage {
this.qrCodeByURL.add(qrCode);
}
public void addQRCodeModel(QRCodeModel<?> qrCode) {
this.decodedContentsDetails.add(qrCode);
}
public boolean hasQRCodes() {
return !qrCodeByContentId.isEmpty() || !qrCodeByURL.isEmpty();
}