Skip to content

[Feat] 공휴일 API를 받아와서 공휴일 점심에 스낵코너가 안뜨게 처리해요#501

Merged
HI-JIN2 merged 10 commits intodevelopfrom
feat/public-holiday
Mar 17, 2026
Merged

[Feat] 공휴일 API를 받아와서 공휴일 점심에 스낵코너가 안뜨게 처리해요#501
HI-JIN2 merged 10 commits intodevelopfrom
feat/public-holiday

Conversation

@HI-JIN2
Copy link
Member

@HI-JIN2 HI-JIN2 commented Mar 16, 2026

Summary

  • 공휴일 API(apIs.data.go.kr) 연동 및 월 단위 캐시(usecase) 추가
  • 메뉴 로딩 로직을 LoadMenusUseCase로 이동하고, 공휴일인 경우 고정 식당(푸드코트/스낵코너) 제외

Describe your changes

  • BuildConfig.HOLIDAY_API_KEY를 통해 키 주입(미설정/blank면 공휴일 조회는 스킵)
  • PublicHolidayModule로 별도 Retrofit/Service 제공
  • usecase명 및 파라미터 변경에 따른 MenuViewModelBehaviorSpec 수정
Screen_recording_20260317_100131.webm

3.2가 대체공휴일인데 이날 스낵코너가 안뜨게 만듦 / 3.3은 스낵코너 뜸

Issue

To reviewers

  • 로컬에서 공휴일 기능 확인하려면 local.propertiesHOLIDAY_API_KEY를 설정하세요. notion에서 확인

@HI-JIN2 HI-JIN2 marked this pull request as draft March 16, 2026 16:46
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the integration of a public holiday API to dynamically adjust the displayed menus based on whether the current date is a public holiday. It enhances user experience by informing them of public holidays and adjusting the menu display accordingly. The changes include fetching holiday data, caching it for efficiency, modifying menu loading logic, and displaying a holiday banner on the menu screen.

Highlights

  • 공휴일 API 연동: 공휴일 API(apIs.data.go.kr)를 연동하여 공휴일 정보를 가져오고, 월 단위로 캐시하여 성능을 개선했습니다.
  • 메뉴 로딩 로직 변경: 메뉴 로딩 로직을 LoadMenusUseCase로 이동하고, 공휴일인 경우 푸드코트/스낵코너 메뉴를 제외하도록 변경했습니다.
  • 공휴일 배너 표시: 메뉴 화면에 공휴일 배너("공휴일: %s")를 표시하여 사용자에게 공휴일임을 알립니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Activity
  • 공휴일 API 연동 및 월 단위 캐시 추가
  • 메뉴 로딩 로직 변경 및 공휴일 처리 추가
  • 메뉴 화면에 공휴일 배너 표시
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@HI-JIN2 HI-JIN2 self-assigned this Mar 16, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 공휴일 정보를 API로부터 가져와 메뉴 로딩 로직에 반영하고, UI에 공휴일 배너를 표시하는 기능 추가를 잘 구현했습니다. 전반적으로 코드 구조가 좋고, UseCase를 활용하여 관심사를 잘 분리했습니다. 몇 가지 개선점을 제안드립니다. 첫째, 공휴일 정보를 캐시하는 부분에서 메모리 효율성을 높이기 위해 LruCache 사용을 고려해볼 수 있습니다. 둘째, PublicHolidayRepository에 정의된 getHoliday 메서드는 현재 사용되지 않고 비효율적으로 구현될 수 있어, 혼동을 줄이기 위해 제거하는 것이 좋아 보입니다. 자세한 내용은 각 파일의 주석을 참고해주세요.

