Skip to content

Commit 9d28bc9

Browse files
authored
release: 0.8.8 (#97)
2 parents 086a50b + 2ffd2d5 commit 9d28bc9

File tree

8 files changed

+44
-0
lines changed

8 files changed

+44
-0
lines changed

src/main/kotlin/org/gitanimals/auction/infra/RestIdentityApi.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package org.gitanimals.auction.infra
22

33
import io.jsonwebtoken.JwtException
44
import org.gitanimals.auction.app.IdentityApi
5+
import org.gitanimals.core.filter.MDCFilter.Companion.TRACE_ID
6+
import org.slf4j.MDC
57
import org.springframework.beans.factory.annotation.Qualifier
68
import org.springframework.beans.factory.annotation.Value
79
import org.springframework.http.HttpHeaders
@@ -18,6 +20,7 @@ class RestIdentityApi(
1820
return restClient.get()
1921
.uri("/users")
2022
.header(HttpHeaders.AUTHORIZATION, token)
23+
.header(TRACE_ID, MDC.get(TRACE_ID))
2124
.exchange { _, response ->
2225
runCatching {
2326
response.bodyTo(IdentityApi.UserResponse::class.java)
@@ -35,6 +38,7 @@ class RestIdentityApi(
3538
return restClient.get()
3639
.uri("/internals/users/$userId")
3740
.header(INTERNAL_SECRET_KEY, internalSecret)
41+
.header(TRACE_ID, MDC.get(TRACE_ID))
3842
.exchange { _, response ->
3943
runCatching {
4044
response.bodyTo(IdentityApi.UserResponse::class.java)
@@ -52,6 +56,7 @@ class RestIdentityApi(
5256
return restClient.post()
5357
.uri("/internals/users/points/decreases?point=$point&idempotency-key=$idempotencyKey")
5458
.header(HttpHeaders.AUTHORIZATION, token)
59+
.header(TRACE_ID, MDC.get(TRACE_ID))
5560
.header(INTERNAL_SECRET_KEY, internalSecret)
5661
.exchange { _, response ->
5762
if (response.statusCode.is2xxSuccessful) {
@@ -67,6 +72,7 @@ class RestIdentityApi(
6772
return restClient.post()
6873
.uri("/internals/users/points/increases?point=$point&idempotency-key=$idempotencyKey")
6974
.header(HttpHeaders.AUTHORIZATION, token)
75+
.header(TRACE_ID, MDC.get(TRACE_ID))
7076
.header(INTERNAL_SECRET_KEY, internalSecret)
7177
.exchange { _, response ->
7278
if (response.statusCode.is2xxSuccessful) {
@@ -82,6 +88,7 @@ class RestIdentityApi(
8288
return restClient.post()
8389
.uri("/internals/users/points/decreases/$userId?point=$point&idempotency-key=$idempotencyKey")
8490
.header(INTERNAL_SECRET_KEY, internalSecret)
91+
.header(TRACE_ID, MDC.get(TRACE_ID))
8592
.exchange { _, response ->
8693
if (response.statusCode.is2xxSuccessful) {
8794
return@exchange
@@ -96,6 +103,7 @@ class RestIdentityApi(
96103
return restClient.post()
97104
.uri("/internals/users/points/increases/$userId?point=$point&idempotency-key=$idempotencyKey")
98105
.header(INTERNAL_SECRET_KEY, internalSecret)
106+
.header(TRACE_ID, MDC.get(TRACE_ID))
99107
.exchange { _, response ->
100108
if (response.statusCode.is2xxSuccessful) {
101109
return@exchange

src/main/kotlin/org/gitanimals/auction/infra/RestRenderApi.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.gitanimals.auction.infra
22

33
import org.gitanimals.auction.app.RenderApi
4+
import org.gitanimals.core.filter.MDCFilter
5+
import org.slf4j.MDC
46
import org.springframework.beans.factory.annotation.Qualifier
57
import org.springframework.beans.factory.annotation.Value
68
import org.springframework.http.HttpHeaders
@@ -17,6 +19,7 @@ class RestRenderApi(
1719
return restClient.get()
1820
.uri("/personas/$personaId")
1921
.header(HttpHeaders.AUTHORIZATION, token)
22+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
2023
.exchange { _, response ->
2124
runCatching {
2225
response.bodyTo(RenderApi.PersonaResponse::class.java)
@@ -34,6 +37,7 @@ class RestRenderApi(
3437
return restClient.delete()
3538
.uri("/internals/personas?persona-id=$personaId")
3639
.header(HttpHeaders.AUTHORIZATION, token)
40+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
3741
.header("Internal-Secret", internalSecret)
3842
.exchange { _, response ->
3943
require(response.statusCode.is2xxSuccessful) { "Cannot delete persona by personaId \"$personaId\"" }
@@ -50,6 +54,7 @@ class RestRenderApi(
5054
return restClient.post()
5155
.uri("/internals/personas?idempotency-key=$idempotencyKey")
5256
.header(HttpHeaders.AUTHORIZATION, token)
57+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
5358
.header("Internal-Secret", internalSecret)
5459
.body(AddPersonaRequest(personaId, personaType, personaLevel))
5560
.exchange { _, response ->

src/main/kotlin/org/gitanimals/coupon/infra/RestIdentityApi.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package org.gitanimals.coupon.infra
22

33
import io.jsonwebtoken.JwtException
4+
import org.gitanimals.core.filter.MDCFilter
45
import org.gitanimals.coupon.app.IdentityApi
56
import org.gitanimals.coupon.app.response.UserResponse
7+
import org.slf4j.MDC
68
import org.springframework.http.HttpHeaders
79
import org.springframework.stereotype.Component
810
import org.springframework.web.client.RestClient
@@ -16,6 +18,7 @@ class RestIdentityApi : IdentityApi {
1618
return restClient.get()
1719
.uri("/users")
1820
.header(HttpHeaders.AUTHORIZATION, token)
21+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
1922
.exchange { _, response ->
2023
runCatching {
2124
response.bodyTo(UserResponse::class.java)

src/main/kotlin/org/gitanimals/gotcha/infra/RestRenderApi.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.gitanimals.gotcha.infra
22

3+
import org.gitanimals.core.filter.MDCFilter
34
import org.gitanimals.gotcha.app.RenderApi
5+
import org.slf4j.MDC
46
import org.springframework.beans.factory.annotation.Qualifier
57
import org.springframework.beans.factory.annotation.Value
68
import org.springframework.core.ParameterizedTypeReference
@@ -33,6 +35,7 @@ class RestRenderApi(
3335
.uri("/internals/personas/multiply")
3436
.header(HttpHeaders.AUTHORIZATION, token)
3537
.header("Internal-Secret", internalSecret)
38+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
3639
.contentType(MediaType.APPLICATION_JSON)
3740
.body(request)
3841
.exchange { _, response ->
@@ -58,6 +61,7 @@ class RestRenderApi(
5861
restClient.delete()
5962
.uri("/internals/personas?persona-id=$personaId")
6063
.header(HttpHeaders.AUTHORIZATION, token)
64+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
6165
.header("Internal-Secret", internalSecret)
6266
.exchange { _, response ->
6367
require(response.statusCode.is2xxSuccessful) { "Cannot delete persona by personaId \"$personaId\"" }
@@ -67,6 +71,7 @@ class RestRenderApi(
6771
override fun getAllPersonas(): RenderApi.PersonaWithDropRateResponse {
6872
return restClient.get()
6973
.uri("/personas/infos")
74+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
7075
.exchange { _, response ->
7176
check(response.statusCode.is2xxSuccessful) { "Cannot get all pets \"/personas/infos\"" }
7277

src/main/kotlin/org/gitanimals/gotcha/infra/RestUserApi.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package org.gitanimals.gotcha.infra
22

33
import io.jsonwebtoken.ExpiredJwtException
44
import io.jsonwebtoken.JwtException
5+
import org.gitanimals.core.filter.MDCFilter
56
import org.gitanimals.gotcha.app.UserApi
67
import org.gitanimals.gotcha.app.response.UserResponse
8+
import org.slf4j.MDC
79
import org.springframework.beans.factory.annotation.Qualifier
810
import org.springframework.beans.factory.annotation.Value
911
import org.springframework.http.HttpHeaders
@@ -20,6 +22,7 @@ class RestUserApi(
2022
return restClient.get()
2123
.uri("/users")
2224
.header(HttpHeaders.AUTHORIZATION, token)
25+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
2326
.exchange { _, response ->
2427
runCatching {
2528
response.bodyTo(UserResponse::class.java)
@@ -34,6 +37,7 @@ class RestUserApi(
3437
.uri("/internals/users/points/decreases?point=$point&idempotency-key=$idempotencyKey")
3538
.header(HttpHeaders.AUTHORIZATION, token)
3639
.header("Internal-Secret", internalSecret)
40+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
3741
.exchange { _, response ->
3842
if (response.statusCode.is2xxSuccessful) {
3943
return@exchange
@@ -48,6 +52,7 @@ class RestUserApi(
4852
return restClient.post()
4953
.uri("/internals/users/points/increases?point=$point&idempotency-key=$idempotencyKey")
5054
.header(HttpHeaders.AUTHORIZATION, token)
55+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
5156
.exchange { _, response ->
5257
if (response.statusCode.is2xxSuccessful) {
5358
return@exchange

src/main/kotlin/org/gitanimals/inbox/infra/RestIdentityApi.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package org.gitanimals.inbox.infra
22

33
import io.jsonwebtoken.JwtException
4+
import org.gitanimals.core.filter.MDCFilter
45
import org.gitanimals.inbox.app.IdentityApi
6+
import org.slf4j.MDC
57
import org.springframework.beans.factory.annotation.Qualifier
68
import org.springframework.beans.factory.annotation.Value
79
import org.springframework.http.HttpHeaders
@@ -18,6 +20,7 @@ class RestIdentityApi(
1820
return restClient.get()
1921
.uri("/users")
2022
.header(HttpHeaders.AUTHORIZATION, token)
23+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
2124
.exchange { _, response ->
2225
runCatching {
2326
response.bodyTo(IdentityApi.UserResponse::class.java)

src/main/kotlin/org/gitanimals/shop/infra/RestIdentityApi.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package org.gitanimals.shop.infra
22

33
import io.jsonwebtoken.JwtException
4+
import org.gitanimals.core.filter.MDCFilter
45
import org.gitanimals.shop.app.IdentityApi
6+
import org.slf4j.MDC
57
import org.springframework.beans.factory.annotation.Qualifier
68
import org.springframework.beans.factory.annotation.Value
79
import org.springframework.http.HttpHeaders
@@ -18,6 +20,7 @@ class RestIdentityApi(
1820
return restClient.get()
1921
.uri("/users")
2022
.header(HttpHeaders.AUTHORIZATION, token)
23+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
2124
.exchange { _, response ->
2225
runCatching {
2326
response.bodyTo(IdentityApi.UserResponse::class.java)
@@ -36,6 +39,7 @@ class RestIdentityApi(
3639
.uri("/internals/users/points/decreases?point=$point&idempotency-key=$idempotencyKey")
3740
.header(HttpHeaders.AUTHORIZATION, token)
3841
.header("Internal-Secret", internalSecret)
42+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
3943
.exchange { _, response ->
4044
if (response.statusCode.is2xxSuccessful) {
4145
return@exchange
@@ -51,6 +55,7 @@ class RestIdentityApi(
5155
.uri("/internals/users/points/increases?point=$point&idempotency-key=$idempotencyKey")
5256
.header(HttpHeaders.AUTHORIZATION, token)
5357
.header("Internal-Secret", internalSecret)
58+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
5459
.exchange { _, response ->
5560
if (response.statusCode.is2xxSuccessful) {
5661
return@exchange
@@ -65,6 +70,7 @@ class RestIdentityApi(
6570
return restClient.post()
6671
.uri("/internals/users/points/decreases/$userId?point=$point&idempotency-key=$idempotencyKey")
6772
.header("Internal-Secret", internalSecret)
73+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
6874
.exchange { _, response ->
6975
if (response.statusCode.is2xxSuccessful) {
7076
return@exchange
@@ -79,6 +85,7 @@ class RestIdentityApi(
7985
return restClient.post()
8086
.uri("/internals/users/points/increases/$userId?point=$point&idempotency-key=$idempotencyKey")
8187
.header("Internal-Secret", internalSecret)
88+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
8289
.exchange { _, response ->
8390
if (response.statusCode.is2xxSuccessful) {
8491
return@exchange

src/main/kotlin/org/gitanimals/shop/infra/RestRenderApi.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.gitanimals.shop.infra
22

3+
import org.gitanimals.core.filter.MDCFilter
34
import org.gitanimals.shop.app.RenderApi
5+
import org.slf4j.MDC
46
import org.springframework.beans.factory.annotation.Qualifier
57
import org.springframework.beans.factory.annotation.Value
68
import org.springframework.core.ParameterizedTypeReference
@@ -19,6 +21,7 @@ class RestRenderApi(
1921
return restClient.get()
2022
.uri("/personas/$personaId")
2123
.header(HttpHeaders.AUTHORIZATION, token)
24+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
2225
.exchange { _, response ->
2326
runCatching {
2427
response.bodyTo(RenderApi.PersonaResponse::class.java)
@@ -36,6 +39,7 @@ class RestRenderApi(
3639
return restClient.delete()
3740
.uri("/internals/personas?persona-id=$personaId")
3841
.header(HttpHeaders.AUTHORIZATION, token)
42+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
3943
.header("Internal-Secret", internalSecret)
4044
.exchange { _, response ->
4145
require(response.statusCode.is2xxSuccessful) { "Cannot delete persona by personaId \"$personaId\"" }
@@ -46,6 +50,7 @@ class RestRenderApi(
4650
return restClient.post()
4751
.uri("/internals/backgrounds?name=$backgroundName")
4852
.header(HttpHeaders.AUTHORIZATION, token)
53+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
4954
.header("Internal-Secret", internalSecret)
5055
.exchange { _, response ->
5156
if (response.statusCode.is4xxClientError) {
@@ -61,6 +66,7 @@ class RestRenderApi(
6166
return restClient.delete()
6267
.uri("/internals/backgrounds?name=$backgroundName")
6368
.header(HttpHeaders.AUTHORIZATION, token)
69+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
6470
.header("Internal-Secret", internalSecret)
6571
.exchange { _, response ->
6672
require(response.statusCode.is2xxSuccessful) { "Cannot delete background by backgroundName: \"$backgroundName\"" }
@@ -77,6 +83,7 @@ class RestRenderApi(
7783
return restClient.post()
7884
.uri("/internals/personas?idempotency-key=$idempotencyKey")
7985
.header(HttpHeaders.AUTHORIZATION, token)
86+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
8087
.header("Internal-Secret", internalSecret)
8188
.body(AddPersonaRequest(personaId, personaType, personaLevel))
8289
.exchange { _, response ->
@@ -103,6 +110,7 @@ class RestRenderApi(
103110
return restClient.post()
104111
.uri("/internals/personas/multiply")
105112
.header(HttpHeaders.AUTHORIZATION, token)
113+
.header(MDCFilter.TRACE_ID, MDC.get(MDCFilter.TRACE_ID))
106114
.header("Internal-Secret", internalSecret)
107115
.contentType(MediaType.APPLICATION_JSON)
108116
.body(request)

0 commit comments

Comments
 (0)