Compare commits
No commits in common. "857d97c1420aefd119e50a5ec46826f0f76ed142" and "371c4fa5aa7de64681ffd871c9d3ceef31ac3e46" have entirely different histories.
857d97c142
...
371c4fa5aa
@ -1,8 +1,8 @@
|
|||||||
# Spring Boot + Axon Framework
|
# Spring Boot + Axon Framework
|
||||||
### Concepts to implement
|
### Concepts to implement
|
||||||
- [x] Event Sourcing
|
- [ ] Event Sourcing
|
||||||
- [x] CQRS System
|
|
||||||
- [ ] DDD
|
- [ ] DDD
|
||||||
|
- [ ] CQRS System
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
- [x] Sambo Chea <sombochea@cubetiqs.com>
|
- [x] Sambo Chea <sombochea@cubetiqs.com>
|
@ -2,6 +2,10 @@ package com.cubetiqs.demo.axon
|
|||||||
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||||
import org.springframework.boot.runApplication
|
import org.springframework.boot.runApplication
|
||||||
|
import org.springframework.http.ResponseEntity
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
class AxonApplication
|
class AxonApplication
|
||||||
@ -9,3 +13,12 @@ class AxonApplication
|
|||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
runApplication<AxonApplication>(*args)
|
runApplication<AxonApplication>(*args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping
|
||||||
|
class DefaultController {
|
||||||
|
@GetMapping
|
||||||
|
fun index(): ResponseEntity<Any> {
|
||||||
|
return ResponseEntity.ok("ok")
|
||||||
|
}
|
||||||
|
}
|
@ -40,7 +40,7 @@ class AccountCommandController @Autowired constructor(
|
|||||||
fun debitMoneyFromAccount(
|
fun debitMoneyFromAccount(
|
||||||
@PathVariable(value = "accountId") accountId: String,
|
@PathVariable(value = "accountId") accountId: String,
|
||||||
@RequestBody moneyDebitDTO: MoneyAmountDTO
|
@RequestBody moneyDebitDTO: MoneyAmountDTO
|
||||||
): CompletableFuture<String?> {
|
): CompletableFuture<String?>? {
|
||||||
return this.accountCommandService.debitMoneyFromAccount(accountId, moneyDebitDTO)
|
return this.accountCommandService.debitMoneyFromAccount(accountId, moneyDebitDTO)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,14 +10,12 @@ import springfox.documentation.spi.DocumentationType
|
|||||||
import springfox.documentation.spring.web.plugins.Docket
|
import springfox.documentation.spring.web.plugins.Docket
|
||||||
import springfox.documentation.swagger2.annotations.EnableSwagger2
|
import springfox.documentation.swagger2.annotations.EnableSwagger2
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import java.util.concurrent.CompletableFuture
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
class SwaggerConfiguration {
|
class SwaggerConfiguration {
|
||||||
@Bean
|
@Bean
|
||||||
fun apiDocket(): Docket {
|
fun apiDocket(): Docket {
|
||||||
val ignoreClasses = arrayListOf(CompletableFuture::class.java).toTypedArray()
|
|
||||||
return Docket(DocumentationType.SWAGGER_2)
|
return Docket(DocumentationType.SWAGGER_2)
|
||||||
.select()
|
.select()
|
||||||
.apis(
|
.apis(
|
||||||
@ -26,7 +24,6 @@ class SwaggerConfiguration {
|
|||||||
)
|
)
|
||||||
.paths(PathSelectors.any())
|
.paths(PathSelectors.any())
|
||||||
.build()
|
.build()
|
||||||
.ignoredParameterTypes(*ignoreClasses)
|
|
||||||
.apiInfo(apiInfo)
|
.apiInfo(apiInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user