-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Hyesung82/feature/write
[develop] 일기 작성하기 기능 구현
- Loading branch information
Showing
102 changed files
with
2,436 additions
and
148 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
Submodule MapZ-Android
added at
d201ed
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
buildscript { | ||
ext { | ||
agp_version = '8.1.3' | ||
} | ||
} | ||
plugins { | ||
id 'com.android.application' version '7.2.1' apply false | ||
id 'com.android.library' version '7.2.1' apply false | ||
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false | ||
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false | ||
id 'com.android.application' version '8.1.3' apply false | ||
id 'com.android.library' version '8.1.3' apply false | ||
id 'org.jetbrains.kotlin.android' version '1.9.20' apply false | ||
id 'org.jetbrains.kotlin.jvm' version '1.9.20' apply false | ||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false | ||
id 'com.google.dagger.hilt.android' version '2.42' apply false | ||
id 'com.google.dagger.hilt.android' version '2.48.1' apply false | ||
id 'androidx.navigation.safeargs.kotlin' version "${navVersion}" apply false | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
tasks.register('clean', Delete) { | ||
delete rootProject.layout.buildDirectory | ||
} |
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
34 changes: 34 additions & 0 deletions
34
data/src/main/java/com/cheocharm/data/repository/WriteRepositoryImpl.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,34 @@ | ||
package com.cheocharm.data.repository | ||
|
||
import com.cheocharm.data.error.ErrorData | ||
import com.cheocharm.data.error.toDomain | ||
import com.cheocharm.data.source.WriteRemoteDataSource | ||
import com.cheocharm.domain.model.TempDiary | ||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
import com.cheocharm.domain.repository.WriteRepository | ||
import javax.inject.Inject | ||
|
||
class WriteRepositoryImpl @Inject constructor( | ||
private val writeRemoteDataSource: WriteRemoteDataSource | ||
) : WriteRepository { | ||
override suspend fun requestWriteImages(request: WriteImageRequest): Result<TempDiary> { | ||
val result = writeRemoteDataSource.requestWriteImages(request) | ||
|
||
return when (val exception = result.exceptionOrNull()) { | ||
is ErrorData -> Result.failure(exception.toDomain()) | ||
null -> result | ||
else -> Result.failure(exception) | ||
} | ||
} | ||
|
||
override suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<Long> { | ||
val result = writeRemoteDataSource.requestWriteDiary(request) | ||
|
||
return when (val exception = result.exceptionOrNull()) { | ||
is ErrorData -> Result.failure(exception.toDomain()) | ||
null -> result | ||
else -> Result.failure(exception) | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.cheocharm.data.source | ||
|
||
import com.cheocharm.domain.model.TempDiary | ||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
|
||
interface WriteRemoteDataSource { | ||
suspend fun requestWriteImages(request: WriteImageRequest): Result<TempDiary> | ||
|
||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<Long> | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.cheocharm.domain.model | ||
|
||
data class TempDiary(val diaryId: Long, val imageUrls: List<String>) |
7 changes: 7 additions & 0 deletions
7
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.cheocharm.domain.model | ||
|
||
data class WriteDiaryRequest( | ||
val id: Long, | ||
val title: String, | ||
val content: String | ||
) |
11 changes: 11 additions & 0 deletions
11
domain/src/main/java/com/cheocharm/domain/model/WriteImageRequest.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 com.cheocharm.domain.model | ||
|
||
import java.io.File | ||
|
||
data class WriteImageRequest( | ||
val groupId: Long, | ||
val address: String, | ||
val latitude: Double, | ||
val longitude: Double, | ||
val images: List<File> | ||
) |
11 changes: 11 additions & 0 deletions
11
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.cheocharm.domain.repository | ||
|
||
import com.cheocharm.domain.model.TempDiary | ||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
|
||
interface WriteRepository { | ||
suspend fun requestWriteImages(request: WriteImageRequest): Result<TempDiary> | ||
|
||
suspend fun requestWriteDiary(request: WriteDiaryRequest): Result<Long> | ||
} |
12 changes: 12 additions & 0 deletions
12
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.cheocharm.domain.usecase.write | ||
|
||
import com.cheocharm.domain.model.WriteDiaryRequest | ||
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<Long> = | ||
repository.requestWriteDiary(request) | ||
} |
13 changes: 13 additions & 0 deletions
13
domain/src/main/java/com/cheocharm/domain/usecase/write/RequestWriteImagesUseCase.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,13 @@ | ||
package com.cheocharm.domain.usecase.write | ||
|
||
import com.cheocharm.domain.model.TempDiary | ||
import com.cheocharm.domain.model.WriteImageRequest | ||
import com.cheocharm.domain.repository.WriteRepository | ||
import javax.inject.Inject | ||
|
||
class RequestWriteImagesUseCase @Inject constructor( | ||
private val repository: WriteRepository | ||
) { | ||
suspend operator fun invoke(request: WriteImageRequest): Result<TempDiary> = | ||
repository.requestWriteImages(request) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon May 23 23:15:00 KST 2022 | ||
#Wed Nov 15 15:45:03 KST 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.cheocharm.local"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
Oops, something went wrong.