Get Account

- add AccountController
- add AccountEntity toAccountResponse in Mapping.kt
- add AccountService
- add AccountRepository
- add AccountEntity
This commit is contained in:
2024-12-29 07:07:44 +01:00
parent 573b4bd6fe
commit 6aee16c4a2
12 changed files with 330 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package ltd.hlaeja.util
import ltd.hlaeja.entity.AccountEntity
import ltd.hlaeja.library.accountRegistry.Account
import org.springframework.http.HttpStatus.EXPECTATION_FAILED
import org.springframework.web.server.ResponseStatusException
fun AccountEntity.toAccountResponse(): Account.Response = Account.Response(
id ?: throw ResponseStatusException(EXPECTATION_FAILED),
updatedAt,
enabled,
username,
roles.split(","),
)