add AccountService

This commit is contained in:
2025-09-11 11:56:33 +02:00
parent 12bc74c1e6
commit 79357e4f4d
3 changed files with 73 additions and 0 deletions

View 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}" } }
}