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.
[PAGOPA-2154] Merge branch 'main' into PAGOPA-2154-bug-richieste-con-…
…anagrafica-pagatore-blank # Conflicts: # helm/Chart.yaml # helm/values-dev.yaml # helm/values-prod.yaml # helm/values-uat.yaml # openapi/openapi.json # openapi/openapi_redirect.json # pom.xml
- Loading branch information
Showing
62 changed files
with
1,793 additions
and
365 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
68 changes: 68 additions & 0 deletions
68
src/main/java/it/gov/pagopa/wispconverter/config/SecondaryCosmosConfig.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,68 @@ | ||
package it.gov.pagopa.wispconverter.config; | ||
|
||
import com.azure.cosmos.CosmosAsyncClient; | ||
import com.azure.cosmos.CosmosClientBuilder; | ||
import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; | ||
import com.azure.spring.data.cosmos.config.CosmosConfig; | ||
import com.azure.spring.data.cosmos.core.CosmosTemplate; | ||
import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; | ||
import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.List; | ||
|
||
@Configuration | ||
@EnableCosmosRepositories(basePackages = "it.gov.pagopa.wispconverter.secondary") | ||
@EnableConfigurationProperties | ||
@ConditionalOnExpression("'${info.properties.environment}'!='test'") | ||
@Slf4j | ||
public class SecondaryCosmosConfig extends AbstractCosmosConfiguration { | ||
|
||
@Value("${azure.cosmos.uri}") | ||
private String cosmosUri; | ||
|
||
@Value("${azure.cosmos.key}") | ||
private String cosmosKey; | ||
|
||
@Value("${azure.cosmos.database}") | ||
private String cosmosDatabase; | ||
|
||
@Value("${azure.cosmos.read.region}") | ||
private String readRegion; | ||
|
||
@Value("${azure.cosmos.populate-query-metrics}") | ||
private Boolean cosmosQueryMetrics; | ||
|
||
@Bean(name = "secondaryCosmosClient") | ||
public CosmosAsyncClient getCosmosAsyncClient() { | ||
return new CosmosClientBuilder() | ||
.key(cosmosKey) | ||
.endpoint(cosmosUri) | ||
.preferredRegions(List.of(readRegion)) | ||
.buildAsyncClient(); | ||
} | ||
|
||
@Bean(name = "secondaryCosmosTemplate") | ||
public CosmosTemplate secondaryCosmosTemplate(@Qualifier("secondaryCosmosClient") CosmosAsyncClient client, | ||
MappingCosmosConverter mappingCosmosConverter) { | ||
return new CosmosTemplate(client, cosmosDatabase, cosmosConfig(), mappingCosmosConverter); | ||
} | ||
|
||
@Override | ||
public CosmosConfig cosmosConfig() { | ||
return CosmosConfig.builder() | ||
.enableQueryMetrics(cosmosQueryMetrics) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected String getDatabaseName() { | ||
return cosmosDatabase; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/it/gov/pagopa/wispconverter/controller/model/RecoveryProxyReceiptRequest.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,17 @@ | ||
package it.gov.pagopa.wispconverter.controller.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder(toBuilder = true) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class RecoveryProxyReceiptRequest { | ||
|
||
private List<String> receiptIds; | ||
} |
Oops, something went wrong.