-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/bytte endepukter til kodeverk service (#3454)
Oppdatere klienter til bruk av kodeverk-service
- Loading branch information
Showing
54 changed files
with
340 additions
and
756 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
51 changes: 0 additions & 51 deletions
51
apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkMapper.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...olly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.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,43 @@ | ||
package no.nav.dolly.consumer.kodeverk.command; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import no.nav.testnav.libs.dto.kodeverkservice.v1.KodeverkDTO; | ||
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import reactor.core.publisher.Mono; | ||
import reactor.util.retry.Retry; | ||
|
||
import java.time.Duration; | ||
import java.util.concurrent.Callable; | ||
|
||
@RequiredArgsConstructor | ||
public class KodeverkGetCommand implements Callable<Mono<KodeverkDTO>> { | ||
|
||
private static final String KODEVERK_URL = "/api/v1/kodeverk"; | ||
private static final String KODEVERK = "kodeverk"; | ||
|
||
private final WebClient webClient; | ||
private final String kodeverk; | ||
private final String token; | ||
|
||
@Override | ||
public Mono<KodeverkDTO> call() { | ||
|
||
return webClient.get() | ||
.uri(uriBuilder -> uriBuilder.path(KODEVERK_URL) | ||
.queryParam(KODEVERK, kodeverk) | ||
.build()) | ||
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token) | ||
.retrieve() | ||
.bodyToMono(KodeverkDTO.class) | ||
.doOnError(WebClientFilter::logErrorMessage) | ||
.onErrorResume(error -> Mono.just(KodeverkDTO.builder() | ||
.kodeverknavn(kodeverk) | ||
.status(WebClientFilter.getStatus(error)) | ||
.message(WebClientFilter.getMessage(error)) | ||
.build())) | ||
.retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) | ||
.filter(WebClientFilter::is5xxException)); | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
...kend/src/main/java/no/nav/dolly/consumer/kodeverk/domain/KodeverkBetydningerResponse.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeAdjusted.java
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
.../dolly-backend/src/main/java/no/nav/dolly/domain/resultset/kodeverk/KodeverkAdjusted.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.