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
Showing
4 changed files
with
68 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/remote/datasource/AuthRemoteDataSource.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.remote.datasource | ||
|
||
import org.sopt.and.data.remote.model.base.ApiResponse | ||
import org.sopt.and.data.remote.model.request.LoginRequestDto | ||
import org.sopt.and.data.remote.model.request.UserRegistrationRequestDto | ||
import org.sopt.and.data.remote.model.response.LoginResponseDto | ||
import org.sopt.and.data.remote.model.response.UserRegistrationResponseDto | ||
|
||
interface AuthRemoteDataSource { | ||
suspend fun registerUser(userRegistrationRequestDto: UserRegistrationRequestDto): ApiResponse<UserRegistrationResponseDto> | ||
suspend fun login(loginRequestDto: LoginRequestDto): ApiResponse<LoginResponseDto> | ||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/org/sopt/and/data/remote/datasource/UserRemoteDataSource.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,11 @@ | ||
package org.sopt.and.data.remote.datasource | ||
|
||
import org.sopt.and.data.remote.model.base.ApiResponse | ||
import org.sopt.and.data.remote.model.request.UserInfoUpdateRequestDto | ||
import org.sopt.and.data.remote.model.response.HobbyResponseDto | ||
|
||
interface UserRemoteDataSource { | ||
suspend fun getMyHobby(token: String): ApiResponse<HobbyResponseDto> | ||
suspend fun getOthersHobby(token: String, userNo: Int): ApiResponse<HobbyResponseDto> | ||
suspend fun updateUserInfo(token: String, userInfoUpdateRequestDto: UserInfoUpdateRequestDto): ApiResponse<Unit> | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/org/sopt/and/data/remote/datasourceimpl/AuthRemoteDataSourceImpl.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,20 @@ | ||
package org.sopt.and.data.remote.datasourceimpl | ||
|
||
import org.sopt.and.data.remote.datasource.AuthRemoteDataSource | ||
import org.sopt.and.data.remote.model.base.ApiResponse | ||
import org.sopt.and.data.remote.model.request.LoginRequestDto | ||
import org.sopt.and.data.remote.model.request.UserRegistrationRequestDto | ||
import org.sopt.and.data.remote.model.response.LoginResponseDto | ||
import org.sopt.and.data.remote.model.response.UserRegistrationResponseDto | ||
import org.sopt.and.data.remote.service.AuthService | ||
import javax.inject.Inject | ||
|
||
class AuthRemoteDataSourceImpl @Inject constructor( | ||
private val authService: AuthService | ||
) : AuthRemoteDataSource { | ||
override suspend fun registerUser(userRegistrationRequestDto: UserRegistrationRequestDto): ApiResponse<UserRegistrationResponseDto> = | ||
authService.registerUser(userRegistrationRequestDto = userRegistrationRequestDto) | ||
|
||
override suspend fun login(loginRequestDto: LoginRequestDto): ApiResponse<LoginResponseDto> = | ||
authService.login(loginRequestDto = loginRequestDto) | ||
} |
25 changes: 25 additions & 0 deletions
25
app/src/main/java/org/sopt/and/data/remote/datasourceimpl/UserRemoteDataSourceImpl.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,25 @@ | ||
package org.sopt.and.data.remote.datasourceimpl | ||
|
||
import org.sopt.and.data.remote.datasource.UserRemoteDataSource | ||
import org.sopt.and.data.remote.model.base.ApiResponse | ||
import org.sopt.and.data.remote.model.request.UserInfoUpdateRequestDto | ||
import org.sopt.and.data.remote.model.response.HobbyResponseDto | ||
import org.sopt.and.data.remote.service.UserService | ||
import javax.inject.Inject | ||
|
||
class UserRemoteDataSourceImpl @Inject constructor( | ||
private val userService: UserService | ||
): UserRemoteDataSource { | ||
override suspend fun getMyHobby(token: String): ApiResponse<HobbyResponseDto> = | ||
userService.getMyHobby(token = token) | ||
|
||
|
||
override suspend fun getOthersHobby(token: String, userNo: Int): ApiResponse<HobbyResponseDto> = | ||
userService.getOthersHobby(token = token, userNo = userNo) | ||
|
||
override suspend fun updateUserInfo( | ||
token: String, | ||
userInfoUpdateRequestDto: UserInfoUpdateRequestDto | ||
): ApiResponse<Unit> = | ||
userService.updateUserInfo(token = token, userInfoUpdateRequestDto = userInfoUpdateRequestDto) | ||
} |