From 93e97ef073cb119aaba6ad6a8d68ed9ab878d380 Mon Sep 17 00:00:00 2001 From: Yu Jin Date: Tue, 15 Oct 2024 14:37:10 +0900 Subject: [PATCH] clean --- .../android/data/dto/request/ChangePwRequest.kt | 5 ----- .../com/eatssu/android/domain/model/CalendarData.kt | 6 ------ .../android/presentation/info/InfoViewModel.kt | 12 ++++-------- 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 app/src/main/java/com/eatssu/android/data/dto/request/ChangePwRequest.kt delete mode 100644 app/src/main/java/com/eatssu/android/domain/model/CalendarData.kt diff --git a/app/src/main/java/com/eatssu/android/data/dto/request/ChangePwRequest.kt b/app/src/main/java/com/eatssu/android/data/dto/request/ChangePwRequest.kt deleted file mode 100644 index b32d49b5..00000000 --- a/app/src/main/java/com/eatssu/android/data/dto/request/ChangePwRequest.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.eatssu.android.data.dto.request - -data class ChangePwRequest( - val pwd: String, -) \ No newline at end of file diff --git a/app/src/main/java/com/eatssu/android/domain/model/CalendarData.kt b/app/src/main/java/com/eatssu/android/domain/model/CalendarData.kt deleted file mode 100644 index fe9f6e25..00000000 --- a/app/src/main/java/com/eatssu/android/domain/model/CalendarData.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.eatssu.android.domain.model - -data class CalendarData( - var cl_date: String = "", // 날짜 - var cl_day: String = "" // 요일 -) diff --git a/app/src/main/java/com/eatssu/android/presentation/info/InfoViewModel.kt b/app/src/main/java/com/eatssu/android/presentation/info/InfoViewModel.kt index 771140e2..de61f088 100644 --- a/app/src/main/java/com/eatssu/android/presentation/info/InfoViewModel.kt +++ b/app/src/main/java/com/eatssu/android/presentation/info/InfoViewModel.kt @@ -1,38 +1,34 @@ package com.eatssu.android.presentation.info -import android.util.Log import androidx.lifecycle.ViewModel import com.eatssu.android.data.enums.Restaurant -import com.eatssu.android.domain.model.RestaurantInfo import com.eatssu.android.data.repository.FirebaseRemoteConfigRepository +import com.eatssu.android.domain.model.RestaurantInfo import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import timber.log.Timber import javax.inject.Inject @HiltViewModel class InfoViewModel @Inject constructor( - private val firebaseRemoteConfigRepository: FirebaseRemoteConfigRepository + firebaseRemoteConfigRepository: FirebaseRemoteConfigRepository ) : ViewModel() { - // StateFlow to hold restaurant info list private val _infoList = MutableStateFlow>(emptyList()) val infoList: StateFlow> = _infoList.asStateFlow() - // Map to hold restaurant info private val restaurantInfoMap: MutableMap = mutableMapOf() init { - // Load cafeteria info from repository and update the StateFlow _infoList.value = firebaseRemoteConfigRepository.getCafeteriaInfo() - Log.d("InfoViewModel", _infoList.value.toString()) + Timber.d(_infoList.value.toString()) _infoList.value.forEach { restaurantInfo -> restaurantInfoMap[restaurantInfo.enum] = restaurantInfo } } - // Helper function to get restaurant details fun getRestaurantInfo(restaurant: Restaurant): RestaurantInfo? { return restaurantInfoMap[restaurant] }