From f2ea4b1defc3efaa3dac54697964a2fa8e3a64fe Mon Sep 17 00:00:00 2001 From: KwakEuiJin Date: Thu, 4 May 2023 20:44:18 +0900 Subject: [PATCH] =?UTF-8?q?feat(clean):=20#83=20=ED=81=B4=EB=A6=B0=20?= =?UTF-8?q?=EC=95=84=ED=82=A4=ED=85=8D=EC=B3=90=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- .../myongsikandroid/data/api/HomeFoodApi.kt | 5 --- .../myongsikandroid/data/api/UserApi.kt | 12 ++++++ .../data/model/user/RequestUserData.kt | 13 ++++++- .../data/model/user/ResponseUserData.kt | 38 +++++++++++++++---- .../data/repository/food/FoodRepository.kt | 2 - .../repository/food/FoodRepositoryImpl.kt | 4 -- .../data/repository/user/UserRepository.kt | 10 +++++ .../repository/user/UserRepositoryImpl.kt | 22 +++++++++++ .../myongsik/myongsikandroid/di/AppModule.kt | 12 ++++++ .../myongsikandroid/di/RepositoryModule.kt | 8 ++++ .../myongsikandroid/domain/UserCase.kt | 5 +++ .../domain/model/RequestUserEntity.kt | 5 +++ .../domain/model/ResponseUserEntity.kt | 12 ++++++ .../domain/user/PostUserDataUseCase.kt | 10 +++++ .../adapter/food/MyPagerAdapter.kt | 4 +- .../adapter/food/OnScrapViewHolderClick.kt | 2 +- .../adapter/food/RankHeaderAdapter.kt | 2 +- .../adapter/food/RankHeaderViewHolder.kt | 2 +- .../adapter/food/RankRestaurantAdapter.kt | 2 +- .../adapter/food/RankRestaurantViewHolder.kt | 2 +- .../adapter/search/LoveFoodPagingAdapter.kt | 2 +- .../adapter/search/LoveFoodViewHolder.kt | 2 +- .../adapter/search/OnSearchViewHolderClick.kt | 2 +- .../adapter/search/SearchFoodAdapter.kt | 2 +- .../adapter/search/SearchFoodPagingAdapter.kt | 2 +- .../adapter/search/SearchFoodViewHolder.kt | 2 +- .../state/SearchFoodLoadStateAdapter.kt | 2 +- .../state/SearchFoodLoadStateViewHolder.kt | 2 +- .../view/food/HomeFragment.kt | 6 +-- .../view/food/MapDetailBottomSheetDialog.kt | 6 +-- .../view/food/MapFragment.kt | 6 +-- .../view/food/SelectFragment.kt | 2 +- .../view/food/SelectHomeFragment.kt | 2 +- .../view/food/SplashFragment.kt | 10 +---- .../view/food/WidgetSettingFragment.kt | 4 +- .../view/search/LoveFragment.kt | 8 ++-- .../view/search/RestaurantFragment.kt | 4 +- .../view/search/SearchFragment.kt | 22 +++++------ .../view/search/TagFragment.kt | 8 ++-- .../viewmodel/food/HomeViewModel.kt | 2 +- .../viewmodel/food/SplashViewModel.kt | 17 +++++---- .../viewmodel/food/WidgetSettingViewModel.kt | 2 +- .../viewmodel/search/LoveViewModel.kt | 2 +- .../viewmodel/search/SearchViewModel.kt | 2 +- .../{ui => presentation}/widget/MenuWidget.kt | 2 +- .../myongsikandroid/util/CommonUtil.kt | 2 +- app/src/main/res/layout/fragment_home.xml | 2 +- app/src/main/res/layout/fragment_love.xml | 2 +- app/src/main/res/layout/fragment_search.xml | 2 +- .../main/res/layout/fragment_select_home.xml | 2 +- .../res/navigation/myongsik_nav_graph.xml | 20 +++++----- 52 files changed, 217 insertions(+), 108 deletions(-) create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/data/api/UserApi.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepository.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepositoryImpl.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/domain/UserCase.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/domain/model/RequestUserEntity.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/domain/model/ResponseUserEntity.kt create mode 100644 app/src/main/java/com/myongsik/myongsikandroid/domain/user/PostUserDataUseCase.kt rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/MyPagerAdapter.kt (99%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/OnScrapViewHolderClick.kt (84%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/RankHeaderAdapter.kt (92%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/RankHeaderViewHolder.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/RankRestaurantAdapter.kt (95%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/food/RankRestaurantViewHolder.kt (98%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/LoveFoodPagingAdapter.kt (97%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/LoveFoodViewHolder.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/OnSearchViewHolderClick.kt (80%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/SearchFoodAdapter.kt (95%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/SearchFoodPagingAdapter.kt (95%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/search/SearchFoodViewHolder.kt (98%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/state/SearchFoodLoadStateAdapter.kt (92%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/adapter/state/SearchFoodLoadStateViewHolder.kt (87%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/HomeFragment.kt (98%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/MapDetailBottomSheetDialog.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/MapFragment.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/SelectFragment.kt (98%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/SelectHomeFragment.kt (97%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/SplashFragment.kt (90%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/food/WidgetSettingFragment.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/search/LoveFragment.kt (90%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/search/RestaurantFragment.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/search/SearchFragment.kt (93%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/view/search/TagFragment.kt (88%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/viewmodel/food/HomeViewModel.kt (98%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/viewmodel/food/SplashViewModel.kt (55%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/viewmodel/food/WidgetSettingViewModel.kt (97%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/viewmodel/search/LoveViewModel.kt (96%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/viewmodel/search/SearchViewModel.kt (97%) rename app/src/main/java/com/myongsik/myongsikandroid/{ui => presentation}/widget/MenuWidget.kt (96%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 353749db..405cb5ea 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/api/HomeFoodApi.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/api/HomeFoodApi.kt index 3eb422b4..9e678aab 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/data/api/HomeFoodApi.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/api/HomeFoodApi.kt @@ -30,11 +30,6 @@ interface HomeFoodApi { @Body body: RequestReviewData ): Response - @POST("/api/v2/users") - suspend fun postUser( - @Body body: RequestUserData - ): Response - @POST("/api/v2/meals/evaluate") suspend fun postMeal( @Body body: RequestMealData diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/api/UserApi.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/api/UserApi.kt new file mode 100644 index 00000000..36c16f29 --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/api/UserApi.kt @@ -0,0 +1,12 @@ +package com.myongsik.myongsikandroid.data.api + +import com.myongsik.myongsikandroid.data.model.user.RequestUserData +import com.myongsik.myongsikandroid.data.model.user.ResponseUserData +import retrofit2.Response +import retrofit2.http.Body +import retrofit2.http.POST + +interface UserApi { + @POST("/api/v2/users") + suspend fun postUser(@Body body: RequestUserData): Response +} \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/RequestUserData.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/RequestUserData.kt index 9f7c6ea8..949534cc 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/RequestUserData.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/RequestUserData.kt @@ -1,6 +1,17 @@ package com.myongsik.myongsikandroid.data.model.user +import com.myongsik.myongsikandroid.domain.model.RequestUserEntity + data class RequestUserData( - var phoneId : String + var phoneId: String +) + +fun RequestUserData.toRequestUserEntity() = RequestUserEntity( + phoneId = this.phoneId ) + +fun RequestUserEntity.toRequestUserData() = RequestUserData( + phoneId = this.phoneId +) + diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/ResponseUserData.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/ResponseUserData.kt index 0bcd9f70..5926172b 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/ResponseUserData.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/model/user/ResponseUserData.kt @@ -1,16 +1,40 @@ package com.myongsik.myongsikandroid.data.model.user +import com.myongsik.myongsikandroid.domain.model.ResponseUserEntity + data class ResponseUserData( val httpCode: Int, - val success : Boolean, - val localDataTime : ArrayList, - val httpStatus : String, - val message : String, - val data : Result -){ + val success: Boolean, + val localDataTime: ArrayList, + val httpStatus: String, + val message: String, + val data: Result +) { data class Result( val id: String, - val phoneId : String + val phoneId: String ) } +fun ResponseUserData.toResponseUserEntity() = ResponseUserEntity( + httpCode = this.httpCode, + success = this.success, + localDataTime = this.localDataTime, + httpStatus = this.httpStatus, + message = this.message, + id = data.id, + phoneId = data.phoneId +) + +fun ResponseUserEntity.toResponseUserData() = ResponseUserData( + httpCode = this.httpCode, + success = this.success, + localDataTime = this.localDataTime, + httpStatus = this.httpStatus, + message = this.message, + data = ResponseUserData.Result( + id = this.id, + phoneId = this.phoneId + ) +) + diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepository.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepository.kt index 713831d6..1ff1b65a 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepository.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepository.kt @@ -20,8 +20,6 @@ interface FoodRepository { suspend fun postReview(requestReviewData: RequestReviewData): Response - suspend fun postUser(requestUserData: RequestUserData): Response - suspend fun postScrapRestaurant(requestScrap: RequestScrap): Response suspend fun getRankRestaurant(sort : String, campus : String, size : Int) : Response diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepositoryImpl.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepositoryImpl.kt index 1c8ef47a..ca9a8819 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepositoryImpl.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepositoryImpl.kt @@ -53,10 +53,6 @@ class FoodRepositoryImpl @Inject constructor( return api.postReview(requestReviewData) } - override suspend fun postUser(requestUserData: RequestUserData): Response { - return api.postUser(requestUserData) - } - override suspend fun postScrapRestaurant(requestScrap: RequestScrap): Response { return api.postRestaurantScrap(requestScrap) } diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepository.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepository.kt new file mode 100644 index 00000000..84844edb --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepository.kt @@ -0,0 +1,10 @@ +package com.myongsik.myongsikandroid.data.repository.user + +import com.myongsik.myongsikandroid.domain.model.RequestUserEntity +import com.myongsik.myongsikandroid.domain.model.ResponseUserEntity + +interface UserRepository { + + suspend fun postUser(requestUserEntity: RequestUserEntity): ResponseUserEntity? + +} \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepositoryImpl.kt b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepositoryImpl.kt new file mode 100644 index 00000000..93ef1e11 --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/data/repository/user/UserRepositoryImpl.kt @@ -0,0 +1,22 @@ +package com.myongsik.myongsikandroid.data.repository.user + +import com.myongsik.myongsikandroid.data.api.UserApi +import com.myongsik.myongsikandroid.data.model.user.RequestUserData +import com.myongsik.myongsikandroid.data.model.user.ResponseUserData +import com.myongsik.myongsikandroid.data.model.user.toRequestUserData +import com.myongsik.myongsikandroid.data.model.user.toResponseUserEntity +import com.myongsik.myongsikandroid.domain.model.RequestUserEntity +import com.myongsik.myongsikandroid.domain.model.ResponseUserEntity +import retrofit2.Response +import javax.inject.Inject + +class UserRepositoryImpl @Inject constructor(private val userApi: UserApi) : UserRepository { + override suspend fun postUser(requestUserEntity: RequestUserEntity): ResponseUserEntity? { + val response = userApi.postUser(requestUserEntity.toRequestUserData()) + return if (response.isSuccessful) { + response.body()?.toResponseUserEntity() + } else { + null + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/di/AppModule.kt b/app/src/main/java/com/myongsik/myongsikandroid/di/AppModule.kt index b7c7a22a..06a2f43b 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/di/AppModule.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/di/AppModule.kt @@ -8,6 +8,7 @@ import androidx.datastore.preferences.preferencesDataStoreFile import androidx.room.Room import com.myongsik.myongsikandroid.data.api.HomeFoodApi import com.myongsik.myongsikandroid.data.api.SearchFoodApi +import com.myongsik.myongsikandroid.data.api.UserApi import com.myongsik.myongsikandroid.data.db.RestaurantDatabase import com.myongsik.myongsikandroid.util.Constant import com.myongsik.myongsikandroid.util.Constant.DATASTORE_NAME @@ -68,6 +69,17 @@ object AppModule { .build() .create() } + + @Singleton + @Provides + fun provideUserApi(okHttpClient: OkHttpClient, gsonConverterFactory: GsonConverterFactory): UserApi { + return Retrofit.Builder() + .baseUrl(Constant.MYONG_SIK_BASE_URL) + .client(okHttpClient) + .addConverterFactory(gsonConverterFactory) + .build() + .create() + } //Room @Singleton diff --git a/app/src/main/java/com/myongsik/myongsikandroid/di/RepositoryModule.kt b/app/src/main/java/com/myongsik/myongsikandroid/di/RepositoryModule.kt index 24c15110..6873fbe6 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/di/RepositoryModule.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/di/RepositoryModule.kt @@ -4,6 +4,8 @@ import com.myongsik.myongsikandroid.data.repository.food.FoodRepository import com.myongsik.myongsikandroid.data.repository.food.FoodRepositoryImpl import com.myongsik.myongsikandroid.data.repository.search.SearchFoodRepository import com.myongsik.myongsikandroid.data.repository.search.SearchFoodRepositoryImpl +import com.myongsik.myongsikandroid.data.repository.user.UserRepository +import com.myongsik.myongsikandroid.data.repository.user.UserRepositoryImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn @@ -25,4 +27,10 @@ abstract class RepositoryModule { abstract fun bindSearchFoodRepository( searchFoodRepositoryImpl: SearchFoodRepositoryImpl ): SearchFoodRepository + + @Singleton + @Binds + abstract fun bindUserRepository( + userRepositoryImpl: UserRepositoryImpl + ): UserRepository } \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/domain/UserCase.kt b/app/src/main/java/com/myongsik/myongsikandroid/domain/UserCase.kt new file mode 100644 index 00000000..e038f300 --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/domain/UserCase.kt @@ -0,0 +1,5 @@ +package com.myongsik.myongsikandroid.domain + +interface UserCase { + +} \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/domain/model/RequestUserEntity.kt b/app/src/main/java/com/myongsik/myongsikandroid/domain/model/RequestUserEntity.kt new file mode 100644 index 00000000..9fefbafa --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/domain/model/RequestUserEntity.kt @@ -0,0 +1,5 @@ +package com.myongsik.myongsikandroid.domain.model + +data class RequestUserEntity( + val phoneId: String +) diff --git a/app/src/main/java/com/myongsik/myongsikandroid/domain/model/ResponseUserEntity.kt b/app/src/main/java/com/myongsik/myongsikandroid/domain/model/ResponseUserEntity.kt new file mode 100644 index 00000000..c031c90b --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/domain/model/ResponseUserEntity.kt @@ -0,0 +1,12 @@ +package com.myongsik.myongsikandroid.domain.model + +data class ResponseUserEntity( + val httpCode: Int, + val success: Boolean, + val localDataTime: ArrayList, + val httpStatus: String, + val message: String, + val id: String, + val phoneId: String +) + diff --git a/app/src/main/java/com/myongsik/myongsikandroid/domain/user/PostUserDataUseCase.kt b/app/src/main/java/com/myongsik/myongsikandroid/domain/user/PostUserDataUseCase.kt new file mode 100644 index 00000000..703012f5 --- /dev/null +++ b/app/src/main/java/com/myongsik/myongsikandroid/domain/user/PostUserDataUseCase.kt @@ -0,0 +1,10 @@ +package com.myongsik.myongsikandroid.domain.user + +import com.myongsik.myongsikandroid.data.repository.user.UserRepository +import com.myongsik.myongsikandroid.domain.UserCase +import com.myongsik.myongsikandroid.domain.model.RequestUserEntity +import javax.inject.Inject + +class PostUserDataUseCase @Inject constructor(private val userRepository: UserRepository) : UserCase { + suspend operator fun invoke(requestUserEntity: RequestUserEntity) = userRepository.postUser(requestUserEntity) +} \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/MyPagerAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/MyPagerAdapter.kt similarity index 99% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/MyPagerAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/MyPagerAdapter.kt index 48b07aa1..64842b80 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/MyPagerAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/MyPagerAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import android.graphics.Color import android.graphics.Typeface @@ -13,7 +13,7 @@ import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.databinding.ItemHomeTodayFoodBinding -import com.myongsik.myongsikandroid.ui.viewmodel.food.HomeViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.food.HomeViewModel import com.myongsik.myongsikandroid.util.Constant.DINNER import com.myongsik.myongsikandroid.util.Constant.DINNER_H import com.myongsik.myongsikandroid.util.Constant.DINNER_S diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/OnScrapViewHolderClick.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/OnScrapViewHolderClick.kt similarity index 84% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/OnScrapViewHolderClick.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/OnScrapViewHolderClick.kt index a40e03d8..35087379 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/OnScrapViewHolderClick.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/OnScrapViewHolderClick.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import com.myongsik.myongsikandroid.data.model.food.GetRankRestaurant diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderAdapter.kt similarity index 92% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderAdapter.kt index cc5f8309..d497c67d 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderViewHolder.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderViewHolder.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderViewHolder.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderViewHolder.kt index 42bf3c4f..bef40cb3 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankHeaderViewHolder.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankHeaderViewHolder.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import android.util.Log import android.view.View diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantAdapter.kt similarity index 95% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantAdapter.kt index db5ce97a..0f5a21cb 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantViewHolder.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantViewHolder.kt similarity index 98% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantViewHolder.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantViewHolder.kt index 9bc2a9a3..6e93074a 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/food/RankRestaurantViewHolder.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/food/RankRestaurantViewHolder.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.food +package com.myongsik.myongsikandroid.presentation.adapter.food import android.content.Intent import android.net.Uri diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodPagingAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodPagingAdapter.kt similarity index 97% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodPagingAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodPagingAdapter.kt index 642a2cd0..88cf1225 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodPagingAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodPagingAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodViewHolder.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodViewHolder.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodViewHolder.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodViewHolder.kt index ede00941..02c1c348 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/LoveFoodViewHolder.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/LoveFoodViewHolder.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import android.view.View import androidx.recyclerview.widget.RecyclerView diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/OnSearchViewHolderClick.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/OnSearchViewHolderClick.kt similarity index 80% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/OnSearchViewHolderClick.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/OnSearchViewHolderClick.kt index a2c0a5bc..1a3f90de 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/OnSearchViewHolderClick.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/OnSearchViewHolderClick.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import com.myongsik.myongsikandroid.data.model.kakao.Restaurant diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodAdapter.kt similarity index 95% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodAdapter.kt index f3473f4a..7625c23e 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodPagingAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodPagingAdapter.kt similarity index 95% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodPagingAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodPagingAdapter.kt index 59a3f407..2c61996b 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodPagingAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodPagingAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodViewHolder.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodViewHolder.kt similarity index 98% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodViewHolder.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodViewHolder.kt index 89c1a062..9cbbdd51 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/search/SearchFoodViewHolder.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/search/SearchFoodViewHolder.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.search +package com.myongsik.myongsikandroid.presentation.adapter.search import android.content.Intent import android.net.Uri diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateAdapter.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateAdapter.kt similarity index 92% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateAdapter.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateAdapter.kt index 1d079d3d..84773f61 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateAdapter.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateAdapter.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.state +package com.myongsik.myongsikandroid.presentation.adapter.state import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateViewHolder.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateViewHolder.kt similarity index 87% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateViewHolder.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateViewHolder.kt index f5dfe39b..7fc22acd 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/adapter/state/SearchFoodLoadStateViewHolder.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/adapter/state/SearchFoodLoadStateViewHolder.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.adapter.state +package com.myongsik.myongsikandroid.presentation.adapter.state import androidx.core.view.isVisible import androidx.paging.LoadState diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/HomeFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/HomeFragment.kt similarity index 98% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/HomeFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/HomeFragment.kt index d6a15a1f..260280e0 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/HomeFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/HomeFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.app.AlertDialog import android.graphics.BlendMode @@ -23,8 +23,8 @@ import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.data.model.review.RequestReviewData import com.myongsik.myongsikandroid.databinding.DialogBottomUpdateSheetBinding import com.myongsik.myongsikandroid.databinding.FragmentHomeBinding -import com.myongsik.myongsikandroid.ui.adapter.food.MyPagerAdapter -import com.myongsik.myongsikandroid.ui.viewmodel.food.HomeViewModel +import com.myongsik.myongsikandroid.presentation.adapter.food.MyPagerAdapter +import com.myongsik.myongsikandroid.presentation.viewmodel.food.HomeViewModel import com.myongsik.myongsikandroid.util.* import com.myongsik.myongsikandroid.util.Constant.DINNER import com.myongsik.myongsikandroid.util.Constant.DINNER_H diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapDetailBottomSheetDialog.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapDetailBottomSheetDialog.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapDetailBottomSheetDialog.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapDetailBottomSheetDialog.kt index d66b80b2..7a4126b6 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapDetailBottomSheetDialog.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapDetailBottomSheetDialog.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.content.Intent import android.net.Uri @@ -14,8 +14,8 @@ import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.data.model.food.RequestScrap import com.myongsik.myongsikandroid.data.model.kakao.Restaurant import com.myongsik.myongsikandroid.databinding.DialogBottomRestaurantSheetBinding -import com.myongsik.myongsikandroid.ui.viewmodel.food.HomeViewModel -import com.myongsik.myongsikandroid.ui.viewmodel.search.LoveViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.food.HomeViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.search.LoveViewModel import com.myongsik.myongsikandroid.util.CommonUtil import com.myongsik.myongsikandroid.util.MyongsikApplication import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapFragment.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapFragment.kt index 500071d6..f544d8fc 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/MapFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/MapFragment.kt @@ -1,6 +1,5 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food -import android.annotation.SuppressLint import android.graphics.Bitmap import android.graphics.Canvas import android.view.LayoutInflater @@ -13,8 +12,7 @@ import androidx.navigation.fragment.findNavController import com.myongsik.myongsikandroid.BaseFragment import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.databinding.FragmentMapBinding -import com.myongsik.myongsikandroid.ui.viewmodel.food.HomeViewModel -import com.myongsik.myongsikandroid.ui.viewmodel.search.LoveViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.food.HomeViewModel import com.myongsik.myongsikandroid.util.Constant import com.myongsik.myongsikandroid.util.MyongsikApplication import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectFragment.kt similarity index 98% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectFragment.kt index 46640a9a..1c3b8838 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.annotation.SuppressLint import android.content.res.ColorStateList diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectHomeFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectHomeFragment.kt similarity index 97% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectHomeFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectHomeFragment.kt index 4a936105..e3d07e34 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SelectHomeFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SelectHomeFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SplashFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SplashFragment.kt similarity index 90% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SplashFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SplashFragment.kt index 715a6565..1b05f788 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/SplashFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/SplashFragment.kt @@ -1,25 +1,19 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.annotation.SuppressLint -import android.content.Context -import android.os.Bundle import android.os.Handler import android.os.Looper import android.provider.Settings import android.view.LayoutInflater -import android.view.View import android.view.ViewGroup import androidx.appcompat.app.AlertDialog -import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import com.myongsik.myongsikandroid.BaseFragment -import com.myongsik.myongsikandroid.MainActivity import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.data.model.user.RequestUserData -import com.myongsik.myongsikandroid.databinding.FragmentSearchBinding import com.myongsik.myongsikandroid.databinding.FragmentSplashBinding -import com.myongsik.myongsikandroid.ui.viewmodel.food.SplashViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.food.SplashViewModel import com.myongsik.myongsikandroid.util.DialogUtils import com.myongsik.myongsikandroid.util.MyongsikApplication import com.myongsik.myongsikandroid.util.NetworkUtils diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/WidgetSettingFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/WidgetSettingFragment.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/WidgetSettingFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/WidgetSettingFragment.kt index 6f35a50b..f290adc5 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/food/WidgetSettingFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/food/WidgetSettingFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.food +package com.myongsik.myongsikandroid.presentation.view.food import android.os.Bundle import android.view.LayoutInflater @@ -15,7 +15,7 @@ import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.alarm.UpdateWidgetWorker import com.myongsik.myongsikandroid.data.type.WidgetType import com.myongsik.myongsikandroid.databinding.FragmentWidgetSettingBinding -import com.myongsik.myongsikandroid.ui.viewmodel.food.WidgetSettingViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.food.WidgetSettingViewModel import com.myongsik.myongsikandroid.util.CommonUtil import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/LoveFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/LoveFragment.kt similarity index 90% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/LoveFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/LoveFragment.kt index 1d5d2543..23311ebd 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/LoveFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/LoveFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.search +package com.myongsik.myongsikandroid.presentation.view.search import android.view.LayoutInflater import android.view.View @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.myongsik.myongsikandroid.BaseFragment import com.myongsik.myongsikandroid.data.model.kakao.Restaurant import com.myongsik.myongsikandroid.databinding.FragmentLoveBinding -import com.myongsik.myongsikandroid.ui.adapter.search.LoveFoodPagingAdapter -import com.myongsik.myongsikandroid.ui.adapter.search.OnSearchViewHolderClick -import com.myongsik.myongsikandroid.ui.viewmodel.search.LoveViewModel +import com.myongsik.myongsikandroid.presentation.adapter.search.LoveFoodPagingAdapter +import com.myongsik.myongsikandroid.presentation.adapter.search.OnSearchViewHolderClick +import com.myongsik.myongsikandroid.presentation.viewmodel.search.LoveViewModel import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/RestaurantFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/RestaurantFragment.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/RestaurantFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/RestaurantFragment.kt index 37143720..7eee0a4a 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/RestaurantFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/RestaurantFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.search +package com.myongsik.myongsikandroid.presentation.view.search import android.view.LayoutInflater import android.view.View @@ -14,7 +14,7 @@ import com.google.android.material.snackbar.Snackbar import com.myongsik.myongsikandroid.BaseFragment import com.myongsik.myongsikandroid.data.model.food.RequestScrap import com.myongsik.myongsikandroid.databinding.FragmentRestaurantBinding -import com.myongsik.myongsikandroid.ui.viewmodel.search.LoveViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.search.LoveViewModel import com.myongsik.myongsikandroid.util.MyongsikApplication import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/SearchFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/SearchFragment.kt similarity index 93% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/SearchFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/SearchFragment.kt index 55506115..b61ad966 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/SearchFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/SearchFragment.kt @@ -1,7 +1,5 @@ -package com.myongsik.myongsikandroid.ui.view.search +package com.myongsik.myongsikandroid.presentation.view.search -import android.content.Context -import android.os.Bundle import android.text.Editable import android.text.TextWatcher import android.view.LayoutInflater @@ -10,7 +8,6 @@ import android.view.ViewGroup import androidx.activity.OnBackPressedCallback import androidx.core.view.isVisible import androidx.core.widget.addTextChangedListener -import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController @@ -24,15 +21,14 @@ import com.myongsik.myongsikandroid.data.model.food.GetRankRestaurant import com.myongsik.myongsikandroid.data.model.kakao.Restaurant import com.myongsik.myongsikandroid.data.model.kakao.toRankRestaurant import com.myongsik.myongsikandroid.databinding.FragmentSearchBinding -import com.myongsik.myongsikandroid.databinding.FragmentTagBinding -import com.myongsik.myongsikandroid.ui.adapter.food.OnScrapViewHolderClick -import com.myongsik.myongsikandroid.ui.adapter.food.RankHeaderAdapter -import com.myongsik.myongsikandroid.ui.adapter.food.RankRestaurantAdapter -import com.myongsik.myongsikandroid.ui.adapter.search.OnSearchViewHolderClick -import com.myongsik.myongsikandroid.ui.adapter.search.SearchFoodPagingAdapter -import com.myongsik.myongsikandroid.ui.adapter.state.SearchFoodLoadStateAdapter -import com.myongsik.myongsikandroid.ui.viewmodel.food.HomeViewModel -import com.myongsik.myongsikandroid.ui.viewmodel.search.SearchViewModel +import com.myongsik.myongsikandroid.presentation.adapter.food.OnScrapViewHolderClick +import com.myongsik.myongsikandroid.presentation.adapter.food.RankHeaderAdapter +import com.myongsik.myongsikandroid.presentation.adapter.food.RankRestaurantAdapter +import com.myongsik.myongsikandroid.presentation.adapter.search.OnSearchViewHolderClick +import com.myongsik.myongsikandroid.presentation.adapter.search.SearchFoodPagingAdapter +import com.myongsik.myongsikandroid.presentation.adapter.state.SearchFoodLoadStateAdapter +import com.myongsik.myongsikandroid.presentation.viewmodel.food.HomeViewModel +import com.myongsik.myongsikandroid.presentation.viewmodel.search.SearchViewModel import com.myongsik.myongsikandroid.util.CommonUtil import com.myongsik.myongsikandroid.util.Constant.SEARCH_FOODS_TIME_DELAY import com.myongsik.myongsikandroid.util.DataStoreKey diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/TagFragment.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/TagFragment.kt similarity index 88% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/TagFragment.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/TagFragment.kt index 0cd66ab0..a631f22d 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/view/search/TagFragment.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/view/search/TagFragment.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.view.search +package com.myongsik.myongsikandroid.presentation.view.search import android.view.LayoutInflater import android.view.ViewGroup @@ -10,9 +10,9 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.myongsik.myongsikandroid.BaseFragment import com.myongsik.myongsikandroid.data.model.kakao.Restaurant import com.myongsik.myongsikandroid.databinding.FragmentTagBinding -import com.myongsik.myongsikandroid.ui.adapter.search.OnSearchViewHolderClick -import com.myongsik.myongsikandroid.ui.adapter.search.SearchFoodPagingAdapter -import com.myongsik.myongsikandroid.ui.viewmodel.search.SearchViewModel +import com.myongsik.myongsikandroid.presentation.adapter.search.OnSearchViewHolderClick +import com.myongsik.myongsikandroid.presentation.adapter.search.SearchFoodPagingAdapter +import com.myongsik.myongsikandroid.presentation.viewmodel.search.SearchViewModel import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/HomeViewModel.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/HomeViewModel.kt similarity index 98% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/HomeViewModel.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/HomeViewModel.kt index 81a559eb..496116bf 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/HomeViewModel.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/HomeViewModel.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.viewmodel.food +package com.myongsik.myongsikandroid.presentation.viewmodel.food import androidx.datastore.preferences.core.Preferences import androidx.lifecycle.LiveData diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/SplashViewModel.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/SplashViewModel.kt similarity index 55% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/SplashViewModel.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/SplashViewModel.kt index 7f1b5643..ce14c6f2 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/SplashViewModel.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/SplashViewModel.kt @@ -1,17 +1,20 @@ -package com.myongsik.myongsikandroid.ui.viewmodel.food +package com.myongsik.myongsikandroid.presentation.viewmodel.food import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData +import com.myongsik.myongsikandroid.BaseViewModel import com.myongsik.myongsikandroid.data.model.user.RequestUserData import com.myongsik.myongsikandroid.data.model.user.ResponseUserData -import com.myongsik.myongsikandroid.data.repository.food.FoodRepository -import com.myongsik.myongsikandroid.BaseViewModel +import com.myongsik.myongsikandroid.data.model.user.toRequestUserEntity +import com.myongsik.myongsikandroid.data.model.user.toResponseUserData +import com.myongsik.myongsikandroid.domain.model.RequestUserEntity +import com.myongsik.myongsikandroid.domain.user.PostUserDataUseCase import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject @HiltViewModel class SplashViewModel @Inject constructor( - private val foodRepository: FoodRepository + private val postUserDataUseCase: PostUserDataUseCase ) : BaseViewModel() { private val _postUserData = MutableLiveData() @@ -19,10 +22,8 @@ class SplashViewModel @Inject constructor( get() = _postUserData fun postUser(requestUserData: RequestUserData) = launch { - val response = foodRepository.postUser(requestUserData) - - if (response.code() == 200) { - _postUserData.postValue(response.body()) + postUserDataUseCase(requestUserData.toRequestUserEntity())?.let { + _postUserData.postValue(it.toResponseUserData()) } } } \ No newline at end of file diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/WidgetSettingViewModel.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/WidgetSettingViewModel.kt similarity index 97% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/WidgetSettingViewModel.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/WidgetSettingViewModel.kt index e6cb7a42..cb76af39 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/food/WidgetSettingViewModel.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/WidgetSettingViewModel.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.viewmodel.food +package com.myongsik.myongsikandroid.presentation.viewmodel.food import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/LoveViewModel.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/LoveViewModel.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/LoveViewModel.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/LoveViewModel.kt index d46a278b..e9685b99 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/LoveViewModel.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/LoveViewModel.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.viewmodel.search +package com.myongsik.myongsikandroid.presentation.viewmodel.search import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/SearchViewModel.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/SearchViewModel.kt similarity index 97% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/SearchViewModel.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/SearchViewModel.kt index 5f7fc841..52eeedce 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/viewmodel/search/SearchViewModel.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/search/SearchViewModel.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.viewmodel.search +package com.myongsik.myongsikandroid.presentation.viewmodel.search import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData diff --git a/app/src/main/java/com/myongsik/myongsikandroid/ui/widget/MenuWidget.kt b/app/src/main/java/com/myongsik/myongsikandroid/presentation/widget/MenuWidget.kt similarity index 96% rename from app/src/main/java/com/myongsik/myongsikandroid/ui/widget/MenuWidget.kt rename to app/src/main/java/com/myongsik/myongsikandroid/presentation/widget/MenuWidget.kt index 200b2d74..109dfb21 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/ui/widget/MenuWidget.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/presentation/widget/MenuWidget.kt @@ -1,4 +1,4 @@ -package com.myongsik.myongsikandroid.ui.widget +package com.myongsik.myongsikandroid.presentation.widget import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetProvider diff --git a/app/src/main/java/com/myongsik/myongsikandroid/util/CommonUtil.kt b/app/src/main/java/com/myongsik/myongsikandroid/util/CommonUtil.kt index 4cdc6a13..045533d5 100644 --- a/app/src/main/java/com/myongsik/myongsikandroid/util/CommonUtil.kt +++ b/app/src/main/java/com/myongsik/myongsikandroid/util/CommonUtil.kt @@ -20,7 +20,7 @@ import com.myongsik.myongsikandroid.R import com.myongsik.myongsikandroid.alarm.UpdateWidgetWorker import com.myongsik.myongsikandroid.data.type.WidgetType import com.myongsik.myongsikandroid.data.type.toWidgetType -import com.myongsik.myongsikandroid.ui.widget.MenuWidget +import com.myongsik.myongsikandroid.presentation.widget.MenuWidget object CommonUtil { fun hideKeyboard(activity: Activity) { diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index a788f5f7..01d9f567 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -5,7 +5,7 @@ android:id="@+id/fragment_home" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.view.food.HomeFragment"> + tools:context=".presentation.view.food.HomeFragment"> + tools:context=".presentation.view.search.LoveFragment"> + tools:context=".presentation.view.search.SearchFragment"> + tools:context=".presentation.view.food.HomeFragment">