Initial completion of scanning of qr code from gmail

This commit is contained in:
heyethereum
2024-07-28 03:07:23 +08:00
parent 20c9473bd3
commit 3567457026
7 changed files with 206 additions and 60 deletions

View File

@@ -0,0 +1,38 @@
package com.safeqr.app.gmail.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class EmailMessage {
private String messageId;
private String subject;
private String historyId;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
List<QRCodeByContentId> qrCodeByContentId;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
List<QRCodeByURL> qrCodeByURL;
public EmailMessage(String messageId, String subject, String historyId) {
this.messageId = messageId;
this.subject = subject;
this.historyId = historyId;
this.qrCodeByContentId = new ArrayList<>();
this.qrCodeByURL = new ArrayList<>();
}
public void addQRCodeByContentId(QRCodeByContentId qrCode) {
this.qrCodeByContentId.add(qrCode);
}
public void addQRCodeByURL(QRCodeByURL qrCode) {
this.qrCodeByURL.add(qrCode);
}
public boolean hasQRCodes() {
return !qrCodeByContentId.isEmpty() || !qrCodeByURL.isEmpty();
}
}