generated from AND-SOPT-ANDROID/and-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] #8 로그인 뷰 - 로그인 API에 필요한 Dto, Entity 구현
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
app/src/main/java/org/sopt/and/data/model/request/RequestUserLoginDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/org/sopt/and/data/model/response/ResponseLoginTokenDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
app/src/main/java/org/sopt/and/domain/model/UserLoginEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
} |