-
Notifications
You must be signed in to change notification settings - Fork 0
feat: #400 큐레이션 API 프론트 피드백 반영 #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hyorim-jo
wants to merge
8
commits into
develop
Choose a base branch
from
task/#400-curation-api-fe-feedback
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
641bc8f
feat: #400 링크 추천 타입 네이밍 변경
hyorim-jo 60b82a4
feat: #400 링크 추천 타입 네이밍 변경
hyorim-jo 9e8841d
Merge branch 'task/#400-curation-api-fe-feedback' of https://github.c…
hyorim-jo f2e4a6f
refactor: #400 url_normalized 컬럼 제거
hyorim-jo c2b8470
fix: #400 큐레이션 썸네일을 섹션1 이미지로 통일
hyorim-jo ba060c1
fix: #400 추천 링크 응답의 userLinkuId/카테고리/타입 필드 보강
hyorim-jo a3ec60d
docs: #400 큐레이션 API Swagger 문서 보강
hyorim-jo 712413c
Merge branch 'develop' into task/#400-curation-api-fe-feedback
hyorim-jo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 72 additions & 3 deletions
75
src/main/java/com/umc/linkyou/converter/CurationConverter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,90 @@ | ||
| package com.umc.linkyou.converter; | ||
|
|
||
| import com.umc.linkyou.domain.Curation; | ||
| import com.umc.linkyou.domain.CurationSectionInfo; | ||
| import com.umc.linkyou.domain.Linku; | ||
| import com.umc.linkyou.domain.classification.Category; | ||
| import com.umc.linkyou.domain.classification.Domain; | ||
| import com.umc.linkyou.domain.enums.CurationLinkuType; | ||
| import com.umc.linkyou.domain.mapping.CurationLinku; | ||
| import com.umc.linkyou.domain.mapping.UsersLinku; | ||
| import com.umc.linkyou.web.dto.curation.CurationDetailResponse; | ||
| import com.umc.linkyou.web.dto.curation.CurationLatestResponse; | ||
| import com.umc.linkyou.web.dto.curation.CurationListResponse; | ||
| import com.umc.linkyou.web.dto.curation.CurationSectionResponse; | ||
| import com.umc.linkyou.web.dto.curation.RecommendedLinkResponse; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class CurationConverter { | ||
|
|
||
| public static RecommendedLinkResponse toRecommendedLinkResponse(CurationLinku entity) { | ||
| Domain domain = entity.getUsersLinku() != null | ||
| ? entity.getUsersLinku().getLinku().getDomain() | ||
| : null; | ||
| UsersLinku usersLinku = entity.getUsersLinku(); | ||
| Linku linku = usersLinku != null ? usersLinku.getLinku() : null; | ||
| Domain domain = linku != null ? linku.getDomain() : null; | ||
| Category category = linku != null ? linku.getCategory() : null; | ||
| return RecommendedLinkResponse.builder() | ||
| .userLinkuId(usersLinku != null ? usersLinku.getUserLinkuId() : null) | ||
| .url(entity.getUrl()) | ||
| .title(entity.getTitle()) | ||
| .domain(domain != null ? domain.getName() : null) | ||
| .domainImageUrl(domain != null ? domain.getImageUrl() : null) | ||
| .imageUrl(entity.getImageUrl()) | ||
| .categories(category != null ? List.of(category.getCategoryName()) : null) | ||
| .type(CurationLinkuType.INTERNAL) | ||
| .build(); | ||
| } | ||
|
|
||
| // 외부 추천: 도메인 브랜딩(Domain)이 URL 기반 별도 조회로 해석된 경우 | ||
| public static RecommendedLinkResponse toRecommendedLinkResponse( | ||
| String url, String title, String imageUrl, Domain domain) { | ||
| return RecommendedLinkResponse.builder() | ||
| .url(url) | ||
| .title(title) | ||
| .imageUrl(imageUrl) | ||
| .domain(domain != null ? domain.getName() : null) | ||
| .domainImageUrl(domain != null ? domain.getImageUrl() : null) | ||
| .type(CurationLinkuType.EXTERNAL) | ||
| .build(); | ||
| } | ||
|
|
||
| // 연도별 히스토리 항목 변환 (해당 월에 큐레이션이 없으면 month만 채운다) | ||
| public static CurationListResponse toCurationListResponse(Curation curation, String month, String thumbnailUrl) { | ||
| if (curation == null) { | ||
| return CurationListResponse.builder().month(month).build(); | ||
| } | ||
| return CurationListResponse.builder() | ||
| .curationId(curation.getCurationId()) | ||
| .month(month) | ||
| .thumbnailUrl(thumbnailUrl) | ||
| .build(); | ||
| } | ||
|
|
||
| public static CurationLatestResponse toCurationLatestResponse(Curation curation, String thumbnailUrl) { | ||
| return CurationLatestResponse.builder() | ||
| .curationId(curation.getCurationId()) | ||
| .month(curation.getBaseMonth()) | ||
| .thumbnailUrl(thumbnailUrl) | ||
| .build(); | ||
| } | ||
|
|
||
| public static CurationSectionResponse toCurationSectionResponse(CurationSectionInfo info) { | ||
| return CurationSectionResponse.builder() | ||
| .section(info.getSectionNumber()) | ||
| .title(info.getTitle()) | ||
| .description(info.getDescription()) | ||
| .imageUrl(info.getImageUrl()) | ||
| .build(); | ||
| } | ||
|
|
||
| public static CurationDetailResponse toCurationDetailResponse(Curation curation) { | ||
| return CurationDetailResponse.builder() | ||
| .curationId(curation.getCurationId()) | ||
| .month(curation.getBaseMonth()) | ||
| .headerMent(curation.getHeaderMent()) | ||
| .footerMent(curation.getFooterMent()) | ||
| .mentReady(curation.getHeaderMent() != null && !curation.getHeaderMent().isBlank() | ||
| && curation.getFooterMent() != null && !curation.getFooterMent().isBlank()) | ||
| .build(); | ||
| } | ||
| } |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/umc/linkyou/domain/enums/CurationLinkuType.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| package com.umc.linkyou.domain.enums; | ||
|
|
||
| public enum CurationLinkuType { | ||
| RECOMMENDED, | ||
| INTERNAL, | ||
| EXTERNAL | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: LinkYou-2025/LinkU_backend
Length of output: 843
🏁 Script executed:
Repository: LinkYou-2025/LinkU_backend
Length of output: 12968
서비스 기본 읽기 전용 트랜잭션을 적용하세요.
CurationRecommendBuilderServiceImpl은 전용 트랜잭션이 없어 클래스 레벨의@Transactional(readOnly = true)를 추가하고,ExternalRecommendWorker도 클래스 레벨 기본 읽기 전용 트랜잭션을 적용한 뒤generateExternal의 저장 매핑에만 메서드 레벨@Transactional을 유지하세요.📍 Affects 2 files
src/main/java/com/umc/linkyou/service/curation/recommend/CurationRecommendBuilderServiceImpl.java#L35-L35(this comment)src/main/java/com/umc/linkyou/service/curation/recommend/external/ExternalRecommendWorker.java#L35-L38🤖 Prompt for AI Agents
Source: Coding guidelines