From 345140bf5a5fb72f5b32859441497cc86e8ba7b2 Mon Sep 17 00:00:00 2001 From: JanardhanBS-SyncByte Date: Tue, 12 Nov 2024 13:24:08 +0530 Subject: [PATCH 1/2] [MOSIP-37358] Readme Signed-off-by: JanardhanBS-SyncByte --- kernel-bio-converter/README.md | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/kernel-bio-converter/README.md b/kernel-bio-converter/README.md index 66559ec..da108c4 100644 --- a/kernel-bio-converter/README.md +++ b/kernel-bio-converter/README.md @@ -106,7 +106,6 @@ Method: POST | Property | Description | | ----------------------| ------------ | -| values | key-value pairs, with base64 url encoded data | | sourceFormat | Http mime types, ISO formats [ISO19794_4_2011, ISO19794_5_2011, ISO19794_6_2011] | | sourceParameters | key-value pairs [IMAGE/JPEG, IMAGE/PNG] | | targetFormat | Http mime types, ISO formats | @@ -132,26 +131,27 @@ Method: POST } ``` -| Property | Description | -| -------- | ------------| -| response | key-value pairs, with base64 url encoded converted data | +| **Property** | **Description** | +| :----------- | :--------------------------------------------------------- | +| response | key-value pairs, with base64 url encoded converted data | + ## Error-codes: -| Code | Description | -| ------------| --------------------------------------------------------------------------------------------| -| MOS-CNV-001 | Input Source Request may be null or Source Format may be null or Target Format may be null | -| MOS-CNV-002 | Invalid Request Value | -| MOS-CNV-003 | Invalid Source Value or Source Format not supported | -| MOS-CNV-004 | Invalid Target Value or Target Format not supported | -| MOS-CNV-005 | Source value can not be empty or null | -| MOS-CNV-006 | Source not valid base64urlencoded | -| MOS-CNV-007 | Could not read Source ISO Image Data | -| MOS-CNV-008 | Source not valid ISO ISO19794_4_2011 | -| MOS-CNV-009 | Source not valid ISO ISO19794_5_2011 | -| MOS-CNV-010 | Source not valid ISO ISO19794_6_2011 | -| MOS-CNV-011 | Target format not valid | -| MOS-CNV-500 | Technical Error | +| **Code** | **Description** | +|----|----| +| MOS-CNV-001 | Input Source Request may be null or Source Format may be null or Target Format may be null | +| MOS-CNV-002 | Invalid Request Value | +| MOS-CNV-003 | Invalid Source Value or Source Format not supported | +| MOS-CNV-004 | Invalid Target Value or Target Format not supported | +| MOS-CNV-005 | Source value cannot be empty or null | +| MOS-CNV-006 | Source not valid base64urlencoded | +| MOS-CNV-007 | Could not read Source ISO Image Data | +| MOS-CNV-008 | Source not valid ISO ISO19794_4_2011 | +| MOS-CNV-009 | Source not valid ISO ISO19794_5_2011 | +| MOS-CNV-010 | Source not valid ISO ISO19794_6_2011 | +| MOS-CNV-011 | Target format not valid | +| MOS-CNV-500 | Technical Error | ## Configuration From c4e227f73ed563d981a6a81f3b5f3c4d848e8d11 Mon Sep 17 00:00:00 2001 From: JanardhanBS-SyncByte Date: Tue, 12 Nov 2024 13:28:06 +0530 Subject: [PATCH 2/2] [MOSIP-37358] Readme Signed-off-by: JanardhanBS-SyncByte --- .../bio/converter/dto/ConvertRequestDto.java | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/kernel-bio-converter/src/main/java/io/mosip/kernel/bio/converter/dto/ConvertRequestDto.java b/kernel-bio-converter/src/main/java/io/mosip/kernel/bio/converter/dto/ConvertRequestDto.java index e713cc2..c3c2d84 100644 --- a/kernel-bio-converter/src/main/java/io/mosip/kernel/bio/converter/dto/ConvertRequestDto.java +++ b/kernel-bio-converter/src/main/java/io/mosip/kernel/bio/converter/dto/ConvertRequestDto.java @@ -1,6 +1,7 @@ package io.mosip.kernel.bio.converter.dto; import java.util.Map; +import java.util.Objects; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; @@ -8,6 +9,7 @@ import javax.validation.constraints.Size; import lombok.Data; +import lombok.ToString; /** * Data Transfer Object for conversion requests in the bio converter service. @@ -35,6 +37,7 @@ */ @Data +@ToString public class ConvertRequestDto { /** * A map of values required for the conversion. The map must contain at least @@ -73,4 +76,43 @@ public class ConvertRequestDto { */ @SuppressWarnings({ "java:S1104" }) public Map targetParameters; -} + + public ConvertRequestDto() { + super(); + } + + public ConvertRequestDto( + @NotNull(message = "Values code can not be null") @Size(min = 1, message = "Minimum one entry required") Map values, + @NotNull(message = "SourceFormat code can not be null") @NotBlank(message = "SourceFormat code can not be blank") @NotEmpty(message = "SourceFormat code can not be empty") String sourceFormat, + @NotNull(message = "TargetFormat code can not be null") @NotBlank(message = "TargetFormat code can not be blank") @NotEmpty(message = "TargetFormat code can not be empty") String targetFormat, + Map sourceParameters, Map targetParameters) { + super(); + this.values = values; + this.sourceFormat = sourceFormat; + this.targetFormat = targetFormat; + this.sourceParameters = sourceParameters; + this.targetParameters = targetParameters; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + ConvertRequestDto that = (ConvertRequestDto) o; + return Objects.equals(values, that.values) && Objects.equals(sourceFormat, that.sourceFormat) + && Objects.equals(targetFormat, that.targetFormat) + && Objects.equals(sourceParameters, that.sourceParameters) + && Objects.equals(targetParameters, that.targetParameters); + } + + @Override + public int hashCode() { + return Objects.hash(values, sourceFormat, targetFormat, sourceParameters, targetParameters); + } + + public boolean canEqual(Object other) { + return other instanceof ConvertRequestDto; + } +} \ No newline at end of file