generated from aura-ascend/template-service
add AccountService
This commit is contained in:
19
src/main/kotlin/ltd/lulz/service/AccountService.kt
Normal file
19
src/main/kotlin/ltd/lulz/service/AccountService.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package ltd.lulz.service
|
||||
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import ltd.lulz.model.AccountEntity
|
||||
import ltd.lulz.repository.AccountRepository
|
||||
import org.springframework.stereotype.Service
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
private val log = KotlinLogging.logger {}
|
||||
|
||||
@Service
|
||||
class AccountService(
|
||||
private val accountRepository: AccountRepository,
|
||||
) {
|
||||
|
||||
fun create(entity: AccountEntity): Mono<AccountEntity> = accountRepository
|
||||
.save(entity)
|
||||
.doOnNext { log.debug { "account created with id: ${it.id}" } }
|
||||
}
|
||||
Reference in New Issue
Block a user