Skip to content

Commit

Permalink
#91 관심 약 관련 데이터 모델 패키지 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pknujsp committed Jun 7, 2023
1 parent 1f57020 commit 9b97aee
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.android.mediproject.core.data.remote.interestedmedicine


import com.android.mediproject.core.model.medicine.interestedMedicine.AddInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.NewInterestedMedicineResponse
import com.android.mediproject.core.model.requestparameters.AddInterestedMedicineParameter
import kotlinx.coroutines.flow.Flow

interface InterestedMedicineRepository {
suspend fun getInterestedMedicineList(): Flow<Result<List<InterestedMedicineListResponse.Medicine>>>

fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<AddInterestedMedicineResponse>>
fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<NewInterestedMedicineResponse>>

fun deleteInterestedMedicine(medicineId: Long): Flow<Result<DeleteInterestedMedicineResponse>>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.android.mediproject.core.data.remote.interestedmedicine

import com.android.mediproject.core.model.medicine.interestedMedicine.AddInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.NewInterestedMedicineResponse
import com.android.mediproject.core.model.requestparameters.AddInterestedMedicineParameter
import com.android.mediproject.core.network.datasource.interestedmedicine.InterestedMedicineDataSource
import kotlinx.coroutines.flow.Flow
Expand All @@ -21,7 +21,7 @@ class InterestedMedicineRepositoryImpl @Inject constructor(private val intereste
}.collectLatest { trySend(it) }
}

override fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<AddInterestedMedicineResponse>> =
override fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<NewInterestedMedicineResponse>> =
interestedMedicineDataSource.addInterestedMedicine(addInterestedMedicineParameter)

override fun deleteInterestedMedicine(medicineId: Long): Flow<Result<DeleteInterestedMedicineResponse>> =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.android.mediproject.core.domain

import com.android.mediproject.core.data.remote.interestedmedicine.InterestedMedicineRepository
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.toInterestedMedicineDto
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.toInterestedMedicineDto
import com.android.mediproject.core.model.requestparameters.AddInterestedMedicineParameter
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.channelFlow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mediproject.core.model.medicine.interestedMedicine
package com.android.mediproject.core.model.interestedmedicine


import kotlinx.serialization.SerialName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mediproject.core.model.medicine.interestedMedicine
package com.android.mediproject.core.model.interestedmedicine

data class InterestedMedicineDto(
val itemSeq: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mediproject.core.model.medicine.interestedMedicine
package com.android.mediproject.core.model.interestedmedicine

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mediproject.core.model.medicine.interestedMedicine
package com.android.mediproject.core.model.interestedmedicine

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.android.mediproject.core.model.medicine.interestedMedicine
package com.android.mediproject.core.model.interestedmedicine


import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class AddInterestedMedicineResponse(
data class NewInterestedMedicineResponse(
@SerialName("favoriteMedicineID") val favoriteMedicineID: Int, // 86
@SerialName("message") val message: String
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.android.mediproject.core.network.datasource.interestedmedicine

import com.android.mediproject.core.model.medicine.interestedMedicine.AddInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.NewInterestedMedicineResponse
import com.android.mediproject.core.model.requestparameters.AddInterestedMedicineParameter
import kotlinx.coroutines.flow.Flow

Expand All @@ -13,7 +13,7 @@ interface InterestedMedicineDataSource {
/**
* 관심 약 추가
*/
fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<AddInterestedMedicineResponse>>
fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<NewInterestedMedicineResponse>>

/**
* 관심 약 삭제
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.android.mediproject.core.network.datasource.interestedmedicine

import com.android.mediproject.core.model.medicine.interestedMedicine.AddInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.NewInterestedMedicineResponse
import com.android.mediproject.core.model.requestparameters.AddInterestedMedicineParameter
import com.android.mediproject.core.network.module.AwsNetworkApi
import com.android.mediproject.core.network.onResponse
Expand All @@ -19,7 +19,7 @@ class InterestedMedicineDataSourceImpl @Inject constructor(private val awsNetwor
}
}

override fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<AddInterestedMedicineResponse>> =
override fun addInterestedMedicine(addInterestedMedicineParameter: AddInterestedMedicineParameter): Flow<Result<NewInterestedMedicineResponse>> =
channelFlow {
awsNetworkApi.addInterestedMedicine(addInterestedMedicineParameter).onResponse()
.fold(onSuccess = { Result.success(it) }, onFailure = { Result.failure(it) }).also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import com.android.mediproject.core.datastore.TokenDataSourceImpl
import com.android.mediproject.core.model.comments.CommentChangedResponse
import com.android.mediproject.core.model.comments.CommentListResponse
import com.android.mediproject.core.model.comments.LikeResponse
import com.android.mediproject.core.model.interestedmedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.interestedmedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.interestedmedicine.NewInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.MedicineIdResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.AddInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.DeleteInterestedMedicineResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineListResponse
import com.android.mediproject.core.model.medicine.interestedMedicine.IsInterestedMedicineResponse
import com.android.mediproject.core.model.remote.sign.SignInResponse
import com.android.mediproject.core.model.remote.sign.SignUpResponse
import com.android.mediproject.core.model.remote.token.ReissueTokenResponse
Expand Down Expand Up @@ -244,7 +244,7 @@ interface AwsNetworkApi {
@POST(value = "medicine/favorite")
suspend fun addInterestedMedicine(
@Body addInterestedMedicineParameter: AddInterestedMedicineParameter
): Response<AddInterestedMedicineResponse>
): Response<NewInterestedMedicineResponse>

/**
* 관심 약 삭제
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.core.content.ContextCompat
import androidx.core.net.toUri
import androidx.fragment.app.viewModels
import androidx.navigation.findNavController
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineDto
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineDto
import com.android.mediproject.core.model.remote.token.CurrentTokenDto
import com.android.mediproject.core.model.remote.token.TokenState
import com.android.mediproject.core.ui.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.android.mediproject.feature.interestedmedicine
import androidx.lifecycle.viewModelScope
import com.android.mediproject.core.domain.GetInterestedMedicineUseCase
import com.android.mediproject.core.domain.GetTokenUseCase
import com.android.mediproject.core.model.medicine.interestedMedicine.InterestedMedicineDto
import com.android.mediproject.core.model.interestedmedicine.InterestedMedicineDto
import com.android.mediproject.core.model.remote.token.CurrentTokenDto
import com.android.mediproject.core.model.remote.token.TokenState
import com.android.mediproject.core.ui.base.BaseViewModel
Expand Down

0 comments on commit 9b97aee

Please sign in to comment.