forked from CheoCharm/MapZ-Android
-
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
13 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
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
data/src/main/java/com/cheocharm/data/source/WriteRemoteDataSource.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,12 @@ | ||
package com.cheocharm.data.source | ||
|
||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteDiaryResponse | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
import com.cheocharm.domain.model.WriteImageResponse | ||
|
||
interface WriteRemoteDataSource { | ||
suspend fun requestWriteImages(request: WriteImageRequest): Result<WriteImageResponse> | ||
|
||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<Int> | ||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<WriteDiaryResponse> | ||
} |
2 changes: 1 addition & 1 deletion
2
domain/src/main/java/com/cheocharm/domain/model/WriteDiaryRequest.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,7 +1,7 @@ | ||
package com.cheocharm.domain.model | ||
|
||
data class WriteDiaryRequest( | ||
val id: Int, | ||
val id: Long, | ||
val title: String, | ||
val content: String | ||
) |
3 changes: 3 additions & 0 deletions
3
domain/src/main/java/com/cheocharm/domain/model/WriteDiaryResponse.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,3 @@ | ||
package com.cheocharm.domain.model | ||
|
||
data class WriteDiaryResponse(val diaryId: Long) |
4 changes: 1 addition & 3 deletions
4
domain/src/main/java/com/cheocharm/domain/model/WriteImageResponse.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,5 +1,3 @@ | ||
package com.cheocharm.domain.model | ||
|
||
data class WriteImageResponse(val statusCode: Int, val customCode: String, val data: Data) { | ||
inner class Data(val diary: Long, val imageURLs: List<String>, message: String) | ||
} | ||
data class WriteImageResponse(val diaryId: Long, val imageURLs: List<String>) |
3 changes: 2 additions & 1 deletion
3
domain/src/main/java/com/cheocharm/domain/repository/WriteRepository.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,12 @@ | ||
package com.cheocharm.domain.repository | ||
|
||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteDiaryResponse | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
import com.cheocharm.domain.model.WriteImageResponse | ||
|
||
interface WriteRepository { | ||
suspend fun requestWriteImages(request: WriteImageRequest): Result<WriteImageResponse> | ||
|
||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<Int> | ||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<WriteDiaryResponse> | ||
} |
3 changes: 2 additions & 1 deletion
3
domain/src/main/java/com/cheocharm/domain/usecase/write/RequestWriteDiaryUseCase.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,12 +1,13 @@ | ||
package com.cheocharm.domain.usecase.write | ||
|
||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteDiaryResponse | ||
import com.cheocharm.domain.repository.WriteRepository | ||
import javax.inject.Inject | ||
|
||
class RequestWriteDiaryUseCase @Inject constructor( | ||
private val repository: WriteRepository | ||
) { | ||
suspend operator fun invoke(request: WriteDiaryRequest): Result<Int> = | ||
suspend operator fun invoke(request: WriteDiaryRequest): Result<WriteDiaryResponse> = | ||
repository.requestWriteDiary(request) | ||
} |
2 changes: 1 addition & 1 deletion
2
presentation/src/main/java/com/cheocharm/presentation/model/Result.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,3 +1,3 @@ | ||
package com.cheocharm.presentation.model | ||
|
||
data class Result(val isSuccessful: Boolean, val message: String? = null) | ||
data class Result<T>(val isSuccessful: Boolean, val message: String? = null, val data: T? = null) |
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
6 changes: 2 additions & 4 deletions
6
remote/src/main/java/com/cheocharm/remote/model/request/WriteDiaryDto.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,9 +1,7 @@ | ||
package com.cheocharm.remote.model.request | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class WriteDiaryDto( | ||
@SerializedName("diary_id") val id: Int, | ||
val diaryId: Long, | ||
val title: String, | ||
@SerializedName("html_content") val html: String | ||
val content: 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