Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import kotlinx.serialization.Serializable
@Serializable
data class MapDetailResponse(
@SerialName("menuId")
val menuId: Int,
val menuId: Long,
@SerialName("menuTitle")
val menuTitle: String,
@SerialName("menuPrice")
val menuPrice: Int,
@SerialName("storeTitle")
val storeTitle: String,
@SerialName("menuPinImgUrl")
val menuPinImgUrl: String,
@SerialName("menuTagImgUrls")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import kotlinx.serialization.Serializable
@Serializable
data class MapMenuDetailResponse(
@SerialName("menuId")
val menuId: Int,
val menuId: Long,
@SerialName("menuTitle")
val menuTitle: String,
@SerialName("storeTitle")
val storeTitle: String,
@SerialName("menuPrice")
val menuPrice: Int,
@SerialName("menuPinImgUrl")
Expand All @@ -20,11 +22,11 @@ data class MapMenuDetailResponse(
@SerialName("menuFolderInfo")
val menuFolderInfo: MenuFolderInfo,
@SerialName("mapId")
val mapId: Int,
val mapId: Long,
@SerialName("mapX")
val mapX: Int,
val mapX: Double,
@SerialName("mapY")
val mapY: Int,
val mapY: Double,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class MapSearchHistoryResponse(
@SerialName("menuId")
val menuId: Int,
val menuId: Long,
@SerialName("menuTitle")
val menuTitle: String,
@SerialName("storeTitle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import kotlinx.serialization.Serializable

@Serializable
data class MenuFolderAllResponse(
override val menuId: Int,
override val menuId: Long,
override val menuTitle: String,
override val storeTitle: String,
override val storeAddress: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class MenuFolderDetailResponse(

@Serializable
data class MenuFolderDetailMenus(
override val menuId: Int = 0,
override val menuId: Long = 0,
override val menuTitle: String = "",
override val storeTitle: String = "",
override val storeAddress: String = "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.kuit.ourmenu.data.model.menuFolder.response

interface MenuFolderMenuItem {
val menuId: Int
val menuId: Long
val menuTitle: String
val storeTitle: String
val storeAddress: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data class MenuFolderResponse(

@Serializable
data class MenuFolderList(
val menuFolderId: Int,
val menuFolderId: Long,
val menuFolderTitle: String,
val menuFolderImgUrl: String,
val menuFolderIconImgUrl: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import kotlinx.serialization.Serializable

@Serializable
data class MenuInfoResponse(
val menuId: Int = 0,
val menuId: Long = 0,
val menuTitle: String = "",
val menuPrice: Int = 0,
val menuPinImgUrl: String = "",
val menuMemoTitle: String = "",
val menuMemoContent: String = "",
val storeTitle: String = "",
val storeAddress: String = "",
val tagImgUrls: List<String> = emptyList(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MenuFolderRepository @Inject constructor(
}

suspend fun getMenuFolderDetail(
menuFolderId: Int,
menuFolderId: Long,
sortOrder: String,
) = runCatching {
menuFolderService.getMenuFolderDetails(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MenuInfoRepository @Inject constructor(
private val menuInfoService: MenuInfoService
) {
suspend fun getMenuInfo(
menuId: Int
menuId: Long
) = runCatching {
menuInfoService.getMenuInfo(menuId).handleBaseResponse().getOrThrow()
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/kuit/ourmenu/data/service/MapService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ interface MapService {
@GET("api/users/menus/{mapId}/maps")
suspend fun getMapDetail(
@Path("mapId") mapId: Long
): BaseResponse<List<MapDetailResponse>> // TODO: 리팩토링
): BaseResponse<List<MapDetailResponse>>

@GET("api/users/menus/maps")
suspend fun getMap(): BaseResponse<List<MapResponse>> // TODO: 리팩토링
suspend fun getMap(): BaseResponse<List<MapResponse>>

@GET("api/users/menus/maps/{menuId}/search")
suspend fun getMapMenuDetail(
@Path("menuId") menuId: Long
): BaseResponse<MapMenuDetailResponse> // TODO: 리팩토링
): BaseResponse<MapMenuDetailResponse>

@GET("api/users/menus/maps/search")
suspend fun getMapSearch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface MenuFolderService {

@GET("api/menu-folders/{menuFolderId}/menus")
suspend fun getMenuFolderDetails(
@Path("menuFolderId") menuFolderId: Int,
@Path("menuFolderId") menuFolderId: Long,
@Query("sortOrder") sortOrder: String,
): BaseResponse<MenuFolderDetailResponse>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import retrofit2.http.Path
interface MenuInfoService {
@GET("api/menus/{menuId}")
suspend fun getMenuInfo(
@Path("menuId") menuId: Int
@Path("menuId") menuId: Long
): BaseResponse<MenuInfoResponse>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.kuit.ourmenu.ui.common.bottomsheet

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -38,12 +40,17 @@ import com.kuit.ourmenu.utils.ExtensionUtil.toWon
@Composable
fun MenuInfoBottomSheetContent(
modifier: Modifier = Modifier,
menuInfoData: MapDetailResponse
menuInfoData: MapDetailResponse,
onClick: (Long) -> Unit
) {
Column(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 20.dp)
.clickable {
Log.d("MenuInfoBottomSheetContent", "Menu ID: ${menuInfoData.menuId}")
onClick(menuInfoData.menuId)
}
) {
MenuInfoContent(
modifier = Modifier
Expand Down Expand Up @@ -114,7 +121,7 @@ fun MenuInfoContent(
)
}
Text(
text = "응답에 가게명 누락", // TODO: 가게명 처리
text = menuInfoData.storeTitle,
style = ourMenuTypography().pretendard_600_14.copy(
lineHeight = 12.sp,
color = Neutral500
Expand Down Expand Up @@ -187,6 +194,7 @@ private fun MenuInfoBottomSheetContentPreview() {
menuInfoData = MapDetailResponse(
menuId = 1,
menuTitle = "Test Menu",
storeTitle = "가게 이름",
menuPrice = 10000,
menuPinImgUrl = "pin",
menuTagImgUrls = listOf("한식", "밥"),
Expand All @@ -200,5 +208,7 @@ private fun MenuInfoBottomSheetContentPreview() {
mapX = 127.0,
mapY = 37.0
)
)
){
// 클릭시 동작
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fun NavController.navigateToMenuFolder(navOptions: NavOptions) {
}

// 이동 이벤트 (menuFolderId 전달)
fun NavController.navigateToMenuFolderDetail(menuFolderId: Int) {
fun NavController.navigateToMenuFolderDetail(menuFolderId: Long) {
navigate(Routes.MenuFolderDetail(menuFolderId))
}

Expand All @@ -28,15 +28,15 @@ fun NavController.navigateToAddMenu() {
navigate(Routes.AddMenu)
}

fun NavController.navigateToMenuInfo(menuId: Int) {
fun NavController.navigateToMenuInfo(menuId: Long) {
navigate(Routes.MenuInfo(menuId))
}

fun NavGraphBuilder.menuFolderNavGraph(
navigateBack: () -> Unit,
navigateToMenuFolderDetail: (Int) -> Unit,
navigateToMenuFolderDetail: (Long) -> Unit,
navigateToMenuFolderAllMenu: () -> Unit,
navigateToMenuInfo: (Int) -> Unit,
navigateToMenuInfo: (Long) -> Unit,
navigateToAddMenu: () -> Unit,
) {
composable<MainTabRoute.MenuFolder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import kotlinx.coroutines.launch
@Composable
fun MenuFolderAllMenuScreen(
onNavigateBack: () -> Unit,
onNavigateToMenuInfo: (Int) -> Unit,
onNavigateToMenuInfo: (Long) -> Unit,
// onNavigateToMap: () -> Unit, // TODO: Map으로 화면 이동 구현
onNavigateToAddMenu: () -> Unit,
viewModel: MenuFolderAllViewModel = hiltViewModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import com.kuit.ourmenu.ui.theme.ourMenuTypography

@Composable
fun MenuFolderDetailScreen(
menuFolderId: Int,
onNavigateToMenuInfo: (Int) -> Unit,
menuFolderId: Long,
onNavigateToMenuInfo: (Long) -> Unit,
// onNavigateToMap: () -> Unit, // TODO: Map으로 화면 이동 구현
onNavigateToAddMenu: () -> Unit,
onNavigateBack: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import com.kuit.ourmenu.ui.theme.ourMenuTypography

@Composable
fun MenuFolderScreen(
onNavigateToDetail: (Int) -> Unit,
onNavigateToDetail: (Long) -> Unit,
onNavigateToAllMenu: () -> Unit,
onNavigateToAddMenu: () -> Unit,
viewModel: MenuFolderViewModel = hiltViewModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MenuFolderDetailViewModel @Inject constructor(
private val _menuFolderDetail = MutableStateFlow(MenuFolderDetailResponse())
val menuFolderDetail = _menuFolderDetail.asStateFlow()

private val _menuFolderId = MutableStateFlow(0)
private val _menuFolderId = MutableStateFlow<Long>(0)
val menuFolderId = _menuFolderId.asStateFlow()

private val _sortOrder = MutableStateFlow(SortOrderType.TITLE_ASC)
Expand All @@ -31,7 +31,7 @@ class MenuFolderDetailViewModel @Inject constructor(
val isLoading = _isLoading.asStateFlow()

fun getMenuFolderDetail(
menuFolderId: Int,
menuFolderId: Long,
sortOrder: SortOrderType = _sortOrder.value
) {
_menuFolderId.value = menuFolderId
Expand All @@ -57,7 +57,7 @@ class MenuFolderDetailViewModel @Inject constructor(
}
}

fun updateSortOrder(sortOrderType: SortOrderType, menuFolderId: Int) {
fun updateSortOrder(sortOrderType: SortOrderType, menuFolderId: Long) {
if (_sortOrder.value != sortOrderType) {
_sortOrder.value = sortOrderType
getMenuFolderDetail(menuFolderId, sortOrderType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import androidx.navigation.toRoute
import com.kuit.ourmenu.ui.menuinfo.screen.MenuInfoDefaultScreen
import com.kuit.ourmenu.ui.navigator.Routes

fun NavController.navigateToMenuInfo(menuId: Int) {
fun NavController.navigateToMenuInfo(menuId: Long) {
navigate(Routes.MenuInfo(menuId))
}

fun NavGraphBuilder.menuInfoNavGraph(
navigateBack: () -> Unit,
navigateToMenuFolderDetail: (Int) -> Unit,
navigateToMenuFolderDetail: (Long) -> Unit,
navigateToMenuInfoMap: () -> Unit
) {
composable<Routes.MenuInfo> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ import com.kuit.ourmenu.ui.menuinfo.component.info.MenuInfoChipContent
import com.kuit.ourmenu.ui.menuinfo.component.info.MenuInfoContent
import com.kuit.ourmenu.ui.menuinfo.component.info.MenuInfoImagePager
import com.kuit.ourmenu.ui.menuinfo.component.info.MenuInfoMapButton
import com.kuit.ourmenu.ui.menuinfo.dummy.MenuInfoDummyData
import com.kuit.ourmenu.ui.menuinfo.viewmodel.MenuInfoViewModel
import com.kuit.ourmenu.ui.theme.Neutral300
import com.kuit.ourmenu.ui.theme.NeutralWhite

@Composable
fun MenuInfoDefaultScreen(
menuId: Int,
menuId: Long,
onNavigateBack: () -> Unit,
onNavigateToMenuFolderDetail: (Int) -> Unit,
onNavigateToMenuFolderDetail: (Long) -> Unit,
// onNavigateToMap: () -> Unit,
viewModel: MenuInfoViewModel = hiltViewModel()
) {
Expand Down Expand Up @@ -73,15 +72,15 @@ fun MenuInfoDefaultScreen(
)

MenuInfoChipContent(
onNavigateToMenuFolderDetail = onNavigateToMenuFolderDetail,
// TODO: 메뉴 폴더 정보에 따라 변경 필요, 여러개인 경우 각 폴더에 대한 이동 구현
// onNavigateToMenuFolderDetail = onNavigateToMenuFolderDetail(menuInfo.menuFolders.),
menuInfoData = menuInfo
)
Comment on lines +75 to 78

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

메뉴 폴더 네비게이션 로직 확인이 필요해요

Line 76에서 주석 처리된 코드를 보면 menuInfo.menuFolders.에서 끝나는데, 이는 메뉴가 여러 폴더에 속할 수 있다는 것을 시사합니다. TODO 주석도 있고요.

현재 MenuInfoChipContentonNavigateToMenuFolderDetail 콜백이 연결되지 않은 상태인데, 이게 의도된 건지 확인해보세요.


🏁 Script executed:

#!/bin/bash
# MenuInfoChipContent의 시그니처와 사용법을 확인해보겠습니다
ast-grep --pattern $'@Composable
fun MenuInfoChipContent($$$) {
  $$$
}'

Length of output: 5917


메뉴 폴더 네비게이션 콜백 연결 확인 및 구현 필요

MenuInfoChipContent에 onNavigateToMenuFolderDetail 파라미터를 넘기지 않아 기본값({})만 호출되고 있습니다. TODO에 적힌 대로 “폴더별 이동 로직”을 적용하려면 상위 콜백을 제대로 전달해야 합니다.

  • 파일: app/src/main/java/com/kuit/ourmenu/ui/menuinfo/screen/MenuInfoDefaultScreen.kt
    라인 75–78
  • 수정 제안:
    MenuInfoChipContent(
        // TODO: 폴더별 ID를 인자로 전달하여 개별 네비게이션 구현
        onNavigateToMenuFolderDetail = onNavigateToMenuFolderDetail,
        menuInfoData = menuInfo
    )
  • 또는 폴더 ID를 직접 람다로 매핑해야 한다면:
    MenuInfoChipContent(
        onNavigateToMenuFolderDetail = { folderId ->
            // folderId에 따른 화면 이동 로직 호출
            onNavigateToMenuFolderDetail(folderId)
        },
        menuInfoData = menuInfo
    )

위와 같이 콜백을 연결한 뒤, MenuInfoFolderChipGrid 내부에서 폴더별 클릭 시 해당 ID가 상위 네비게이션 로직으로 전달되는지 확인해주세요.

🤖 Prompt for AI Agents
app/src/main/java/com/kuit/ourmenu/ui/menuinfo/screen/MenuInfoDefaultScreen.kt
lines 75-78: MenuInfoChipContent is missing the onNavigateToMenuFolderDetail
callback (defaults to empty), so pass the parent callback through or wrap it to
forward folder IDs; replace the current call to MenuInfoChipContent with one
that sets onNavigateToMenuFolderDetail = onNavigateToMenuFolderDetail (or
onNavigateToMenuFolderDetail = { id -> onNavigateToMenuFolderDetail(id) }) and
then confirm MenuInfoFolderChipGrid calls that lambda with the folderId when a
folder is clicked so navigation receives the correct ID.


MenuInfoAdditionalContent(
address = menuInfo.storeAddress,
// TODO: 메뉴 정보에 따라 변경 필요
memoTitle = MenuInfoDummyData.dummyData.memoTitle,
memoContent = MenuInfoDummyData.dummyData.memoContent
memoTitle = menuInfo.menuMemoTitle,
memoContent = menuInfo.menuMemoContent
)
}
MenuInfoMapButton(
Expand All @@ -105,4 +104,11 @@ private fun MenuInfoDefaultPreview() {
// val navController = rememberNavController()
//
// MenuInfoDefaultScreen(navController)
val viewModel: MenuInfoViewModel = hiltViewModel()
MenuInfoDefaultScreen(
menuId = 1,
onNavigateBack = {},
onNavigateToMenuFolderDetail = {},
viewModel = viewModel
)
}
Loading