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.
- Loading branch information
1 parent
1b58cf5
commit d40f648
Showing
3 changed files
with
41 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/core/data/repositoryimpl/HobbyRepositoryImpl.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.core.data.repositoryimpl | ||
|
||
import org.sopt.and.core.data.datasource.HobbyDataSource | ||
import org.sopt.and.core.data.service.HobbyService | ||
import org.sopt.and.domain.repository.HobbyRepository | ||
|
||
class HobbyRepositoryImpl(private val hobbyDataSource: HobbyDataSource) : HobbyRepository { | ||
override suspend fun getHobby(token: String): Result<String> = runCatching { | ||
val response = hobbyDataSource.getHobby(token) | ||
response.result.hobby | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/org/sopt/and/core/data/repositoryimpl/SignInRepositoryImpl.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.core.data.repositoryimpl | ||
|
||
import org.sopt.and.core.data.datasource.SignInDataSource | ||
import org.sopt.and.core.data.dto.reqeust.LoginRequest | ||
import org.sopt.and.core.data.service.HobbyService | ||
import org.sopt.and.core.data.service.SignInService | ||
import org.sopt.and.domain.repository.HobbyRepository | ||
import org.sopt.and.domain.repository.SignInRepository | ||
|
||
class SignInRepositoryImpl(private val signInDataSource: SignInDataSource) : SignInRepository { | ||
override suspend fun signIn(username: String, password: String): Result<String> = runCatching { | ||
val response = signInDataSource.postSignIn(LoginRequest(username, password)) | ||
response.result.token | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/org/sopt/and/core/data/repositoryimpl/SignUpRepositoryImpl.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,14 @@ | ||
package org.sopt.and.core.data.repositoryimpl | ||
|
||
import org.sopt.and.core.data.datasource.SignUpDataSource | ||
import org.sopt.and.core.data.dto.reqeust.CreateUserRequest | ||
import org.sopt.and.core.data.service.HobbyService | ||
import org.sopt.and.core.data.service.SignUpService | ||
import org.sopt.and.domain.repository.HobbyRepository | ||
import org.sopt.and.domain.repository.SignUpRepository | ||
|
||
class SignUpRepositoryImpl(private val signUpDataSource: SignUpDataSource) : SignUpRepository { | ||
override suspend fun signUp(username: String, password: String, hobby: String): Result<Unit> = runCatching { | ||
signUpDataSource.postSignUp(CreateUserRequest(username, password, hobby)) | ||
} | ||
} |