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/#10] api 5개를 위한 service와 model을 정의합니다.
- Loading branch information
Showing
9 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...pt/and/data/local/TokenLocalDataSource.kt → .../local/datasource/TokenLocalDataSource.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
3 changes: 2 additions & 1 deletion
3
...nd/data/local/TokenLocalDataSourceImpl.kt → ...atasourceimpl/TokenLocalDataSourceImpl.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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/and/data/remote/model/request/UserInfoUpdateRequestDto.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,10 @@ | ||
package org.sopt.and.data.remote.model.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class UserInfoUpdateRequestDto ( | ||
@SerialName("hobby") val hobby: String?, | ||
@SerialName("password") val password: String? | ||
) |
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
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
22 changes: 19 additions & 3 deletions
22
app/src/main/java/org/sopt/and/data/remote/service/UserService.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 |
---|---|---|
@@ -1,13 +1,29 @@ | ||
package org.sopt.and.data.remote.service | ||
|
||
import org.sopt.and.data.remote.model.response.GetMyHobbyResponseDto | ||
import retrofit2.Call | ||
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 retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.PUT | ||
import retrofit2.http.Path | ||
|
||
interface UserService { | ||
@GET("user/my-hobby") | ||
fun getMyHobby( | ||
@Header("token") token: String | ||
): Call<GetMyHobbyResponseDto> | ||
): ApiResponse<HobbyResponseDto> | ||
|
||
@GET("user/{no}/hobby") | ||
fun getOthersHobby( | ||
@Header("token") token: String, | ||
@Path("no") userNo: Int | ||
): ApiResponse<HobbyResponseDto> | ||
|
||
@PUT("user") | ||
fun updateUserInfo( | ||
@Header("token") token: String, | ||
@Body userInfoUpdateRequestDto: UserInfoUpdateRequestDto | ||
): ApiResponse<Unit> | ||
} |
2 changes: 1 addition & 1 deletion
2
app/src/main/java/org/sopt/and/data/repositoryimpl/TokenRepositoryImpl.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
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
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