-
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.
Merge branch 'main' into deadlock-protection
- Loading branch information
Showing
16 changed files
with
108 additions
and
35 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
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
28 changes: 28 additions & 0 deletions
28
src/main/kotlin/no/nav/bidrag/behandling/consumer/BidragPersonConsumer.kt
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,28 @@ | ||
package no.nav.bidrag.behandling.consumer | ||
|
||
import no.nav.bidrag.behandling.config.CacheConfig.Companion.PERSON_CACHE | ||
import no.nav.bidrag.behandling.dto.HentPersonRequest | ||
import no.nav.bidrag.behandling.dto.HentPersonResponse | ||
import no.nav.bidrag.commons.cache.BrukerCacheable | ||
import no.nav.bidrag.commons.web.client.AbstractRestClient | ||
import org.springframework.beans.factory.annotation.Qualifier | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.stereotype.Service | ||
import org.springframework.web.client.RestTemplate | ||
import org.springframework.web.util.UriComponentsBuilder | ||
import java.net.URI | ||
|
||
@Service | ||
class BidragPersonConsumer( | ||
@Value("\${BIDRAG_PERSON_URL}") bidragPersonUrl: URI, | ||
@Qualifier("azure") restTemplate: RestTemplate, | ||
) : AbstractRestClient(restTemplate, "bidrag-person") { | ||
|
||
private val hentPersonUri = | ||
UriComponentsBuilder.fromUri(bidragPersonUrl).pathSegment("informasjon").build().toUri() | ||
|
||
@BrukerCacheable(PERSON_CACHE) | ||
fun hentPerson(ident: String): HentPersonResponse { | ||
return postForNonNullEntity(hentPersonUri, HentPersonRequest(ident)) | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/no/nav/bidrag/behandling/dto/HentPersonRequest.kt
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,3 @@ | ||
package no.nav.bidrag.behandling.dto | ||
|
||
data class HentPersonRequest(val ident: String) |
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/no/nav/bidrag/behandling/dto/HentPersonResponse.kt
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 no.nav.bidrag.behandling.dto | ||
|
||
data class HentPersonResponse( | ||
val ident: String, | ||
val fødselsdato: String, | ||
) |
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