Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public interface ChannelBrandHistoryApi {
)
@ApiErrorDefines({ErrorDefine.INVALID_ARGUMENT})
BaseResponse<CursorSliceResponse<ChannelBrandHistoryVideoResponse>> search(
@Parameter(description = "YouTube 채널 ID", example = "UCxxxxxxxxxxxxxxxxxxxxxx")
@PathVariable String channelId,
@Parameter(description = "채널 ID", example = "1701")
@PathVariable Long channelId,
Comment on lines +33 to +34

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

검색 API 설명이 아직 이전 식별자를 가리킵니다.

@Parameter는 숫자형 채널 ID로 바뀌었는데, @Operation 설명의 Line 24는 아직 (YouTube 채널 ID)라고 적혀 있습니다. 이 상태로는 생성된 OpenAPI에서 같은 파라미터를 서로 다르게 설명하게 됩니다.

문서 문구 정리 예시
-                    - `channelId`는 Path Variable로 전달합니다. (YouTube 채널 ID)
+                    - `channelId`는 Path Variable로 전달합니다. (로그인 응답의 channelId)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/inflace/domain/brandcollaboration/controller/ChannelBrandHistoryApi.java`
around lines 33 - 34, The API documentation is inconsistent because the
`@Operation` description on `ChannelBrandHistoryApi` still refers to the old
`(YouTube 채널 ID)` wording while the `channelId` parameter is now documented as a
numeric channel ID. Update the `@Operation` text in the same controller so it
matches the `@Parameter` for `channelId`, and keep the terminology consistent
with the new identifier across the method documentation.

@ParameterObject ChannelBrandHistorySearchCondition condition
);

Expand All @@ -40,7 +40,7 @@ BaseResponse<CursorSliceResponse<ChannelBrandHistoryVideoResponse>> search(
description = """
특정 채널의 PPL 영상(최대 50개)을 집계하여 분석 결과를 반환합니다.

- `channelId`는 Path Variable로 전달합니다. (YouTube 채널 ID)
- `channelId`는 Path Variable로 전달합니다. (로그인 응답의 channelId)

**brands** (브랜드별 협업 수)
- 전체 영상의 태그를 집계하여 빈도순 정렬
Expand All @@ -58,8 +58,8 @@ BaseResponse<CursorSliceResponse<ChannelBrandHistoryVideoResponse>> search(
)
@ApiErrorDefines({ErrorDefine.INVALID_ARGUMENT})
BaseResponse<ChannelBrandHistoryAnalysisResponse> analysis(
@Parameter(description = "YouTube 채널 ID", example = "UCxxxxxxxxxxxxxxxxxxxxxx")
@PathVariable String channelId,
@Parameter(description = "채널 ID", example = "1701")
@PathVariable Long channelId,
@ParameterObject ChannelBrandHistorySearchCondition condition
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ChannelBrandHistoryController implements ChannelBrandHistoryApi {
@Override
@GetMapping("/{channelId}")
public BaseResponse<CursorSliceResponse<ChannelBrandHistoryVideoResponse>> search(
@PathVariable String channelId,
@PathVariable Long channelId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

같은 v1 경로에서 식별자 의미를 바꾸면 기존 클라이언트가 바로 깨집니다.

이 변경은 URI는 그대로 두고 channelId를 YouTube 채널 ID에서 내부 DB ID로 바꾸기 때문에, 기존 호출자가 보내던 "UC..." 값은 이제 컨트롤러 바인딩 단계에서 400으로 떨어집니다. 호환성 계획이 없다면 /v2로 분리하거나, 일정 기간 두 식별자를 함께 받아서 마이그레이션할 수 있게 해야 합니다.

Also applies to: 35-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/inflace/domain/brandcollaboration/controller/ChannelBrandHistoryController.java`
at line 26, The `ChannelBrandHistoryController` path variable semantics are
changing from YouTube channel ID to internal DB ID under the same `v1` URI,
which breaks existing clients that still send `UC...` values. Update the
controller contract so `channelId` remains backward compatible, or split the new
internal-ID behavior into a separate `/v2` endpoint; if both must coexist,
adjust the controller methods to accept both identifiers during a migration
period.

@ModelAttribute ChannelBrandHistorySearchCondition condition
) {
return new BaseResponse<>(channelBrandHistoryService.search(channelId, condition));
Expand All @@ -32,7 +32,7 @@ public BaseResponse<CursorSliceResponse<ChannelBrandHistoryVideoResponse>> searc
@Override
@GetMapping("/{channelId}/analysis")
public BaseResponse<ChannelBrandHistoryAnalysisResponse> analysis(
@PathVariable String channelId,
@PathVariable Long channelId,
@ModelAttribute ChannelBrandHistorySearchCondition condition
) {
return new BaseResponse<>(channelBrandHistoryService.analysis(channelId, condition));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public class ChannelBrandHistoryService {
private final VideoQueryRepository videoQueryRepository;
private final VideoRepository videoRepository;

public CursorSliceResponse<ChannelBrandHistoryVideoResponse> search(String channelId, ChannelBrandHistorySearchCondition condition) {
Optional<Channel> channelOpt = channelRepository.findByYoutubeChannelId(channelId);
public CursorSliceResponse<ChannelBrandHistoryVideoResponse> search(Long channelId, ChannelBrandHistorySearchCondition condition) {
Optional<Channel> channelOpt = channelRepository.findById(channelId);
if (channelOpt.isEmpty()) {
return emptyResponse(condition);
}
Expand Down Expand Up @@ -146,8 +146,8 @@ private ChannelVideoSort toChannelVideoSort(String sortCriteria) {
};
}

public ChannelBrandHistoryAnalysisResponse analysis(String channelId, ChannelBrandHistorySearchCondition condition) {
Optional<Channel> channelOpt = channelRepository.findByYoutubeChannelId(channelId);
public ChannelBrandHistoryAnalysisResponse analysis(Long channelId, ChannelBrandHistorySearchCondition condition) {
Optional<Channel> channelOpt = channelRepository.findById(channelId);
if (channelOpt.isEmpty()) {
return emptyAnalysis();
}
Expand Down
Loading