From 3b7d863b1adfdef590faf21e2913eb3a038549ec Mon Sep 17 00:00:00 2001 From: Valentyn Grygoriev Date: Wed, 24 May 2023 09:03:39 +0300 Subject: [PATCH] Added summary section into report #345 --- .../commons/model/SecHubReportMetaData.java | 6 ++++ .../commons/model/SecHubReportScan.java | 28 +++++++++++++++++++ .../commons/model/SecHubReportSummary.java | 26 +++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportScan.java create mode 100644 sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportSummary.java diff --git a/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportMetaData.java b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportMetaData.java index 12a94ef465..585b160bbe 100644 --- a/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportMetaData.java +++ b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportMetaData.java @@ -11,7 +11,13 @@ public class SecHubReportMetaData { private Map labels = new LinkedHashMap<>(); + private SecHubReportSummary summary = new SecHubReportSummary(); + public Map getLabels() { return labels; } + + public SecHubReportSummary getSummary() { + return summary; + } } diff --git a/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportScan.java b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportScan.java new file mode 100644 index 0000000000..f5551f5c11 --- /dev/null +++ b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportScan.java @@ -0,0 +1,28 @@ +package com.mercedesbenz.sechub.commons.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class SecHubReportScan { + + private long total = 0; + private long red = 0; + private long yellow = 0; + private long green = 0; + + public long getTotal() { + return total; + } + + public long getRed() { + return red; + } + + public long getYellow() { + return yellow; + } + + public long getGreen() { + return green; + } +} diff --git a/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportSummary.java b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportSummary.java new file mode 100644 index 0000000000..6a3a0e207a --- /dev/null +++ b/sechub-commons-model/src/main/java/com/mercedesbenz/sechub/commons/model/SecHubReportSummary.java @@ -0,0 +1,26 @@ +package com.mercedesbenz.sechub.commons.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class SecHubReportSummary { + + SecHubReportScan codeScan = new SecHubReportScan(); + SecHubReportScan infraScan = new SecHubReportScan(); + + public SecHubReportScan getCodeScan() { + return codeScan; + } + + public void setCodeScan(SecHubReportScan codeScan) { + this.codeScan = codeScan; + } + + public SecHubReportScan getInfraScan() { + return infraScan; + } + + public void setInfraScan(SecHubReportScan infraScan) { + this.infraScan = infraScan; + } +}