Skip to content

Comments

feat(#362): 캠페인 태그 조회 api 추가#368

Merged
ParkJiYeoung8297 merged 2 commits intodevfrom
feat/#362-get-tag-content
Feb 11, 2026
Merged

feat(#362): 캠페인 태그 조회 api 추가#368
ParkJiYeoung8297 merged 2 commits intodevfrom
feat/#362-get-tag-content

Conversation

@ParkJiYeoung8297
Copy link
Contributor

@ParkJiYeoung8297 ParkJiYeoung8297 commented Feb 10, 2026

feat(#362): 캠페인 태그 조회 api 추가

Summary

캠페인 태그 조회 api 추가

Changes

  • 캠페인 태그 조회 api 추가

Type of Change

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

Related Issues

참고 사항

@gemini-code-assist
Copy link
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를 구현합니다. 이를 통해 사용자는 캠페인 콘텐츠에 필요한 태그를 보다 체계적으로 탐색하고 활용할 수 있게 됩니다. 새로운 서비스 레이어, 컨트롤러, 그리고 데이터 전송 객체(DTO)들이 추가되어 기능이 완성되었으며, 관련 Swagger 문서도 업데이트되었습니다.

Highlights

  • 새로운 API 엔드포인트 추가: 캠페인 태그를 정렬 기준별로 조회할 수 있는 /api/v1/tag-contents/sort 엔드포인트가 추가되었습니다.
  • 태그 정렬 기준 정의: 캠페인 콘텐츠 태그를 형식, 종류, 톤, 관여도, 활용 범위 등 다양한 기준으로 분류하는 ContentTagSort enum이 도입되었습니다.
  • 응답 DTO 구조화: 정렬된 태그 목록을 효율적으로 반환하기 위한 TagContentSortResponseTagItemResponse DTO가 새로 정의되었습니다.
  • Swagger 문서 업데이트: 기존 캠페인 제안 생성 API의 Swagger 문서에 새로 추가된 태그 조회 API에 대한 참조 및 안내가 추가되었습니다.
Changelog
  • src/main/java/com/example/RealMatch/business/application/service/TagContentSortQueryService.java
    • 캠페인 태그를 정렬 기준별로 그룹화하여 조회하는 비즈니스 로직을 추가했습니다.
  • src/main/java/com/example/RealMatch/business/domain/enums/ContentTagSort.java
    • 캠페인 콘텐츠 태그의 정렬 기준을 정의하는 enum을 추가했습니다.
  • src/main/java/com/example/RealMatch/business/presentation/controller/TagContentSortController.java
    • 새로운 태그 조회 API 엔드포인트를 처리하는 REST 컨트롤러를 추가했습니다.
  • src/main/java/com/example/RealMatch/business/presentation/dto/response/CollaborationPageResponse.java
    • 협업 페이지 응답을 위한 DTO를 추가했습니다.
  • src/main/java/com/example/RealMatch/business/presentation/dto/response/TagContentSortResponse.java
    • 정렬된 캠페인 태그 목록의 응답 구조를 정의하는 DTO를 추가했습니다.
  • src/main/java/com/example/RealMatch/business/presentation/dto/response/TagItemResponse.java
    • 개별 태그 항목의 ID와 이름을 포함하는 레코드 DTO를 추가했습니다.
  • src/main/java/com/example/RealMatch/business/presentation/swagger/CampaignProposalSwagger.java
    • 캠페인 제안 생성 API의 Swagger 설명에 태그 조회 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.

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를 추가하는 것을 목표로 하고 있습니다. 전반적으로 기능 구현은 잘 되었으나, 성능 및 유지보수성 측면에서 개선할 점이 보입니다. ContentTagSortContentTagType enum 간의 연관 관계를 타입-세이프하게 개선하고, TagContentSortQueryService에서 대규모 컬렉션의 인메모리 필터링 대신 데이터베이스 계층으로 로직을 푸시하여 성능을 최적화하는 것을 제안합니다.

Comment on lines +25 to +37
List<TagContent> allTags = tagContentRepository.findAll();

return Arrays.stream(ContentTagSort.values())
.map(sort -> {
List<TagContent> filtered = allTags.stream()
.filter(tag ->
tag.getTagType().name().equals(sort.name())
)
.toList();

return TagContentSortResponse.from(sort, filtered);
})
.toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

high

현재 tagContentRepository.findAll()을 호출하여 모든 태그를 메모리로 가져온 후, ContentTagType별로 그룹화하고 있습니다. 태그의 수가 많아질 경우, 대규모 컬렉션을 메모리에서 필터링하고 그룹화하는 것은 심각한 성능 저하를 유발할 수 있습니다. findAll() 대신, ContentTagType별로 미리 그룹화된 태그를 반환하는 전용 쿼리 메서드를 TagContentRepository에 추가하여 데이터베이스 계층에서 이 로직을 처리하는 것을 강력히 권장합니다. 이렇게 하면 메모리 사용량을 줄이고 데이터베이스의 효율적인 인덱싱을 활용하여 성능을 크게 향상시킬 수 있습니다.

References
  1. Avoid filtering large collections in memory; instead, push filtering logic down to the database layer by adding specific query methods to the repository for better performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

나중에 수정해볼게 태그 25개라 일단은 그냥 함

Comment on lines +8 to +16
public enum ContentTagSort {
FORMAT("형식"),
CATEGORY("종류"),
TONE("톤"),
INVOLVEMENT("관여도"),
USAGE_RANGE("활용 범위");

private final String korName;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

현재 ContentTagSortContentTagType enum은 이름(문자열)을 기준으로 연결되어 있어, 향후 유지보수 시 오류가 발생할 가능성이 있습니다. 예를 들어, 한쪽 enum의 이름만 변경될 경우 연관 로직이 오동작하게 됩니다.

ContentTagSortContentTagType을 직접 필드로 추가하여 타입-세이프(type-safe)하게 연관 관계를 맺는 것을 권장합니다. 이렇게 하면 코드의 안정성과 가독성이 향상됩니다.

참고: 아래 제안을 적용하려면 파일 상단에 import com.example.RealMatch.tag.domain.enums.ContentTagType; 구문을 추가해야 합니다.

Suggested change
public enum ContentTagSort {
FORMAT("형식"),
CATEGORY("종류"),
TONE("톤"),
INVOLVEMENT("관여도"),
USAGE_RANGE("활용 범위");
private final String korName;
}
public enum ContentTagSort {
FORMAT("형식", ContentTagType.FORMAT),
CATEGORY("종류", ContentTagType.CATEGORY),
TONE("톤", ContentTagType.TONE),
INVOLVEMENT("관여도", ContentTagType.INVOLVEMENT),
USAGE_RANGE("활용 범위", ContentTagType.USAGE_RANGE);
private final String korName;
private final ContentTagType tagType;
}

@ParkJiYeoung8297 ParkJiYeoung8297 merged commit 8272c27 into dev Feb 11, 2026
1 check passed
@ParkJiYeoung8297 ParkJiYeoung8297 deleted the feat/#362-get-tag-content branch February 11, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant