tg login
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package space.luminic.finance.mappers
|
||||
|
||||
import space.luminic.finance.dtos.UserDTO
|
||||
import space.luminic.finance.dtos.UserDTO.TelegramAuthDTO
|
||||
import space.luminic.finance.models.User
|
||||
|
||||
object UserMapper {
|
||||
@@ -11,7 +12,18 @@ object UserMapper {
|
||||
firstName = this.firstName,
|
||||
tgId = this.tgId,
|
||||
tgUserName = this.tgUserName,
|
||||
photoUrl = this.photoUrl,
|
||||
roles = this.roles
|
||||
)
|
||||
|
||||
fun TelegramAuthDTO.toTelegramMap(): Map<String, String> =
|
||||
mapOf(
|
||||
"id" to id.toString(),
|
||||
"first_name" to (first_name ?: ""),
|
||||
"last_name" to (last_name ?: ""),
|
||||
"username" to (username ?: ""),
|
||||
"photo_url" to (photo_url ?: ""),
|
||||
"auth_date" to auth_date.toString(),
|
||||
"hash" to hash
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user