This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [feat] 일기 가져오기 기능 api 작업 * [style] home 화면 버튼 위치 수정
- Loading branch information
1 parent
3e4a08a
commit e938b23
Showing
11 changed files
with
224 additions
and
2 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
Nabi/data/src/main/java/com/nabi/data/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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
package com.nabi.data.datasource | ||
|
||
import com.nabi.data.model.BaseResponse | ||
import com.nabi.data.model.MessageResponseDTO | ||
import com.nabi.data.model.user.UserInfoResponseDTO | ||
import java.io.InputStream | ||
|
||
interface UserRemoteDataSource { | ||
|
||
suspend fun getUserInfo( | ||
accessToken: String, | ||
): Result<BaseResponse<UserInfoResponseDTO>> | ||
|
||
suspend fun loadDiary( | ||
accessToken: String, | ||
realPath: String | ||
): Result<BaseResponse<MessageResponseDTO>> | ||
} |
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
12 changes: 12 additions & 0 deletions
12
Nabi/data/src/main/java/com/nabi/data/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,15 +1,27 @@ | ||
package com.nabi.data.service | ||
|
||
import com.nabi.data.model.BaseResponse | ||
import com.nabi.data.model.MessageResponseDTO | ||
import com.nabi.data.model.user.UserInfoResponseDTO | ||
import okhttp3.MultipartBody | ||
import retrofit2.Response | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.Multipart | ||
import retrofit2.http.POST | ||
import retrofit2.http.Part | ||
|
||
interface UserService { | ||
|
||
@GET("/user-info") | ||
suspend fun getUserInfo( | ||
@Header("Authorization") accessToken: String, | ||
): Response<BaseResponse<UserInfoResponseDTO>> | ||
|
||
@Multipart | ||
@POST("/users/pdf") | ||
suspend fun loadDiary( | ||
@Header("Authorization") accessToken: String, | ||
@Part file: MultipartBody.Part | ||
): Response<BaseResponse<MessageResponseDTO>> | ||
} |
3 changes: 3 additions & 0 deletions
3
Nabi/domain/src/main/java/com/nabi/domain/repository/UserRepository.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,8 +1,11 @@ | ||
package com.nabi.domain.repository | ||
|
||
import com.nabi.domain.model.user.UserInfo | ||
import java.io.InputStream | ||
|
||
|
||
interface UserRepository { | ||
suspend fun getUserInfo(accessToken: String): Result<UserInfo> | ||
|
||
suspend fun loadDiary(accessToken: String, realPath: String): Result<String> | ||
} |
10 changes: 10 additions & 0 deletions
10
Nabi/domain/src/main/java/com/nabi/domain/usecase/user/LoadDiaryUseCase.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 com.nabi.domain.usecase.user | ||
|
||
import com.nabi.domain.repository.UserRepository | ||
import java.io.InputStream | ||
|
||
class LoadDiaryUseCase(private val repository: UserRepository) { | ||
suspend operator fun invoke(accessToken: String, realPath: String): Result<String> { | ||
return repository.loadDiary("Bearer $accessToken", realPath) | ||
} | ||
} |
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
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