Skip to content

LC-2841 USER 가이드북 상페 API 연동#2156

Merged
yeji424 merged 2 commits intoLC-2838-Sprint-17from
LC-2841-USER-가이드북-상페-API-연동
Mar 3, 2026

Hidden character warning

The head ref may contain hidden characters: "LC-2841-USER-\uac00\uc774\ub4dc\ubd81-\uc0c1\ud398-API-\uc5f0\ub3d9"
Merged

LC-2841 USER 가이드북 상페 API 연동#2156
yeji424 merged 2 commits intoLC-2838-Sprint-17from
LC-2841-USER-가이드북-상페-API-연동

Conversation

@yeji424
Copy link
Collaborator

@yeji424 yeji424 commented Mar 3, 2026

  • 유저: 자료 정보 없이 /guidebooks/{id} 기반 fetchPublicGuidebookData 사용
  • 어드민: 기존 /guidebook/{id} 기반 상세/수정/복제 플로우 유지

연관 작업

- 유저: 자료 정보 없이 /guidebooks/{id} 기반 fetchPublicGuidebookData 사용
- 어드민: 기존 /guidebook/{id} 기반 상세/수정/복제 플로우 유지
@github-actions github-actions bot changed the title fix: 가이드북 유저/어드민별 조회 API 분리 LC-2841 USER 가이드북 상페 API 연동 Mar 3, 2026
@gemini-code-assist
Copy link

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!

이 PR은 가이드북 상세 조회 기능을 사용자 역할에 따라 분리하여 데이터 접근 제어를 강화합니다. 일반 사용자는 자료 정보가 제외된 공개용 API를 통해 가이드북 정보를 조회하고, 관리자는 기존 API를 통해 모든 정보를 관리할 수 있도록 합니다. 이를 통해 보안을 개선하고 API의 목적을 명확히 하여 코드의 유지보수성을 높입니다.

Highlights

  • API 분리: 가이드북 상세 조회 API가 유저용과 어드민용으로 분리되었습니다. 유저용 API는 자료 정보를 포함하지 않습니다.
  • 새로운 API 엔드포인트: 유저용 가이드북 상세 조회를 위해 /api/v1/guidebooks/{guidebookId} 엔드포인트와 fetchPublicGuidebookData 함수가 도입되었습니다.
  • 데이터 스키마 및 매핑: PublicGuidebookSchema가 추가되었고, API 응답 데이터를 UI 모델로 변환하는 mapPublicGuidebook 유틸리티 함수가 새로 생성되었습니다.
  • 기존 코드 변경: 기존 fetchGuidebookData 호출은 fetchPublicGuidebookData로 대체되었으며, 관련 컴포넌트의 타입 정의가 업데이트되었습니다.
  • 목 데이터 제거: 개발용으로 사용되던 getGuidebookMockData 함수가 제거되었습니다.

🧠 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.

Changelog
  • src/api/program.ts
    • GuidebookIdSchema 임포트가 제거되었습니다.
    • getPublicGuidebookSchemaPublicGuidebookSchema 임포트가 추가되었습니다.
    • fetchGuidebookData 함수가 fetchPublicGuidebookData로 이름이 변경되고, 유저용 API 엔드포인트와 반환 타입이 업데이트되었습니다.
    • 개발용 목 데이터 함수 getGuidebookMockData가 제거되었습니다.
    • API 호출 실패 시 목 데이터를 반환하는 대신 에러를 throw하도록 변경되었습니다.
  • src/app/(user)/program/guidebook/[id]/[title]/page.tsx
    • fetchGuidebookData 호출이 fetchPublicGuidebookData로 변경되었습니다.
    • mapPublicGuidebook 유틸리티 함수를 임포트하고 API 응답 데이터를 매핑하는 로직이 추가되었습니다.
  • src/app/(user)/program/guidebook/[id]/page.tsx
    • fetchGuidebookData 호출이 fetchPublicGuidebookData로 변경되었습니다.
    • mapPublicGuidebook 유틸리티 함수를 임포트하고 API 응답 데이터를 매핑하는 로직이 추가되었습니다.
  • src/domain/program/guidebook/GuidebookView.tsx
    • guidebook prop의 타입이 GuidebookIdSchema에서 GuidebookPublicViewModel로 업데이트되었습니다.
    • GuidebookPublicViewModel이 임포트되었습니다.
  • src/domain/program/guidebook/ui/GuidebookBasicInfoSection.tsx
    • guidebook prop의 타입이 GuidebookIdSchema에서 GuidebookPublicViewModel로 업데이트되었습니다.
    • GuidebookPublicViewModel이 임포트되었습니다.
  • src/domain/program/guidebook/utils/publicGuidebookMapping.ts
    • 새로운 파일이 추가되었습니다.
    • GuidebookPublicViewModel 인터페이스가 정의되었습니다.
    • PublicGuidebookSchemaGuidebookPublicViewModel로 변환하는 mapPublicGuidebook 함수가 구현되었습니다.
  • src/schema.ts
    • 새로운 getPublicGuidebookSchemaPublicGuidebookSchema가 정의되었습니다.
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.

Copy link

@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

This pull request integrates a new API (fetchPublicGuidebookData) for fetching guidebook details and updates the related UI. It successfully replaces mock data with a real API, enhances error handling, and improves separation of concerns by introducing the mapPublicGuidebook function for UI model mapping. However, a critical security vulnerability has been identified: the fetchPublicGuidebookData function lacks input validation for the guidebookId parameter, which is used to construct a URL for a server-side fetch call. This could expose the API server to path traversal or Server-Side Request Forgery (SSRF) attacks. Additionally, a potential bug exists in the price calculation logic, which might incorrectly handle cases where the final price is 0.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@yeji424 yeji424 merged commit 739beed into LC-2838-Sprint-17 Mar 3, 2026
3 checks passed
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.

1 participant