Skip to content

Commit 8569431

Browse files
committed
[feat/review_api]: Data class Name 변경 롤백
1 parent ac87aca commit 8569431

File tree

19 files changed

+49
-54
lines changed

19 files changed

+49
-54
lines changed

data/src/main/java/com/everymeal/data/model/restaruant/GetUnivRestaurantResponse.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.everymeal.data.model.restaruant
22

33
import com.everymeal.domain.model.restaurant.GetUnivRestaurantEntity
4-
import com.everymeal.domain.model.restaurant.Restaurant
4+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
55
import kotlinx.serialization.Serializable
66

77
@Serializable
@@ -51,8 +51,8 @@ data class Sort(
5151
val unsorted: Boolean,
5252
)
5353

54-
fun RestaurantResponse.toRestaurant(): Restaurant {
55-
return Restaurant(
54+
fun RestaurantResponse.toRestaurant(): RestaurantDataEntity {
55+
return RestaurantDataEntity(
5656
idx = this.idx,
5757
name = this.name,
5858
address = this.address,

data/src/main/java/com/everymeal/data/model/restaruant/SearchRestaurantResponse.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.everymeal.data.model.restaruant
22

3-
import com.everymeal.domain.model.restaurant.Restaurant
3+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
44
import kotlinx.serialization.SerialName
55
import kotlinx.serialization.Serializable
66

@@ -103,10 +103,10 @@ data class SearchRestaurantResponse(
103103
}
104104

105105

106-
fun SearchRestaurantResponse.toRestaurants(): List<Restaurant> {
106+
fun SearchRestaurantResponse.toRestaurants(): List<RestaurantDataEntity> {
107107
return this.data?.content?.mapNotNull { content ->
108108
content?.let {
109-
Restaurant(
109+
RestaurantDataEntity(
110110
idx = it.idx ?: 0,
111111
name = it.name.orEmpty(),
112112
address = it.address.orEmpty(),

data/src/main/java/com/everymeal/data/repository/restaurant/RestaurantRepositoryImpl.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.everymeal.data.datasource.restaurant.RestaurantDataSource
66
import com.everymeal.data.model.restaruant.toGetUnivRestaurantEntity
77
import com.everymeal.data.model.restaruant.toRestaurant
88
import com.everymeal.domain.model.restaurant.GetUnivRestaurantEntity
9-
import com.everymeal.domain.model.restaurant.Restaurant
9+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
1010
import com.everymeal.domain.repository.restaurant.RestaurantRepository
1111
import kotlinx.coroutines.flow.Flow
1212
import kotlinx.coroutines.flow.map
@@ -20,14 +20,14 @@ class RestaurantRepositoryImpl @Inject constructor(
2020
order: String,
2121
group: String?,
2222
grade: String?
23-
): Flow<PagingData<Restaurant>> {
23+
): Flow<PagingData<RestaurantDataEntity>> {
2424
return restaurantDataSource.getUnivRestaurant(campusIdx, order, group, grade)
2525
.map { pagingData ->
2626
pagingData.map { it.toRestaurant() }
2727
}
2828
}
2929

30-
override suspend fun getRestaurantDetail(index: Int): Result<Restaurant> {
30+
override suspend fun getRestaurantDetail(index: Int): Result<RestaurantDataEntity> {
3131
return restaurantDataSource.getRestaurantDetail(index).map { it.toRestaurant() }
3232
}
3333

data/src/main/java/com/everymeal/data/repository/search/DefaultSearchRepository.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package com.everymeal.data.repository.search
22

33
import com.everymeal.data.model.restaruant.toRestaurants
44
import com.everymeal.data.service.search.SearchService
5-
import com.everymeal.domain.model.restaurant.Restaurant
5+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
66
import com.everymeal.domain.repository.search.SearchRepository
77
import javax.inject.Inject
88

99
class DefaultSearchRepository @Inject constructor(
1010
private val searchService: SearchService,
1111
) : SearchRepository {
12-
override suspend fun search(keyword: String): Result<List<Restaurant>> {
12+
override suspend fun search(keyword: String): Result<List<RestaurantDataEntity>> {
1313
return runCatching {
1414
searchService.search(keyword).toRestaurants()
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.everymeal.domain.model.restaurant
22

33
data class GetUnivRestaurantEntity(
4-
val data: List<Restaurant>
4+
val data: List<RestaurantDataEntity>
55
)

domain/src/main/java/com/everymeal/domain/model/restaurant/Restaurant.kt domain/src/main/java/com/everymeal/domain/model/restaurant/RestaurantDataEntity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.everymeal.domain.model.restaurant
22

3-
data class Restaurant(
3+
data class RestaurantDataEntity(
44
val idx: Int,
55
val name: String,
66
val address: String,

domain/src/main/java/com/everymeal/domain/repository/restaurant/RestaurantRepository.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.everymeal.domain.repository.restaurant
22

33
import androidx.paging.PagingData
44
import com.everymeal.domain.model.restaurant.GetUnivRestaurantEntity
5-
import com.everymeal.domain.model.restaurant.Restaurant
5+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
66
import kotlinx.coroutines.flow.Flow
77

88
interface RestaurantRepository {
@@ -12,11 +12,11 @@ interface RestaurantRepository {
1212
order: String,
1313
group: String? = null,
1414
grade: String? = null,
15-
): Flow<PagingData<Restaurant>>
15+
): Flow<PagingData<RestaurantDataEntity>>
1616

1717
suspend fun getRestaurantDetail(
1818
index: Int
19-
): Result<Restaurant>
19+
): Result<RestaurantDataEntity>
2020

2121
suspend fun getHomeRestaurant(
2222
campusIdx: Int,
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.everymeal.domain.repository.search
22

3-
import com.everymeal.domain.model.restaurant.Restaurant
3+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
44

55
interface SearchRepository {
6-
suspend fun search(keyword: String): Result<List<Restaurant>>
6+
suspend fun search(keyword: String): Result<List<RestaurantDataEntity>>
77
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.everymeal.domain.usecase.restaurant
22

3-
import com.everymeal.domain.model.restaurant.Restaurant
3+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
44
import com.everymeal.domain.repository.restaurant.RestaurantRepository
55
import javax.inject.Inject
66

@@ -9,7 +9,7 @@ class GetDetailRestaurantUseCase @Inject constructor(
99
) {
1010
suspend operator fun invoke(
1111
restaurantIdx: Int,
12-
): Result<Restaurant> {
12+
): Result<RestaurantDataEntity> {
1313
return restaurantRepository.getRestaurantDetail(restaurantIdx)
1414
}
1515
}

domain/src/main/java/com/everymeal/domain/usecase/restaurant/GetUnivRestaurantUseCase.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.everymeal.domain.usecase.restaurant
22

33
import androidx.paging.PagingData
4-
import com.everymeal.domain.model.restaurant.Restaurant
4+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
55
import com.everymeal.domain.repository.restaurant.RestaurantRepository
66
import kotlinx.coroutines.flow.Flow
77
import javax.inject.Inject
@@ -14,7 +14,7 @@ class GetUnivRestaurantUseCase @Inject constructor(
1414
order: String,
1515
group: String?,
1616
grade: String?
17-
) : Flow<PagingData<Restaurant>> {
17+
) : Flow<PagingData<RestaurantDataEntity>> {
1818
return restaurantRepository.getUnivRestaurant(campusIdx, order, group, grade)
1919
}
2020
}

presentation/src/main/java/com/everymeal/presentation/components/EveryMealRestaurantItem.kt

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import androidx.compose.foundation.background
55
import androidx.compose.foundation.clickable
66
import androidx.compose.foundation.interaction.MutableInteractionSource
77
import androidx.compose.foundation.layout.Arrangement
8-
import androidx.compose.foundation.layout.Box
98
import androidx.compose.foundation.layout.Column
109
import androidx.compose.foundation.layout.Row
1110
import androidx.compose.foundation.layout.Spacer
@@ -31,7 +30,7 @@ import androidx.compose.ui.tooling.preview.Preview
3130
import androidx.compose.ui.unit.dp
3231
import androidx.compose.ui.unit.sp
3332
import coil.compose.AsyncImage
34-
import com.everymeal.domain.model.restaurant.Restaurant
33+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
3534
import com.everymeal.presentation.R
3635
import com.everymeal.presentation.ui.theme.EveryMeal_AndroidTheme
3736
import com.everymeal.presentation.ui.theme.Gray300
@@ -41,7 +40,7 @@ import com.everymeal.presentation.ui.theme.Gray700
4140

4241
@Composable
4342
fun EveryMealRestaurantItem(
44-
restaurant: Restaurant,
43+
restaurant: RestaurantDataEntity,
4544
onLoveClick: () -> Unit = {},
4645
onDetailClick: (Int) -> Unit = {},
4746
) {
@@ -69,7 +68,7 @@ fun EveryMealRestaurantItem(
6968
@Composable
7069
fun RestaurantTitle(
7170
modifier: Modifier = Modifier,
72-
restaurant: Restaurant,
71+
restaurant: RestaurantDataEntity,
7372
onLoveClick: () -> Unit,
7473
) {
7574
Row(
@@ -101,7 +100,7 @@ fun RestaurantTitle(
101100

102101
@Composable
103102
fun RestaurantLoveCount(
104-
restaurant: Restaurant,
103+
restaurant: RestaurantDataEntity,
105104
onLoveClick: () -> Unit,
106105
) {
107106
Column(
@@ -128,7 +127,7 @@ fun RestaurantLoveCount(
128127
}
129128

130129
@Composable
131-
fun RestaurantRating(restaurant: Restaurant) {
130+
fun RestaurantRating(restaurant: RestaurantDataEntity) {
132131
Row(
133132
modifier = Modifier
134133
.width(100.dp),
@@ -157,7 +156,7 @@ fun RestaurantRating(restaurant: Restaurant) {
157156
}
158157

159158
@Composable
160-
fun RestaurantImage(restaurant: Restaurant) {
159+
fun RestaurantImage(restaurant: RestaurantDataEntity) {
161160
Row(
162161
modifier = Modifier.fillMaxWidth(),
163162
horizontalArrangement = Arrangement.spacedBy(6.dp)

presentation/src/main/java/com/everymeal/presentation/ui/detail/DetailListScreen.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ import androidx.compose.ui.unit.sp
3030
import androidx.hilt.navigation.compose.hiltViewModel
3131
import androidx.paging.compose.LazyPagingItems
3232
import androidx.paging.compose.collectAsLazyPagingItems
33-
import com.everymeal.domain.model.restaurant.Restaurant
33+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
3434
import com.everymeal.presentation.R
3535
import com.everymeal.presentation.components.EveryMealCategoryRatingBottomSheetDialog
3636
import com.everymeal.presentation.components.EveryMealDetailReportBottomSheetDialog
3737
import com.everymeal.presentation.components.EveryMealReportBottomSheetDialog
3838
import com.everymeal.presentation.components.EveryMealRestaurantItem
3939
import com.everymeal.presentation.components.EveryMealSortCategoryBottomSheetDialog
4040
import com.everymeal.presentation.ui.save.SaveTopBar
41-
import com.everymeal.presentation.ui.signup.UnivSelectContract
4241
import com.everymeal.presentation.ui.theme.Grey2
4342
import com.everymeal.presentation.ui.theme.Grey7
4443
import com.everymeal.presentation.ui.theme.Main100
@@ -53,7 +52,7 @@ fun DetailListScreen(
5352
) {
5453
val detailListViewState by detailListViewModel.viewState.collectAsState()
5554

56-
val pagingRestaurantList: LazyPagingItems<Restaurant> =
55+
val pagingRestaurantList: LazyPagingItems<RestaurantDataEntity> =
5756
detailListViewModel.restaurantItems.collectAsLazyPagingItems()
5857

5958
LaunchedEffect(Unit) {

presentation/src/main/java/com/everymeal/presentation/ui/detail/DetailListViewModel.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ package com.everymeal.presentation.ui.detail
33
import androidx.lifecycle.viewModelScope
44
import androidx.paging.PagingData
55
import androidx.paging.cachedIn
6-
import com.everymeal.domain.model.restaurant.Restaurant
6+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
77
import com.everymeal.domain.usecase.local.GetUniversityIndexUseCase
88
import com.everymeal.domain.usecase.restaurant.GetUnivRestaurantUseCase
99
import com.everymeal.presentation.base.BaseViewModel
1010
import com.everymeal.presentation.ui.detail.DetailContract.DetailEvent
1111
import com.everymeal.presentation.ui.detail.DetailContract.DetailState
1212
import com.everymeal.presentation.ui.detail.DetailContract.DetailEffect
13-
import com.everymeal.presentation.ui.signup.UnivSelectContract
1413
import dagger.hilt.android.lifecycle.HiltViewModel
1514
import kotlinx.coroutines.flow.MutableStateFlow
1615
import kotlinx.coroutines.flow.StateFlow
@@ -26,8 +25,8 @@ class DetailListViewModel @Inject constructor(
2625
): BaseViewModel<DetailState, DetailEffect, DetailEvent>(
2726
DetailState()
2827
) {
29-
private val _restaurantItems : MutableStateFlow<PagingData<Restaurant>> = MutableStateFlow(value = PagingData.empty())
30-
val restaurantItems : StateFlow<PagingData<Restaurant>> = _restaurantItems.asStateFlow()
28+
private val _restaurantItems : MutableStateFlow<PagingData<RestaurantDataEntity>> = MutableStateFlow(value = PagingData.empty())
29+
val restaurantItems : StateFlow<PagingData<RestaurantDataEntity>> = _restaurantItems.asStateFlow()
3130

3231
override fun handleEvents(event: DetailEvent) {
3332
when (event) {

presentation/src/main/java/com/everymeal/presentation/ui/home/HomeContract.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.everymeal.presentation.ui.home
22

3-
import com.everymeal.domain.model.restaurant.Restaurant
3+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
44
import com.everymeal.presentation.base.LoadState
55
import com.everymeal.presentation.base.ViewEvent
66
import com.everymeal.presentation.base.ViewSideEffect
@@ -11,7 +11,7 @@ class HomeContract {
1111
val uiState: LoadState = LoadState.LOADING,
1212
val detailListScreenType: DetailListScreenType = DetailListScreenType.RECOMMEND,
1313
val bottomSheetState: Boolean = false,
14-
val restaurantData: List<Restaurant> = emptyList()
14+
val restaurantData: List<RestaurantDataEntity> = emptyList()
1515
) : ViewState
1616

1717
sealed class HomeEvent : ViewEvent {

presentation/src/main/java/com/everymeal/presentation/ui/restaurant/DetailRestaurantContract.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.everymeal.presentation.ui.restaurant
22

3-
import com.everymeal.domain.model.restaurant.Restaurant
3+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
44
import com.everymeal.presentation.base.LoadState
55
import com.everymeal.presentation.base.ViewEvent
66
import com.everymeal.presentation.base.ViewSideEffect
@@ -12,7 +12,7 @@ data class DetailRestaurantState(
1212
val selectedTabIndex: Int = 0,
1313
val isFabClicked: Boolean = false,
1414
val getDetailRestaurantState: LoadState = LoadState.LOADING,
15-
val restaurantInfo: Restaurant = Restaurant(
15+
val restaurantInfo: RestaurantDataEntity = RestaurantDataEntity(
1616
idx = 0,
1717
name = "",
1818
address = "",

presentation/src/main/java/com/everymeal/presentation/ui/restaurant/DetailRestaurantScreen.kt

+6-8
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ import androidx.compose.ui.graphics.Color
4141
import androidx.compose.ui.graphics.ColorFilter
4242
import androidx.compose.ui.graphics.vector.ImageVector
4343
import androidx.compose.ui.layout.ContentScale
44-
import androidx.compose.ui.res.painterResource
4544
import androidx.compose.ui.res.stringResource
4645
import androidx.compose.ui.res.vectorResource
4746
import androidx.compose.ui.text.font.FontWeight
4847
import androidx.compose.ui.tooling.preview.Preview
4948
import androidx.compose.ui.unit.dp
5049
import androidx.compose.ui.unit.sp
5150
import androidx.hilt.navigation.compose.hiltViewModel
52-
import com.everymeal.domain.model.restaurant.Restaurant
51+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
5352
import coil.compose.AsyncImage
54-
import coil.compose.rememberImagePainter
5553
import com.everymeal.presentation.R
5654
import com.everymeal.presentation.base.LoadState
5755
import com.everymeal.presentation.components.EveryMealDialog
@@ -252,7 +250,7 @@ fun DetailRestaurantScreen(
252250
@OptIn(ExperimentalFoundationApi::class)
253251
@Composable
254252
fun DetailRestaurantImage(
255-
restaurantInfo : Restaurant
253+
restaurantInfo : RestaurantDataEntity
256254
) {
257255
val images = restaurantInfo.images ?: listOf()
258256

@@ -296,7 +294,7 @@ fun DetailRestaurantImage(
296294

297295
@Composable
298296
fun DetailRestaurantMainInfo(
299-
restaurantInfo: Restaurant
297+
restaurantInfo: RestaurantDataEntity
300298
) {
301299
Column(
302300
modifier = Modifier
@@ -409,7 +407,7 @@ fun DetailRestaurantMainInfo(
409407
@OptIn(ExperimentalFoundationApi::class)
410408
@Composable
411409
fun DetailRestaurantTabLayout(
412-
restaurantInfo: Restaurant,
410+
restaurantInfo: RestaurantDataEntity,
413411
viewModel: DetailRestaurantViewModel
414412
) {
415413
val viewState by viewModel.viewState.collectAsState()
@@ -476,7 +474,7 @@ fun DetailRestaurantTabLayout(
476474

477475
@Composable
478476
fun DetailRestaurantTabInfo(
479-
restaurantInfo: Restaurant,
477+
restaurantInfo: RestaurantDataEntity,
480478
modifier: Modifier = Modifier,
481479
) {
482480
Column(
@@ -538,7 +536,7 @@ fun DetailRestaurantTabInfo(
538536

539537
@Composable
540538
fun DetailRestaurantTabImage(
541-
restaurantInfo : Restaurant
539+
restaurantInfo : RestaurantDataEntity
542540
) {
543541
Column {
544542
restaurantInfo.images?.let { images ->

presentation/src/main/java/com/everymeal/presentation/ui/restaurant/DetailRestaurantViewModel.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.everymeal.presentation.ui.restaurant
22

33
import androidx.lifecycle.viewModelScope
4-
import com.everymeal.domain.model.restaurant.Restaurant
4+
import com.everymeal.domain.model.restaurant.RestaurantDataEntity
55
import com.everymeal.domain.usecase.restaurant.GetDetailRestaurantUseCase
66
import com.everymeal.presentation.base.BaseViewModel
77
import com.everymeal.presentation.base.LoadState
@@ -56,7 +56,7 @@ class DetailRestaurantViewModel @Inject constructor(
5656
private fun reflectUpdateState(
5757
selectedTabIndex: Int = viewState.value.selectedTabIndex,
5858
isFabClicked: Boolean = viewState.value.isFabClicked,
59-
restaurantInfo: Restaurant = viewState.value.restaurantInfo,
59+
restaurantInfo: RestaurantDataEntity = viewState.value.restaurantInfo,
6060
getDetailRestaurantState: LoadState = viewState.value.getDetailRestaurantState,
6161
networkErrorDialog: Boolean = viewState.value.networkErrorDialog
6262
) {

0 commit comments

Comments
 (0)