update AccountService with getById

This commit is contained in:
2025-09-11 14:06:48 +02:00
parent 85c140a815
commit 7ce1b15bca
2 changed files with 23 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package ltd.lulz.service
import io.github.oshai.kotlinlogging.KotlinLogging
import java.util.UUID
import ltd.lulz.model.AccountEntity
import ltd.lulz.repository.AccountRepository
import org.springframework.stereotype.Service
@@ -16,4 +17,7 @@ class AccountService(
fun create(entity: AccountEntity): Mono<AccountEntity> = accountRepository
.save(entity)
.doOnNext { log.debug { "account created with id: ${it.id}" } }
fun getById(id: UUID): Mono<AccountEntity> = accountRepository.findById(id)
.doOnNext { log.debug { "found account by id: ${it.id}" } }
}