generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: migrating to new statuses' flow (#13)
* fix: migrating to new statuses' flow * fix: adding missing methods --------- Co-authored-by: pagopa-github-bot <[email protected]>
- Loading branch information
1 parent
0e26594
commit d3082d0
Showing
31 changed files
with
270 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...in/java/it/gov/pagopa/wispconverter/technicalsupport/controller/mapper/ReEventMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package it.gov.pagopa.wispconverter.technicalsupport.controller.mapper; | ||
|
||
import it.gov.pagopa.wispconverter.technicalsupport.controller.model.ReEvent; | ||
import it.gov.pagopa.wispconverter.technicalsupport.repository.model.ReEventEntity; | ||
import it.gov.pagopa.wispconverter.technicalsupport.util.Constants; | ||
import org.mapstruct.*; | ||
|
||
import java.util.List; | ||
|
||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
public abstract class ReEventMapper { | ||
|
||
@Named("toDto") | ||
@Mapping(target = "requestHeaders", expression = "java(obfuscateSecrets(reEventEntity.getRequestHeaders()))") | ||
@Mapping(target = "responseHeaders", expression = "java(obfuscateSecrets(reEventEntity.getResponseHeaders()))") | ||
@Mapping(target = "requestPayload", expression = "java(it.gov.pagopa.wispconverter.technicalsupport.util.CommonUtility.decompressGZip(reEventEntity.getRequestPayload()))") | ||
@Mapping(target = "responsePayload", expression = "java(it.gov.pagopa.wispconverter.technicalsupport.util.CommonUtility.decompressGZip(reEventEntity.getResponsePayload()))") | ||
@Mapping(target = "operationId", expression = "java(reEventEntity.getOperationId() != null ? reEventEntity.getOperationId() : reEventEntity.getSessionId())") | ||
@Mapping(target = "insertedTimestamp", expression = "java(reEventEntity.getInsertedTimestamp().plus(1, java.time.temporal.ChronoUnit.HOURS))") | ||
public abstract ReEvent toDto(ReEventEntity reEventEntity); | ||
|
||
@IterableMapping(qualifiedByName = "toDto") | ||
public abstract List<ReEvent> toDto(List<ReEventEntity> reEventEntity); | ||
|
||
public void compact(ReEvent event) { | ||
event.setId(null); | ||
event.setOperationId(null); | ||
event.setHttpMethod(null); | ||
event.setExecutionTimeMs(null); | ||
event.setRequestHeaders(null); | ||
event.setResponseHeaders(null); | ||
event.setOperationErrorLine(null); | ||
event.setOperationErrorDetail(null); | ||
event.setSessionId(null); | ||
event.setPsp(null); | ||
event.setChannel(null); | ||
event.setInfo(null); | ||
event.setRequestPayload(null); | ||
event.setResponsePayload(null); | ||
} | ||
|
||
public String obfuscateSecrets(String httpHeaders) { | ||
if (httpHeaders != null) { | ||
httpHeaders = httpHeaders.replaceAll(Constants.SUBSCRIPTION_KEY_PATTERN, "\"Ocp-Apim-Subscription-Key\": [***]"); | ||
} | ||
return httpHeaders; | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
...ov/pagopa/wispconverter/technicalsupport/controller/mapper/TechnicalSupportMapperDto.java
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...java/it/gov/pagopa/wispconverter/technicalsupport/controller/model/EventCategoryEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package it.gov.pagopa.wispconverter.technicalsupport.controller.model; | ||
|
||
public enum EventCategoryEnum { | ||
INTERFACE, | ||
INTERNAL | ||
} |
Oops, something went wrong.