-
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.
♻️ :: Apply Before Commit(Add Expo_Id Response)
- Loading branch information
Showing
8 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
core/data/src/main/java/com/school_of_company/data/repository/expo/ExpoRepository.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,14 @@ | ||
package com.school_of_company.data.repository.expo | ||
|
||
import com.school_of_company.model.entity.expo.ExpoIdResponseEntity | ||
import com.school_of_company.model.entity.expo.ExpoListResponseEntity | ||
import com.school_of_company.model.model.expo.ExpoRequestAndResponseModel | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface ExpoRepository { | ||
fun getExpoList() : Flow<List<ExpoListResponseEntity>> | ||
fun getExpoInformation(expoId: String) : Flow<ExpoRequestAndResponseModel> | ||
fun registerExpoInformation(body: ExpoRequestAndResponseModel) : Flow<Unit> | ||
fun registerExpoInformation(body: ExpoRequestAndResponseModel) : Flow<ExpoIdResponseEntity> | ||
fun modifyExpoInformation(expoId: String, body: ExpoRequestAndResponseModel) : Flow<Unit> | ||
fun deleteExpoInformation(expoId: String) : Flow<Unit> | ||
} |
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
5 changes: 3 additions & 2 deletions
5
...src/main/java/com/school_of_company/domain/usecase/expo/RegisterExpoInformationUseCase.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,14 @@ | ||
package com.school_of_company.domain.usecase.expo | ||
|
||
import com.school_of_company.data.repository.expo.ExpoRepository | ||
import com.school_of_company.model.entity.expo.ExpoIdResponseEntity | ||
import com.school_of_company.model.model.expo.ExpoRequestAndResponseModel | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class RegisterExpoInformationUseCase @Inject constructor( | ||
private val repository: ExpoRepository | ||
) { | ||
operator fun invoke(body: ExpoRequestAndResponseModel) = runCatching { | ||
operator fun invoke(body: ExpoRequestAndResponseModel): Flow<ExpoIdResponseEntity> = | ||
repository.registerExpoInformation(body = body) | ||
} | ||
} |
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
core/network/src/main/java/com/school_of_company/network/datasource/expo/ExpoDataSource.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,14 @@ | ||
package com.school_of_company.network.datasource.expo | ||
|
||
import com.school_of_company.network.dto.expo.request_response.ExpoRequestAndResponse | ||
import com.school_of_company.network.dto.expo.response.ExpoIdResponse | ||
import com.school_of_company.network.dto.expo.response.ExpoListResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface ExpoDataSource { | ||
fun getExpoList() : Flow<List<ExpoListResponse>> | ||
fun getExpoInformation(expoId: String) : Flow<ExpoRequestAndResponse> | ||
fun registerExpoInformation(body: ExpoRequestAndResponse) : Flow<Unit> | ||
fun registerExpoInformation(body: ExpoRequestAndResponse) : Flow<ExpoIdResponse> | ||
fun modifyExpoInformation(expoId: String, body: ExpoRequestAndResponse) : Flow<Unit> | ||
fun deleteExpoInformation(expoId: String) : Flow<Unit> | ||
} |
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
4 changes: 3 additions & 1 deletion
4
.../main/java/com/school_of_company/expo/viewmodel/uistate/RegisterExpoInformationUiState.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,9 @@ | ||
package com.school_of_company.expo.viewmodel.uistate | ||
|
||
import com.school_of_company.model.entity.expo.ExpoIdResponseEntity | ||
|
||
sealed interface RegisterExpoInformationUiState { | ||
object Loading : RegisterExpoInformationUiState | ||
object Success : RegisterExpoInformationUiState | ||
data class Success(val data: ExpoIdResponseEntity): RegisterExpoInformationUiState | ||
data class Error(val exception: Throwable) : RegisterExpoInformationUiState | ||
} |