diff --git a/src/main/kotlin/com/reditus/novelcia/user/domain/UserModel.kt b/src/main/kotlin/com/reditus/novelcia/user/domain/UserModel.kt index a424149..493ae49 100644 --- a/src/main/kotlin/com/reditus/novelcia/user/domain/UserModel.kt +++ b/src/main/kotlin/com/reditus/novelcia/user/domain/UserModel.kt @@ -9,7 +9,7 @@ class UserModel( val nickname: String, val point: Int, val memberShipExpiredAt: LocalDateTime, - val role: Role, + val role: Role=Role.USER ) { companion object { fun from(user: User): TxScope.() -> UserModel = { @@ -19,7 +19,16 @@ class UserModel( nickname = user.nickname, point = user.point, memberShipExpiredAt = user.memberShipExpiredAt, - role = user.role + ) + } + fun from(user: User, role: Role): TxScope.() -> UserModel = { + UserModel( + id = user.id, + email = user.email, + nickname = user.nickname, + point = user.point, + memberShipExpiredAt = user.memberShipExpiredAt, + role = role ) } }