Skip to content

Commit

Permalink
[feat] #8 로그인 뷰 - 로그인 API에 필요한 Dto, Entity 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
HAJIEUN02 committed Nov 5, 2024
1 parent aac940a commit 4ca3b5e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.sopt.and.data.model.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class RequestUserLoginDto(
@SerialName("username")
val username: String,
@SerialName("password")
val password: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.sopt.and.data.model.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.sopt.and.domain.model.UserEntity

@Serializable
data class ResponseLoginTokenDto(
@SerialName("token")
val accessToken: String
) {
fun toUserEntity() = UserEntity(
accessToken = accessToken
)
}
5 changes: 5 additions & 0 deletions app/src/main/java/org/sopt/and/domain/model/UserEntity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.sopt.and.domain.model

data class UserEntity (
val accessToken: String
)
13 changes: 13 additions & 0 deletions app/src/main/java/org/sopt/and/domain/model/UserLoginEntity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.sopt.and.domain.model

import org.sopt.and.data.model.request.RequestUserLoginDto

data class UserLoginEntity(
val username: String,
val userPassword: String
) {
fun toRequestUserLoginDto() = RequestUserLoginDto(
username = username,
password = userPassword
)
}

0 comments on commit 4ca3b5e

Please sign in to comment.