generated from aura-ascend/template-service
add account data
- AccountRepository - AccountEntity - 001-accounts.sql - Account with Request and Response
This commit is contained in:
17
src/main/kotlin/ltd/lulz/model/Account.kt
Normal file
17
src/main/kotlin/ltd/lulz/model/Account.kt
Normal file
@@ -0,0 +1,17 @@
|
||||
package ltd.lulz.model
|
||||
|
||||
import java.math.BigDecimal
|
||||
import java.util.UUID
|
||||
|
||||
object Account {
|
||||
data class Request(
|
||||
val name: String,
|
||||
val amount: BigDecimal,
|
||||
)
|
||||
|
||||
data class Response(
|
||||
val id: UUID,
|
||||
val name: String,
|
||||
val amount: BigDecimal,
|
||||
)
|
||||
}
|
||||
14
src/main/kotlin/ltd/lulz/model/AccountEntity.kt
Normal file
14
src/main/kotlin/ltd/lulz/model/AccountEntity.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package ltd.lulz.model
|
||||
|
||||
import java.math.BigDecimal
|
||||
import java.util.UUID
|
||||
import org.springframework.data.annotation.Id
|
||||
import org.springframework.data.relational.core.mapping.Table
|
||||
|
||||
@Table("accounts")
|
||||
data class AccountEntity(
|
||||
@Id
|
||||
val id: UUID? = null,
|
||||
val name: String,
|
||||
val amount: BigDecimal,
|
||||
)
|
||||
9
src/main/kotlin/ltd/lulz/repository/AccountRepository.kt
Normal file
9
src/main/kotlin/ltd/lulz/repository/AccountRepository.kt
Normal file
@@ -0,0 +1,9 @@
|
||||
package ltd.lulz.repository
|
||||
|
||||
import java.util.UUID
|
||||
import ltd.lulz.model.AccountEntity
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository
|
||||
import org.springframework.stereotype.Repository
|
||||
|
||||
@Repository
|
||||
interface AccountRepository : ReactiveCrudRepository<AccountEntity, UUID>
|
||||
Reference in New Issue
Block a user