spring-boot-axon-demo/src/main/kotlin/com/cubetiqs/demo/axon/api/AccountQueryController.kt
Sambo Chea d3e8d63287 completely implementation about cqrs and event sourcing
But not testing yet
And not yet for rest too for query
2020-08-21 11:30:40 +07:00

18 lines
697 B
Kotlin

package com.cubetiqs.demo.axon.api
import com.cubetiqs.demo.axon.entity.BankAccount
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import java.util.concurrent.CompletableFuture
class AccountQueryController {
@GetMapping("/{accountId}")
fun findById(@PathVariable("accountId") accountId: String?): CompletableFuture<BankAccount?>? {
return this.accountQueryService.findById(accountId)
}
@GetMapping("/{accountId}/events")
fun listEventsForAccount(@PathVariable(value = "accountId") accountId: String?): List<Any?>? {
return this.accountQueryService.listEventsForAccount(accountId)
}
}