Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d2321c2
[feat]: home response 작성 (#64)
Nico1eKim May 23, 2025
af0e423
[feat]: home service 작성 (#64)
Nico1eKim May 23, 2025
3b39b08
[feat]: home repository 작성 (#64)
Nico1eKim May 23, 2025
560e0bc
[feat]: home viewmodel 작성 (#64)
Nico1eKim May 23, 2025
05c2363
[feat]: home service model 작성 (#64)
Nico1eKim May 23, 2025
e59a0c9
[refactor]: home response 수정 (#64)
Nico1eKim May 23, 2025
c65418f
[feat]: home api 연결 로직 작성 (#64)
Nico1eKim May 23, 2025
28367e2
[feat]: home main recommend api 연결 (#64)
Nico1eKim May 23, 2025
8a01f26
[feat]: home sub recommend api 연결 (#64)
Nico1eKim May 23, 2025
966f4a7
[refactor]: home api 수정 반영 (#64)
Nico1eKim May 31, 2025
4a23843
[chore]: 필요없는 dummy 파일 제거 (#64)
Nico1eKim May 31, 2025
779b4b5
[refactor]: home api 이미지 수정 반영 (#64)
Nico1eKim May 31, 2025
305c18c
Merge branch 'develop' of https://github.com/OurMenu/OurMenu-Android-…
Nico1eKim May 31, 2025
3196a80
Merge branch 'develop' of https://github.com/OurMenu/OurMenu-Android-…
Nico1eKim Aug 1, 2025
321b6dc
[feat]: 홈화면에 다이얼로그 뜨도록 하기 (#64)
Nico1eKim Aug 1, 2025
01f0fa9
[feat]: home service에 post api 추가 (#64)
Nico1eKim Aug 1, 2025
ad004e0
[feat]: home request, response 추가 (#64)
Nico1eKim Aug 1, 2025
6813ccd
[feat]: home repository에 post 추가 (#64)
Nico1eKim Aug 1, 2025
857478c
[feat]: home viewmodel 작성 (#64)
Nico1eKim Aug 1, 2025
8454484
[refactor]: home dialog 수정 (#64)
Nico1eKim Aug 1, 2025
f88d823
[refactor]: home dialog 질문 다시 받아오도록 수정 (#64)
Nico1eKim Aug 1, 2025
5268aee
[feat]: home dialog api 연결 (#64)
Nico1eKim Aug 1, 2025
704fb9f
[fix]: 함수 이름 수정 (#64)
Nico1eKim Aug 1, 2025
3d2eafe
[feat]: 식사시간 됐을 때 정보 다시 받아오도록 수정 (#64)
Nico1eKim Aug 1, 2025
cfa6c14
[ui]: home padding 수정 (#64)
Nico1eKim Aug 13, 2025
5a50798
[feat]: home에서 item 클릭하면 menu info로 넘어가도록 navigation 구현 (#64)
Nico1eKim Aug 13, 2025
7db7911
[feat]: home화면 상단바 버튼 누르면 add menu로 이동하도록 navigation 구현 (#64)
Nico1eKim Aug 13, 2025
9f6ace9
Merge branch 'develop' of https://github.com/OurMenu/OurMenu-Android-…
Nico1eKim Aug 13, 2025
d15b8c7
[chore]: gitignore에 deploymentTargetSelector.xml 추가 (#64)
Nico1eKim Aug 13, 2025
170d762
[fix]: menuId type 수정 (#64)
Nico1eKim Aug 13, 2025
6710078
Merge branch 'develop' of https://github.com/OurMenu/OurMenu-Android-…
Nico1eKim Aug 13, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ output.json
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
deploymentTargetSelector.xml

# Keystore files
*.jks
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/kuit/ourmenu/data/di/ServiceModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.kuit.ourmenu.data.di
import com.kuit.ourmenu.data.service.AuthService
import com.kuit.ourmenu.data.service.CacheService
import com.kuit.ourmenu.data.service.DummyService
import com.kuit.ourmenu.data.service.HomeService
import com.kuit.ourmenu.data.service.MapService
import com.kuit.ourmenu.data.service.MenuFolderService
import com.kuit.ourmenu.data.service.MenuInfoService
Expand Down Expand Up @@ -48,6 +49,11 @@ object ServiceModule {
fun provideMenuFolderService(retrofit: Retrofit): MenuFolderService =
retrofit.create(MenuFolderService::class.java)

@Provides
@Singleton
fun provideHomeService(retrofit: Retrofit): HomeService =
retrofit.create(HomeService::class.java)

@Provides
@Singleton
fun provideMenuInfoService(retrofit: Retrofit): MenuInfoService =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.kuit.ourmenu.data.model.home.request

import kotlinx.serialization.Serializable

@Serializable
data class HomeAnswerRequest(
val answer: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kuit.ourmenu.data.model.home.response

import kotlinx.serialization.Serializable

@Serializable
data class HomeQuestionResponse(
val question: String,
val answers: List<Answer>
)
Comment on lines +5 to +9
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

백엔드 필드 네이밍 확인 및 @SerialName 필요 여부 체크

서버가 snake_case를 반환한다면 @SerialName이 필요합니다. 현재 camelCase로 선언되어 있어, Json 설정(namingStrategy) 여부에 따라 디코딩 실패 가능성이 있어요.

아래 스크립트로 Json 설정을 확인해 주세요. namingStrategy나 custom Json 설정이 없으면 @SerialName 추가를 고려하세요.


🏁 Script executed:

#!/bin/bash
# Json 빌더/설정 사용 위치 탐색
rg -n "Json\\s*\\{" -A 5
rg -n "namingStrategy|snake|ignoreUnknownKeys|isLenient"

Length of output: 1028


DTO 필드 직렬화 이름 확인 및 @SerialName 검토

NetworkModule의 Json 설정(isLenient, prettyPrint, encodeDefaults, explicitNulls, ignoreUnknownKeys만 사용)에는 snake_case → camelCase 변환 전략이 없어요.
따라서 서버가 snake_case 필드를 반환할 경우 아래 DTO 필드 매핑이 실패할 수 있습니다.

  • 파일: app/src/main/java/com/kuit/ourmenu/data/model/home/response/HomeQuestionResponse.kt (5–9행)
    • question
    • answers

▶ 백엔드 필드명이 snake_case인지 확인 후, snake_case로 전달된다면 각 필드에
@SerialName("snake_case_field") 어노테이션을 추가하거나
커스텀 네이밍 전략 구현을 검토해주세요.

🤖 Prompt for AI Agents
In
app/src/main/java/com/kuit/ourmenu/data/model/home/response/HomeQuestionResponse.kt
around lines 5 to 9, the DTO fields (question, answers) may not match backend
snake_case names because the project Json config does not perform
snake_case→camelCase mapping; if the backend sends snake_case, add @SerialName
annotations to each property with the exact snake_case field names (e.g.,
@SerialName("question_text") or whatever the backend uses) or alternatively
implement/apply a consistent naming strategy in the Json configuration to map
snake_case to camelCase across models.


@Serializable
data class Answer(
val answer: String,
val answerImgUrl: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.kuit.ourmenu.data.model.home.response

import kotlinx.serialization.Serializable

@Serializable
data class HomeResponse(
val answerImgUrl: String = "",
val answerRecommendMenus: List<RecommendMenuList> = emptyList(),
val tagRecommendImgUrl: String = "",
val tagRecommendMenus: List<RecommendMenuList> = emptyList(),
val otherRecommendImgUrl: String = "",
val otherRecommendMenus: List<RecommendMenuList> = emptyList(),
)

@Serializable
data class RecommendMenuList(
val menuId: Long = 0,
val menuTitle: String = "",
val storeName: String = "",
val menuImgUrl: String = "",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.kuit.ourmenu.data.repository

import com.kuit.ourmenu.data.model.base.handleBaseResponse
import com.kuit.ourmenu.data.model.home.request.HomeAnswerRequest
import com.kuit.ourmenu.data.service.HomeService
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class HomeRepository @Inject constructor(
private val homeService: HomeService,
) {
suspend fun getHome() = runCatching {
homeService.getHome().handleBaseResponse().getOrThrow()
}

suspend fun postHomeQuestion() = runCatching {
homeService.postHomeQuestion().handleBaseResponse().getOrThrow()
}

suspend fun postHomeAnswer(answer: String) = runCatching {
homeService.postHomeAnswer(HomeAnswerRequest(answer))
.handleBaseResponse()
.getOrThrow()
}
Comment on lines +13 to +25
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

runCatching이 CancellationException까지 삼킵니다 (코루틴 취소 전파 이슈)

네트워크 호출을 runCatching으로 감싸면 CancellationException까지 Result로 포장되어 취소가 전파되지 않을 수 있어요. 취소는 반드시 재던지거나 runCatching 대체 유틸로 처리하세요.

다음 유틸을 공용 모듈에 추가 후 사용을 권장합니다:

// 예: core/common/ResultExt.kt
suspend inline fun <T> cancellableRunCatching(crossinline block: suspend () -> T): Result<T> {
    return try {
        Result.success(block())
    } catch (e: kotlinx.coroutines.CancellationException) {
        throw e
    } catch (t: Throwable) {
        Result.failure(t)
    }
}

Repository에서는 아래처럼 교체:

-    suspend fun getHome() = runCatching {
+    suspend fun getHome() = cancellableRunCatching {
         homeService.getHome().handleBaseResponse().getOrThrow()
     }

-    suspend fun postHomeQuestion() = runCatching {
+    suspend fun postHomeQuestion() = cancellableRunCatching {
         homeService.postHomeQuestion().handleBaseResponse().getOrThrow()
     }

-    suspend fun postHomeAnswer(answer: String) = runCatching {
+    suspend fun postHomeAnswer(answer: String) = cancellableRunCatching {
         homeService.postHomeAnswer(HomeAnswerRequest(answer))
             .handleBaseResponse()
             .getOrThrow()
     }
🤖 Prompt for AI Agents
In app/src/main/java/com/kuit/ourmenu/data/repository/HomeRepository.kt around
lines 13 to 25, runCatching is currently wrapping suspend network calls and will
catch CancellationException which prevents coroutine cancellation from
propagating; replace runCatching with a cancellableRunCatching utility (add it
to a common module) or explicitly rethrow CancellationException in the catch
path so cancellations are not swallowed, then update each method (getHome,
postHomeQuestion, postHomeAnswer) to call the cancellableRunCatching helper so
Result only captures non-cancellation failures.

}
22 changes: 22 additions & 0 deletions app/src/main/java/com/kuit/ourmenu/data/service/HomeService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.kuit.ourmenu.data.service

import com.kuit.ourmenu.data.model.base.BaseResponse
import com.kuit.ourmenu.data.model.home.request.HomeAnswerRequest
import com.kuit.ourmenu.data.model.home.response.HomeQuestionResponse
import com.kuit.ourmenu.data.model.home.response.HomeResponse
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST

interface HomeService {
@GET("api/home")
suspend fun getHome(): BaseResponse<HomeResponse>

@POST("/api/home/questions")
suspend fun postHomeQuestion(): BaseResponse<HomeQuestionResponse>

@POST("/api/home/questions/answers")
suspend fun postHomeAnswer(
@Body answerRequest: HomeAnswerRequest
): BaseResponse<Unit>
Comment on lines +15 to +21
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Retrofit 경로 표기 혼용(선행 슬래시) — BaseUrl path 무시 위험

@post에 선행 슬래시가 있어 baseUrl의 path 세그먼트를 무시할 수 있습니다. 상대 경로로 통일하는 것을 권장합니다.

-    @POST("/api/home/questions")
+    @POST("api/home/questions")
     suspend fun postHomeQuestion(): BaseResponse<HomeQuestionResponse>

-    @POST("/api/home/questions/answers")
+    @POST("api/home/questions/answers")
     suspend fun postHomeAnswer(
         @Body answerRequest: HomeAnswerRequest
     ): BaseResponse<Unit>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@POST("/api/home/questions")
suspend fun postHomeQuestion(): BaseResponse<HomeQuestionResponse>
@POST("/api/home/questions/answers")
suspend fun postHomeAnswer(
@Body answerRequest: HomeAnswerRequest
): BaseResponse<Unit>
@POST("api/home/questions")
suspend fun postHomeQuestion(): BaseResponse<HomeQuestionResponse>
@POST("api/home/questions/answers")
suspend fun postHomeAnswer(
@Body answerRequest: HomeAnswerRequest
): BaseResponse<Unit>
🤖 Prompt for AI Agents
In app/src/main/java/com/kuit/ourmenu/data/service/HomeService.kt around lines
15 to 21, the @POST annotations use leading slashes which can cause Retrofit to
ignore baseUrl path segments; change the paths to relative by removing the
leading '/' for both "/api/home/questions" and "/api/home/questions/answers" so
they become "api/home/questions" and "api/home/questions/answers" respectively
to preserve the baseUrl path.

}
115 changes: 0 additions & 115 deletions app/src/main/java/com/kuit/ourmenu/ui/common/dialog/DialogBigButton.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import com.kuit.ourmenu.ui.theme.NeutralWhite

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun OurMenuAddButtonTopAppBar(modifier: Modifier = Modifier) {
fun OurMenuAddButtonTopAppBar(
modifier: Modifier = Modifier,
onAddMenuClick: () -> Unit = {}
) {
Comment on lines +21 to +24
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

기존 사용처에서 업데이트 필요 확인

관련 파일들에서 OurMenuAddButtonTopAppBar() 호출부들이 새 파라미터 없이 사용되고 있는데, 기본값이 있어서 컴파일은 되겠지만 실제 기능을 원한다면 콜백을 전달해야 할 것 같습니다.

다음 스크립트로 다른 사용처들이 업데이트가 필요한지 확인해보세요:

Also applies to: 41-41


🏁 Script executed:

#!/bin/bash
# OurMenuAddButtonTopAppBar 사용처들을 찾아서 콜백 전달 여부 확인
rg -A 3 "OurMenuAddButtonTopAppBar\(" --type kotlin

Length of output: 2037


기능 동작용 콜백 전달 필수 – 호출부 수정 필요

SearchMenuScreen.kt와 MenuInfoMapScreen.kt의 OurMenuAddButtonTopAppBar() 호출부가 기본 빈 람다만 받도록 남아있습니다. 실제 추가 메뉴로 이동하거나 원하는 액션을 수행하려면 onAddMenuClick 파라미터에 적절한 콜백을 전달해주세요.

  • app/src/main/java/com/kuit/ourmenu/ui/searchmenu/screen/SearchMenuScreen.kt
    - topBar = { OurMenuAddButtonTopAppBar() }
    + topBar = { OurMenuAddButtonTopAppBar(onAddMenuClick = onNavigateToAddMenu) }
  • app/src/main/java/com/kuit/ourmenu/ui/menuinfo/screen/MenuInfoMapScreen.kt
    - topBar = { OurMenuAddButtonTopAppBar() }
    + topBar = {
    +   OurMenuAddButtonTopAppBar(
    +     onAddMenuClick = { /* TODO: 추가 메뉴 화면으로 네비게이션 */ }
    +   )
    + }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fun OurMenuAddButtonTopAppBar(
modifier: Modifier = Modifier,
onAddMenuClick: () -> Unit = {}
) {
// File: app/src/main/java/com/kuit/ourmenu/ui/searchmenu/screen/SearchMenuScreen.kt
@@
- topBar = { OurMenuAddButtonTopAppBar() }
+ topBar = { OurMenuAddButtonTopAppBar(onAddMenuClick = onNavigateToAddMenu) }
// File: app/src/main/java/com/kuit/ourmenu/ui/menuinfo/screen/MenuInfoMapScreen.kt
@@
- topBar = { OurMenuAddButtonTopAppBar() }
+ topBar = {
+ OurMenuAddButtonTopAppBar(
+ onAddMenuClick = { /* TODO: 추가 메뉴 화면으로 네비게이션 */ }
+ )
+ }

// 기본
TopAppBar(
modifier = modifier.fillMaxWidth(),
Expand All @@ -35,7 +38,7 @@ fun OurMenuAddButtonTopAppBar(modifier: Modifier = Modifier) {
},
actions = {
IconButton(
onClick = { /* TODO : Add Menu Button Click Event */ },
onClick = onAddMenuClick,
modifier = Modifier.padding(end = 20.dp)
) {
Icon(
Expand Down
Loading