private val publicHolidayRepository: PublicHolidayRepository,
) {
private val mutex = Mutex()
private val cache: MutableMap<YearMonth, List<PublicHoliday>> = linkedMapOf()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

현재 월 단위 캐시로 LinkedHashMap을 사용하고 있는데, 캐시의 크기에 제한이 없어 사용자가 여러 달을 탐색할 경우 메모리 사용량이 계속 증가할 수 있습니다. 메모리 효율성을 높이기 위해 LruCache와 같이 크기가 제한된 캐시를 사용하는 것을 권장합니다.

예시:

import androidx.collection.LruCache // or android.util.LruCache

// ...

private val cache = LruCache<YearMonth, List<PublicHoliday>>(12) // 최근 12개월 데이터 캐시

suspend operator fun invoke(yearMonth: YearMonth): List<PublicHoliday> {
    mutex.withLock {
        cache.get(yearMonth)?.let { return it }
    }

    val result = publicHolidayRepository.getHolidays(yearMonth)

    mutex.withLock {
        cache.put(yearMonth, result)
    }

    return result
}

Copy link
Member Author

Choose a reason for hiding this comment

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

반영했습니다. 월 캐시가 무제한으로 커지지 않도록 access-order LinkedHashMap 기반 LRU로 바꾸고 최대 12개월만 유지하도록 제한했습니다.

@HI-JIN2 HI-JIN2 changed the title [Feat] 메뉴 공휴일 배너 및 공휴일 반영 로딩 [Feat] 공휴일 API를 받아와서 공휴일 점심에 스낵코너가 안뜨게 처리해요 Mar 17, 2026
@HI-JIN2
Copy link
Member Author

HI-JIN2 commented Mar 17, 2026

리뷰 요청사항 반영했습니다.

  • PublicHolidayRepository#getHoliday / PublicHolidayRepositoryImpl#getHoliday 제거 (usecase에서만 공휴일 조회)
  • GetPublicHolidaysOfMonthUseCase 월 캐시를 LRU(최근 사용 12개)로 제한

@HI-JIN2 HI-JIN2 marked this pull request as ready for review March 17, 2026 01:23
@HI-JIN2 HI-JIN2 requested a review from PeraSite March 17, 2026 01:23
Copy link
Member

@PeraSite PeraSite left a comment

Choose a reason for hiding this comment

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

👍 👍

@HI-JIN2 HI-JIN2 merged commit a611a10 into develop Mar 17, 2026
2 checks passed
@HI-JIN2 HI-JIN2 deleted the feat/public-holiday branch March 17, 2026 07:41
@HI-JIN2 HI-JIN2 mentioned this pull request Mar 17, 2026
PeraSite pushed a commit that referenced this pull request Mar 17, 2026
* [Feat] 공휴일 API를 연동하고 메뉴 화면에 공휴일 배너를 표시합니다

* [Refactor] 메뉴 로딩(공휴일 포함) 로직을 UseCase로 이동합니다

* [Chore] 메뉴 공휴일 배너 노출 제거

* test: update MenuViewModelBehaviorSpec for LoadMenusUseCase

* [Refactor] 공휴일 캐시 제한 및 repository API 정리

* chore: 공휴일 API 관련 주석 추가

* refactor: simplify public holiday fetch

* chore: early return으로 수정
PeraSite added a commit that referenced this pull request Mar 17, 2026
* release: 3.2.6

* chore: 릴리즈 노트 문구 수정

* [Feat] 공휴일 API를 받아와서 공휴일 점심에 스낵코너가 안뜨게 처리해요 (#501)

* [Feat] 공휴일 API를 연동하고 메뉴 화면에 공휴일 배너를 표시합니다

* [Refactor] 메뉴 로딩(공휴일 포함) 로직을 UseCase로 이동합니다

* [Chore] 메뉴 공휴일 배너 노출 제거

* test: update MenuViewModelBehaviorSpec for LoadMenusUseCase

* [Refactor] 공휴일 캐시 제한 및 repository API 정리

* chore: 공휴일 API 관련 주석 추가

* refactor: simplify public holiday fetch

* chore: early return으로 수정

---------

Co-authored-by: Jin Yu <qldls0307@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

공휴일에 스낵코너 안뜨게 하기

2 participants