Skip to content

[Feat] 켐페인 보낸 제안 조회#118

Merged
ParkJiYeoung8297 merged 2 commits into
devfrom
feat/#53-get-campaign-proposal
Jan 30, 2026
Merged

[Feat] 켐페인 보낸 제안 조회#118
ParkJiYeoung8297 merged 2 commits into
devfrom
feat/#53-get-campaign-proposal

Conversation

@ParkJiYeoung8297
Copy link
Copy Markdown
Contributor

@ParkJiYeoung8297 ParkJiYeoung8297 commented Jan 30, 2026

Summary

캠페인 보낸 제안 조회 기능 추가

Changes

  • campaign proposal 관련 코드 수정

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

#53

참고 사항

아직 사용자 확인과 같은 권한 예외처리가 필요합니다.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ParkJiYeoung8297, 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 엔드포인트를 도입하여 특정 캠페인 제안의 모든 관련 정보(예: 콘텐츠 태그, 제안 상태)를 효율적으로 검색하고 반환할 수 있도록 합니다. 이는 사용자 경험을 개선하고 제안 관리의 투명성을 높이는 데 기여합니다.

Highlights

  • 새로운 캠페인 제안 조회 서비스 추가: 캠페인 제안의 상세 정보를 조회하는 CampaignProposalQueryService가 도입되었습니다.
  • 캠페인 제안 상세 조회 API 구현: /api/v1/campaigns/proposal/{campaignProposalId} 엔드포인트가 추가되어 특정 캠페인 제안의 상세 정보를 제공합니다.
  • 연관된 태그와 함께 제안 조회 기능 개선: CampaignProposalRepositoryfindByIdWithTags 메서드가 추가되어 N+1 문제를 방지하며 제안과 연관된 태그 정보를 효율적으로 가져옵니다.
  • 캠페인 제안 관련 예외 처리 추가: CAMPAIGN_PROPOSAL_NOT_FOUND 오류 코드가 추가되어 존재하지 않는 캠페인 제안 조회 시 적절한 응답을 제공합니다.
  • 캠페인 제안 DTO 업데이트: CampaignProposalDetailResponseCampaignProposalContentTag를 사용하도록 변경되었고, 태그 정보 처리 로직이 간소화되었습니다.
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
Copy Markdown
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은 캠페인 제안 상세 조회 기능을 추가하는 변경사항을 담고 있습니다. 전반적으로 새로운 기능이 잘 구현되었지만, 한 가지 중요한 보안 이슈가 발견되었습니다. 인증된 사용자가 ID만 알면 다른 사용자의 제안 정보를 조회할 수 있는 권한 문제가 있습니다. 이를 해결하기 위한 제안을 리뷰 코멘트로 남겼습니다. 또한, 이와 관련하여 필요한 에러 코드 추가에 대한 제안도 포함했습니다. 해당 부분들을 수정하여 API의 보안을 강화하는 것이 좋겠습니다.

Comment on lines +27 to +30
CampaignProposal proposal = campaignProposalRepository.findByIdWithTags(proposalId)
.orElseThrow(() -> new CustomException(BusinessErrorCode.CAMPAIGN_PROPOSAL_NOT_FOUND));

return CampaignProposalDetailResponse.from(proposal);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

userId 파라미터가 사용되지 않고 있어, 인증된 사용자가 다른 사용자의 제안 정보를 조회할 수 있는 보안 취약점이 있습니다. 제안을 조회하기 전에 현재 사용자가 해당 제안(creator 또는 brand 소속)에 접근할 권한이 있는지 확인하는 로직을 추가해야 합니다. BusinessErrorCode에 제안한 PROPOSAL_ACCESS_FORBIDDEN 에러 코드를 사용하여 권한이 없는 경우 예외를 발생시키는 것을 권장합니다.

        CampaignProposal proposal = campaignProposalRepository.findByIdWithTags(proposalId)
                .orElseThrow(() -> new CustomException(BusinessErrorCode.CAMPAIGN_PROPOSAL_NOT_FOUND));

        Long creatorId = proposal.getCreator().getId();
        Long brandUserId = (proposal.getBrand().getUser() != null) ? proposal.getBrand().getUser().getId() : null;

        if (!userId.equals(creatorId) && !userId.equals(brandUserId)) {
            throw new CustomException(BusinessErrorCode.PROPOSAL_ACCESS_FORBIDDEN);
        }

        return CampaignProposalDetailResponse.from(proposal);

CAMPAIGN_APPLY_ALREADY_APPLIED(HttpStatus.BAD_REQUEST, "CAMPAIGN_400_1", "이미 지원한 캠페인입니다.");
CAMPAIGN_APPLY_ALREADY_APPLIED(HttpStatus.BAD_REQUEST, "CAMPAIGN_400_1", "이미 지원한 캠페인입니다."),

CAMPAIGN_PROPOSAL_NOT_FOUND(HttpStatus.NOT_FOUND, "CAMPAIGN_404_1", "캠페인 지원 내역이 없습니다.");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

제안 상세 조회 시 권한이 없는 사용자의 접근을 막기 위한 에러 코드를 추가하는 것이 좋습니다. CampaignProposalQueryService에서 권한 검사를 추가할 때 이 에러 코드를 사용할 수 있습니다.

Suggested change
CAMPAIGN_PROPOSAL_NOT_FOUND(HttpStatus.NOT_FOUND, "CAMPAIGN_404_1", "캠페인 지원 내역이 없습니다.");
CAMPAIGN_PROPOSAL_NOT_FOUND(HttpStatus.NOT_FOUND, "CAMPAIGN_404_1", "캠페인 지원 내역이 없습니다."),
PROPOSAL_ACCESS_FORBIDDEN(HttpStatus.FORBIDDEN, "PROPOSAL_403_1", "해당 제안에 접근할 권한이 없습니다.");

@ParkJiYeoung8297 ParkJiYeoung8297 merged commit 2378ae4 into dev Jan 30, 2026
1 check passed
@ParkJiYeoung8297 ParkJiYeoung8297 deleted the feat/#53-get-campaign-proposal branch January 30, 2026 01:59
@ParkJiYeoung8297 ParkJiYeoung8297 self-assigned this Jan 31, 2026
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