Skip to content

Commit a7391d0

Browse files
committed
adding from to the microservice response
1 parent c7a6306 commit a7391d0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

SimpleMicroservice/src/main/kotlin/org/learning/by/example/SpringKubeGateway/SimpleMicroservice/SimpleHandler.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ import org.springframework.web.reactive.function.server.ServerRequest
55
import org.springframework.web.reactive.function.server.ServerResponse
66
import org.springframework.web.reactive.function.server.body
77
import reactor.core.publisher.toMono
8+
import java.util.*
89

910
@Component
1011
class SimpleHandler(val simpleService: SimpleService) {
1112

13+
companion object {
14+
val id = UUID.randomUUID().toString()
15+
}
16+
1217
fun getHello(serverRequest: ServerRequest) = ServerResponse.ok()
13-
.body(SimpleResponse(simpleService.getMessage()).toMono())
18+
.body(SimpleResponse(simpleService.getMessage(), id).toMono())
1419

1520
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package org.learning.by.example.SpringKubeGateway.SimpleMicroservice
22

3-
data class SimpleResponse(val message: String = "")
3+
data class SimpleResponse(val message: String = "", val from : String = "")

0 commit comments

Comments
 (0)