Skip to content

Conversation

@hwangjiyoung02
Copy link
Contributor

@hwangjiyoung02 hwangjiyoung02 commented Aug 28, 2025

πŸ“Œ μž‘μ—…ν•œ λ‚΄μš©

  • λ³€κ²½λœ 폴더 ꡬ쑰둜 μˆ˜μ •
  • μΆ”μ²œ API에 user 뢁마크 반영
  • adapterμ—μ„œ query 방식 톡일

πŸ” μ°Έκ³  사항

  • github actionsμ—μ„œ timeoutλ‚˜μ„œ γ… γ…  ν•œλ²ˆ ν™•μΈν•΄μ£Όμ‹œλ©΄ κ°μ‚¬λ“œλ¦¬κ² μŠ΅λ‹ˆλ‹€!!

πŸ–ΌοΈ μŠ€ν¬λ¦°μƒ·

πŸ”— κ΄€λ ¨ 이슈

#69

βœ… 체크리슀트

  • λ‘œμ»¬μ—μ„œ λΉŒλ“œ 및 ν…ŒμŠ€νŠΈ μ™„λ£Œ
  • μ½”λ“œ 리뷰 반영 μ™„λ£Œ
  • λ¬Έμ„œν™” ν•„μš” μ—¬λΆ€ 확인

Summary by CodeRabbit

  • μ‹ κ·œ κΈ°λŠ₯

    • μΆ”μ²œ/μœ μ‚¬μƒν’ˆ 결과에 β€œλ‚΄κ°€ μ°œν–ˆλŠ”μ§€(likedByMe)” ν‘œμ‹œκ°€ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
  • κ°œμ„ 

    • μΆ”μ²œ ν•„ν„° 정확도 ν–₯상: λ ˆμ΄μ•„μ›ƒ(Ergonomic/egonomic, SIMPLE/LP) 인식 κ°œμ„ , 가격 λ²”μœ„ 쑰건 정ꡐ화, RGB/흑음재 μ˜΅μ…˜ 처리 일관화.
    • μœ μ‚¬μƒν’ˆ APIκ°€ 도메인 객체 λŒ€μ‹  응닡 DTOλ₯Ό 직접 λ°˜ν™˜ν•΄ 응닡 일관성이 ν–₯μƒλ˜μ—ˆμŠ΅λ‹ˆλ‹€.
  • 버그 μˆ˜μ •

    • λ ˆμ΄μ•„μ›ƒ β€œegonomic” μ˜€νƒ€ μž…λ ₯도 Ergonomic으둜 μ²˜λ¦¬λ©λ‹ˆλ‹€.
  • λ¬Έμ„œ

    • OpenAPI λͺ…μ„Έ μ—…λ°μ΄νŠΈ: λ ˆμ΄μ•„μ›ƒ enum μ„€λͺ… 보강, μΆ”μ²œ μš”μ²­ 이름 μ •μ •, size μ˜ˆμ‹œλ₯Ό β€œtenkeylessβ€λ‘œ λ³€κ²½.

- λ³€κ²½λœ 폴더 ꡬ쑰둜 μˆ˜μ •
- μΆ”μ²œ API에 user 뢁마크 반영
- adapterμ—μ„œ query 방식 톡일
@github-actions
Copy link

Test Results

34 tests   34 βœ…β€ƒβ€ƒ6s ⏱️
13 suites   0 πŸ’€
13 files     0 ❌

Results for commit ef09f64.

@hwangjiyoung02 hwangjiyoung02 merged commit 07507b7 into develop Aug 28, 2025
2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

  • λ‘œκΉ… AOP 포인트컷 νŒ¨ν‚€μ§€ 경둜λ₯Ό com.jiyoung.kikihiμ—μ„œ site.kikihi.custom둜 λ³€κ²½(ControllerLoggingAspect, LoggingAspect).
  • RecommendationControllerκ°€ μ„œλΉ„μŠ€μ—μ„œ 받은 Listλ₯Ό κ·ΈλŒ€λ‘œ λ°˜ν™˜ν•˜λ„λ‘ μˆ˜μ •.
  • KeyboardRecommendationResponse: price νƒ€μž… doubleβ†’Double, from(Product)β†’from(Product, boolean)둜 λ³€κ²½, 리슀트 λ³€ν™˜ 헬퍼 제거.
  • KeyboardRecommendationRequest/KeyboardOptions의 Swagger @Schema 메타데이터 보정.
  • RecommendKeyboardAdapter: λͺ¨λ“  쑰건을 andCriterias에 λˆ„μ  ν›„ andOperator둜 μ μš©ν•˜λ„λ‘ λ¦¬νŒ©ν„°λ§, λ ˆμ΄μ•„μ›ƒ/가격/λΆ€κ°€μ˜΅μ…˜(μ†ŒμŒκ°μ‡„, RGB) λ§€μΉ­ 둜직 κ°œμ„ .
  • ProductDocument: specTable의 @field 제거, @Builder.Default둜 빈 λ§΅ μ΄ˆκΈ°ν™”.
  • RecommendationUseCase/Service: getSimilarProducts λ°˜ν™˜νƒ€μž…μ„ Listβ†’List둜 λ³€κ²½ν•˜κ³ , ν•­λͺ©λ³„ likedByMeλ₯Ό bookmarkPort둜 μ‘°νšŒν•΄ λ§€ν•‘.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as RecommendationController
  participant S as RecommendationService
  participant R as RecommendationPort
  participant B as BookmarkPort

  Note over C,S: GET /recommendations/similar
  C->>S: getSimilarProducts(userId, productId)
  S->>R: loadSimilarProducts(productId)
  R-->>S: List<Product>
  loop for each Product
    S->>B: checkBookmarkByUserIdAndProductId(userId, product.id)
    B-->>S: boolean likedByMe
    S-->>S: KeyboardRecommendationResponse.from(product, likedByMe)
  end
  S-->>C: List<KeyboardRecommendationResponse>
  C-->>C: ApiResponse.ok(list)
  C-->>Client: ApiResponse<List<KeyboardRecommendationResponse>>
Loading
sequenceDiagram
  autonumber
  participant A as ControllerLoggingAspect
  participant Ctrl as Web Controller (*..adapter.in.web..*)
  participant LA as LoggingAspect
  participant Svc as Application Service (*..application.service.*Service.*)

  Note over A,Ctrl: μš”μ²­ μ§„μž… μ‹œ 컨트둀러 λ‘œκΉ…
  Client->>Ctrl: HTTP Request
  activate A
  A-->>A: μ‚¬μš©μž/컨트둀러/λ©”μ„œλ“œ/URI μˆ˜μ§‘ 및 둜그
  deactivate A

  Note over LA,Svc: μ„œλΉ„μŠ€ 계측 곡톡 λ‘œκΉ… (μ§„μž…/λ°˜ν™˜/μ˜ˆμ™Έ)
  Ctrl->>Svc: serviceMethod(...)
  activate LA
  LA-->>LA: before 둜그
  Svc-->>LA: λ°˜ν™˜ or μ˜ˆμ™Έ
  alt 정상 λ°˜ν™˜
    LA-->>LA: afterReturning 둜그
  else μ˜ˆμ™Έ
    LA-->>LA: afterThrowing 둜그
  end
  deactivate LA
Loading
sequenceDiagram
  autonumber
  participant RC as RecommendKeyboardAdapter
  participant Mongo as MongoDB

  Note over RC: ν‚€λ³΄λ“œ μΆ”μ²œ 검색 쑰건 ꡬ성
  RC-->>RC: andCriterias μˆ˜μ§‘ (keyPressure, layout, soundDampener, rgb)
  RC-->>RC: priceBounds 쑰립 (min/max)
  RC-->>RC: options.elemMatch(andOperator(priceBounds...))
  RC-->>RC: layout 특수처리(ERGONOMIC/egonomic, SIMPLE: LP|desc 'lp')
  RC-->>Mongo: query.addCriteria(andOperator(andCriterias...))
  Mongo-->>RC: κ²°κ³Ό List<ProductDocument>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Tip

πŸ”Œ Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • πŸ“ Generate Docstrings
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/custom/KIKI-73-BE-μΆ”μ²œ-κΈ°λŠ₯-κ΅¬ν˜„

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/main/java/site/kikihi/custom/global/logging/LoggingAspect.java (1)

36-41: μ˜ˆμ™Έ λ‘œκΉ…μ— μŠ€νƒνŠΈλ ˆμ΄μŠ€κ°€ λˆ„λ½λ©λ‹ˆλ‹€. throwing νŒŒλΌλ―Έν„°λ‘œ μˆ˜μ •ν•˜μ„Έμš”.

ν˜„μž¬ @AfterThrowingκ°€ μ˜ˆμ™Έ 객체λ₯Ό λ°›μ§€ μ•Šμ•„ 원인 뢄석이 μ–΄λ ΅μŠ΅λ‹ˆλ‹€. 둜그 λ ˆλ²¨λ„ errorκ°€ μ μ ˆν•©λ‹ˆλ‹€.

적용 diff:

-    @AfterThrowing(pointcut = "applicationLayer()")
-    public void logException(JoinPoint joinPoint) {
-        log.info("[μ„œλΉ„μŠ€ λ‘œκΉ…] μ˜ˆμ™Έ λ°œμƒ: {}.{}",
-                joinPoint.getSignature().getDeclaringTypeName(),
-                joinPoint.getSignature().getName());
-    }
+    @AfterThrowing(pointcut = "applicationLayer()", throwing = "ex")
+    public void logException(JoinPoint joinPoint, Throwable ex) {
+        log.error("[μ„œλΉ„μŠ€ λ‘œκΉ…] μ˜ˆμ™Έ λ°œμƒ: {}.{} - {}",
+                joinPoint.getSignature().getDeclaringTypeName(),
+                joinPoint.getSignature().getName(),
+                ex.toString(),
+                ex);
+    }
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardOptions.java (1)

57-71: Layout enum μ˜€νƒ€(β€œegonomic”) μˆ˜μ • 및 @JsonCreator μΆ”κ°€

  • μ „μ—­ Jackson μ„€μ •(READ_ENUMS_USING_TO_STRING, ACCEPT_CASE_INSENSITIVE_ENUMS λ“±) 미발견 β†’ ν΄λΌμ΄μ–ΈνŠΈκ°€ β€œergonomic” 전솑 μ‹œ 역직렬화 μ‹€νŒ¨ μœ„ν—˜
  • μ•„λž˜ diff 적용 ν›„, Size/KeyPressure/SwitchType/SoundDampener/RGB λ“± μœ μ‚¬ enum에도 동일 νŒ¨ν„΄ ν™•μž₯ 적용 ꢌμž₯
     @Getter
     @RequiredArgsConstructor
     @Schema(name = "[μš”μ²­][μƒν’ˆ] λ ˆμ΄μ•„μ›ƒ(Layout) Enum", description = "λ ˆμ΄μ•„μ›ƒ μ˜΅μ…˜")
     public enum Layout {
-        @Schema(description = "인체곡학적 (μŠ€ν…μŠ€μ»¬μ³2)", example = "egonomic")
-        ERGONOMIC("egonomic"),
+        @Schema(description = "인체곡학적 (μŠ€ν…μŠ€μ»¬μ³2)", example = "ergonomic")
+        ERGONOMIC("ergonomic"),

         @Schema(description = "μ‹¬ν”Œν•˜κ³  κΉ”λ”ν•œ (low ν”„λ‘œνŒŒμΌ)", example = "simple")
         SIMPLE("simple");

         private final String value;

         @JsonValue
         public String getValue() {
             return value;
         }

+        @com.fasterxml.jackson.annotation.JsonCreator
+        public static Layout from(String value) {
+            if (value == null) return null;
+            String v = value.trim().toLowerCase();
+            return switch (v) {
+                case "ergonomic", "egonomic" -> ERGONOMIC;
+                case "simple"                 -> SIMPLE;
+                default -> throw new IllegalArgumentException("Unknown layout: " + value);
+            };
+        }
     }
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardRecommendationRequest.java (1)

12-35: ν•„λ“œ μœ νš¨μ„± 검증 μΆ”κ°€ 및 Layout 예제 μ˜€νƒ€ μˆ˜μ • ν•„μš”.

  • required = trueλ§ŒμœΌλ‘œλŠ” Bean Validation이 λ™μž‘ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. @NotNull, 가격 λ²”μœ„ 검증 등을 μΆ”κ°€ν•˜μ„Έμš”.
  • Layout 예제 "egonomic" μ˜€νƒ€λ₯Ό "ergonomic"으둜 μ •μ •ν•˜μ„Έμš”(μ—­μ§λ ¬ν™”λŠ” KeyboardOptions.Layout.from둜 ν˜Έν™˜).

적용 diff:

-    @Schema(description = "ν‚€λ³΄λ“œ λ°°μ—΄(Size) μ˜΅μ…˜", example = "tenkeyless", required = true)
-    private KeyboardOptions.Size size;
+    @Schema(description = "ν‚€λ³΄λ“œ λ°°μ—΄(Size) μ˜΅μ…˜", example = "tenkeyless", required = true)
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.Size size;
 
     @Schema(description = "ν‚€μ••(Key Pressure) μ˜΅μ…˜", example = "light", required = true)
-    private KeyboardOptions.KeyPressure keyPressure;
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.KeyPressure keyPressure;
 
-    @Schema(description = "λ ˆμ΄μ•„μ›ƒ μ’…λ₯˜(Layout) μ˜΅μ…˜", example = "egonomic", required = true)
-    private KeyboardOptions.Layout layout;
+    @Schema(description = "λ ˆμ΄μ•„μ›ƒ μ’…λ₯˜(Layout) μ˜΅μ…˜", example = "ergonomic", required = true)
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.Layout layout;
 
     @Schema(description = "μŠ€μœ„μΉ˜ μ’…λ₯˜(Switch Type) μ˜΅μ…˜", example = "silent", required = true)
-    private KeyboardOptions.SwitchType switchType;
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.SwitchType switchType;
 
     @Schema(description = "흑음재(Sound Dampener) 적용 μ—¬λΆ€", example = "β—‹", required = true)
-    private KeyboardOptions.SoundDampener soundDampener;
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.SoundDampener soundDampener;
 
     @Schema(description = "RGB 적용 μ—¬λΆ€", example = "β—‹", required = true)
-    private KeyboardOptions.RGB rgb;
+    @jakarta.validation.constraints.NotNull
+    private KeyboardOptions.RGB rgb;
 
     @Schema(description = "μ΅œμ†Œ 가격 (λ‹¨μœ„: 원)", example = "0", required = true)
-    private int minPrice;
+    @jakarta.validation.constraints.PositiveOrZero
+    private int minPrice;
 
     @Schema(description = "μ΅œλŒ€ 가격 (λ‹¨μœ„: 원)", example = "200000", required = true)
-    private int maxPrice;
+    @jakarta.validation.constraints.PositiveOrZero
+    private int maxPrice;

μΆ”κ°€μ μœΌλ‘œ, 가격 λ²”μœ„ μœ νš¨μ„± 보μž₯을 μœ„ν•΄ 클래슀 내뢀에 λ‹€μŒ λ©”μ„œλ“œ μΆ”κ°€λ₯Ό ꢌμž₯ν•©λ‹ˆλ‹€:

@jakarta.validation.constraints.AssertTrue(message = "maxPriceλŠ” minPrice보닀 ν¬κ±°λ‚˜ κ°™μ•„μ•Ό ν•©λ‹ˆλ‹€.")
public boolean isPriceRangeValid() {
    return maxPrice >= minPrice;
}

ν•„μš” import:

import jakarta.validation.constraints.*;
src/main/java/site/kikihi/custom/platform/adapter/out/RecommendKeyboardAdapter.java (1)

214-214: 맀직 λ„˜λ²„λ₯Ό μƒμˆ˜λ‘œ μ •μ˜ ν•„μš”

μΆ”μ²œ μƒν’ˆ 수 μ œν•œκ°’ 6이 ν•˜λ“œμ½”λ”©λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μœ μ§€λ³΄μˆ˜μ„±μ„ μœ„ν•΄ μƒμˆ˜λ‘œ λΆ„λ¦¬ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

클래슀 상단에 μƒμˆ˜ μ •μ˜:

+private static final int MAX_SIMILAR_PRODUCTS = 6;
+
 // ν‚€λ³΄λ“œ μΆ”μ²œ 둜직
 @Override

μ‚¬μš© λΆ€λΆ„ μˆ˜μ •:

-if (recommended.size() > 6) break;
+if (recommended.size() > MAX_SIMILAR_PRODUCTS) break;
-if (recommended.size() > 6) break;
+if (recommended.size() > MAX_SIMILAR_PRODUCTS) break;

Also applies to: 227-227

🧹 Nitpick comments (6)
src/main/java/site/kikihi/custom/global/logging/ControllerLoggingAspect.java (1)

24-25: @RestController/@controller μ–΄λ…Έν…Œμ΄μ…˜ 기반 포인트컷으둜 μ „ν™˜
νŒ¨ν‚€μ§€ 이동 μ‹œ λ‘œκΉ… λˆ„λ½ λ°©μ§€λ₯Ό μœ„ν•΄ annotation 기반으둜 μΌλ°˜ν™”ν•˜μ„Έμš”.

적용 μ˜ˆμ‹œ:

-    @Pointcut("execution(* site.kikihi.custom.platform.adapter/in/web..*.*(..))")
+    @Pointcut("within(@org.springframework.web.bind.annotation.RestController *) || within(@org.springframework.stereotype.Controller *)")
     private void controllerPointcut() {}
src/main/java/site/kikihi/custom/global/logging/LoggingAspect.java (1)

16-18: μ„œλΉ„μŠ€ ν¬μΈνŠΈμ»·μ„ 넀이밍/νŒ¨ν‚€μ§€ κ²°ν•©μ—μ„œ νƒˆν”Όν•˜μ„Έμš”.

*Service.* 넀이밍/κ²½λ‘œμ— μ˜μ‘΄ν•˜λ©΄ λ¦¬νŒ©ν† λ§ λ•Œ μ‰½κ²Œ μƒˆλŠ” 지점이 μƒκΉλ‹ˆλ‹€. @Service μ• λ…Έν…Œμ΄μ…˜ 기반으둜 μ „ν™˜μ„ ꢌμž₯ν•©λ‹ˆλ‹€.

적용 diff:

-    @Pointcut("execution(* site.kikihi.custom.platform.application.service.*Service.*(..))")
+    @Pointcut("within(@org.springframework.stereotype.Service *) && within(site.kikihi.custom..*)")
     private void applicationLayer() {
src/main/java/site/kikihi/custom/platform/adapter/out/mongo/product/ProductDocument.java (1)

49-52: specTable의 κΈ°λ³Έκ°’ μ΄ˆκΈ°ν™”λŠ” μ μ ˆν•©λ‹ˆλ‹€.

@Builder.Default둜 NPEλ₯Ό μ˜ˆλ°©ν•©λ‹ˆλ‹€. μ‚¬μ†Œν•œ μŠ€νƒ€μΌ μ œμ•ˆ: FQCN λŒ€μ‹  HashMap import μ‚¬μš©.

적용 diff:

-    private Map<String, Object> specTable = new java.util.HashMap<>();
+    private Map<String, Object> specTable = new HashMap<>();

μΆ”κ°€ import:

import java.util.HashMap;
src/main/java/site/kikihi/custom/platform/adapter/out/RecommendKeyboardAdapter.java (1)

63-69: μ˜€νƒ€ μ²˜λ¦¬λŠ” μž˜ν•˜μ…¨μœΌλ‚˜ μ •κ·œν™” 방법 κ°œμ„  ν•„μš”

'egonomic'μ΄λΌλŠ” μ˜€νƒ€λ₯Ό μ²˜λ¦¬ν•˜λŠ” 것은 μ’‹μœΌλ‚˜, ν•˜λ“œμ½”λ”©λœ μ˜€νƒ€ μ²˜λ¦¬λ³΄λ‹€λŠ” 더 μœ μ—°ν•œ 접근이 ν•„μš”ν•©λ‹ˆλ‹€.

λŒ€μ†Œλ¬Έμž ꡬ뢄 없이 μ²˜λ¦¬ν•˜λ„λ‘ κ°œμ„ :

-String val = layout.trim();
-boolean ergonomic = "ERGONOMIC".equalsIgnoreCase(val) || "egonomic".equalsIgnoreCase(val);
+String val = layout.trim().toUpperCase();
+boolean ergonomic = val.equals("ERGONOMIC") || val.equals("EGONOMIC");

λ˜λŠ” enum νƒ€μž…μ„ ν™œμš©ν•œ 더 μ•ˆμ „ν•œ 처리:

-String val = layout.trim();
-boolean ergonomic = "ERGONOMIC".equalsIgnoreCase(val) || "egonomic".equalsIgnoreCase(val);
+String val = layout.trim();
+boolean ergonomic = KeyboardOptions.Layout.ERGONOMIC.getValue().equalsIgnoreCase(val) 
+                    || "egonomic".equalsIgnoreCase(val);
src/main/java/site/kikihi/custom/platform/application/service/RecommendationService.java (2)

136-159: μ½”λ“œ 쀑볡 제거 κ³ λ €

getTutorialKeyboardRecommendationκ³Ό getSimilarProducts λ©”μ„œλ“œμ—μ„œ λ™μΌν•œ 뢁마크 확인 및 λ§€ν•‘ 둜직이 λ°˜λ³΅λ©λ‹ˆλ‹€.

곡톡 헬퍼 λ©”μ„œλ“œλ‘œ μΆ”μΆœ:

+private List<KeyboardRecommendationResponse> mapToResponseWithBookmarks(
+        List<Product> products, UUID userId) {
+    return products.stream()
+            .map(product -> {
+                boolean likedByMe = userId != null && 
+                    bookmarkPort.checkBookmarkByUserIdAndProductId(userId, product.getId());
+                return KeyboardRecommendationResponse.from(product, likedByMe);
+            })
+            .collect(Collectors.toList());
+}

그리고 두 λ©”μ„œλ“œμ—μ„œ μž¬μ‚¬μš©:

-return documents.stream()
-        .map(product -> {
-            boolean likedByMe = bookmarkPort.checkBookmarkByUserIdAndProductId(userId, product.getId());
-            return KeyboardRecommendationResponse.from(product, likedByMe);
-        })
-        .collect(Collectors.toList());
+return mapToResponseWithBookmarks(documents, userId);

138-145: 주석 처리된 μ½”λ“œ 제거 ν•„μš”

μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 주석 처리된 μ½”λ“œλŠ” 가독성을 ν•΄μΉ˜κ³  ν˜Όλž€μ„ 쀄 수 μžˆμŠ΅λ‹ˆλ‹€.

주석 처리된 μ½”λ“œ 제거:

-/// μœ μ €κ°€ μžˆλ‹€λ©΄ 체크, μ—†λ‹€λ©΄ λ°”λ‘œ μƒν’ˆ 쑰회
-//        if (userId != null) {
-//            /// μ»€μŠ€ν…€μ„ μ œμž‘ν–ˆλ‹€λ©΄, λΉ„μŠ·ν•œ νŠΉμ„±μ˜ μƒν’ˆλ“€μ„ μΆ”μ²œ
-//            Optional<CustomKeyboard> customKeyboard = customPort.loadCustomKeyboardByUserId(userId);
-//
-//            if (customKeyboard.isPresent()) {
-//                return recommendForCustomUser(customKeyboard.get());
-//            }
-//        }
-
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 603de5d and ef09f64.

πŸ“’ Files selected for processing (10)
  • src/main/java/site/kikihi/custom/global/logging/ControllerLoggingAspect.java (1 hunks)
  • src/main/java/site/kikihi/custom/global/logging/LoggingAspect.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/in/web/RecommendationController.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardOptions.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardRecommendationRequest.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/response/product/KeyboardRecommendationResponse.java (2 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/out/RecommendKeyboardAdapter.java (4 hunks)
  • src/main/java/site/kikihi/custom/platform/adapter/out/mongo/product/ProductDocument.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/application/in/recommendation/RecommendationUseCase.java (1 hunks)
  • src/main/java/site/kikihi/custom/platform/application/service/RecommendationService.java (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardOptions.java (1)
src/main/java/site/kikihi/custom/platform/adapter/in/web/converter/KeyboardOptionsConverter.java (2)
  • mapLayoutToDescription (53-59)
  • KeyboardOptionsConverter (9-69)
src/main/java/site/kikihi/custom/platform/application/in/recommendation/RecommendationUseCase.java (2)
src/main/java/site/kikihi/custom/platform/application/out/recommend/RecommendKeyboardPort.java (2)
  • getSimilarProducts (46-46)
  • RecommendKeyboardPort (9-47)
src/main/java/site/kikihi/custom/platform/adapter/in/web/swagger/RecommendControllerSpec.java (1)
  • Operation (47-54)
src/main/java/site/kikihi/custom/platform/adapter/out/RecommendKeyboardAdapter.java (1)
src/main/java/site/kikihi/custom/platform/application/out/recommend/RecommendKeyboardPort.java (2)
  • filterAndRecommendKeyboards (26-36)
  • RecommendKeyboardPort (9-47)
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardRecommendationRequest.java (2)
src/main/java/site/kikihi/custom/platform/adapter/in/web/swagger/RecommendControllerSpec.java (2)
  • Tag (17-57)
  • Operation (35-42)
src/main/java/site/kikihi/custom/platform/adapter/in/web/converter/KeyboardOptionsConverter.java (1)
  • mapSizeToDescription (12-19)
src/main/java/site/kikihi/custom/platform/application/service/RecommendationService.java (1)
src/main/java/site/kikihi/custom/platform/application/out/recommend/RecommendKeyboardPort.java (3)
  • RecommendKeyboardPort (9-47)
  • getSimilarProducts (46-46)
  • filterAndRecommendKeyboards (26-36)
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/response/product/KeyboardRecommendationResponse.java (1)
src/main/java/site/kikihi/custom/platform/application/out/recommend/RecommendKeyboardPort.java (1)
  • filterAndRecommendKeyboards (26-36)
src/main/java/site/kikihi/custom/platform/adapter/in/web/RecommendationController.java (2)
src/main/java/site/kikihi/custom/platform/application/out/recommend/RecommendKeyboardPort.java (1)
  • getSimilarProducts (46-46)
src/main/java/site/kikihi/custom/platform/adapter/in/web/swagger/RecommendControllerSpec.java (1)
  • Operation (47-54)
src/main/java/site/kikihi/custom/platform/adapter/out/mongo/product/ProductDocument.java (2)
src/main/java/site/kikihi/custom/platform/adapter/out/elasticSearch/ProductESDocument.java (3)
  • Getter (22-99)
  • from (65-81)
  • toDomain (84-98)
src/test/java/site/kikihi/custom/platform/domain/product/ProductFixtures.java (3)
  • createProduct (34-56)
  • ProductFixtures (7-107)
  • fakeProduct (10-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
πŸ”‡ Additional comments (9)
src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/request/product/KeyboardRecommendationRequest.java (1)

9-10: μŠ€ν‚€λ§ˆ λͺ…μΉ­ 보정 LGTM.

λͺ…μΉ­λ§Œ λ³€κ²½λ˜λ©° λ™μž‘ 영ν–₯ μ—†μŒ.

src/main/java/site/kikihi/custom/platform/adapter/out/RecommendKeyboardAdapter.java (3)

122-127: 가격 필터링 둜직 κ°œμ„ λ¨

동적 priceBounds 리슀트λ₯Ό μ‚¬μš©ν•˜μ—¬ 가격 쑰건을 μ²˜λ¦¬ν•˜λŠ” 방식이 μ’‹μŠ΅λ‹ˆλ‹€. μ½”λ“œκ°€ 더 κΉ”λ”ν•˜κ³  μœ μ§€λ³΄μˆ˜κ°€ μš©μ΄ν•΄μ‘Œλ„€μš”.


55-58: μΌκ΄€λœ 쿼리 쑰립 νŒ¨ν„΄ 적용

λͺ¨λ“  ν•„ν„° 쑰건을 andCriterias λ¦¬μŠ€νŠΈμ— λˆ„μ ν•œ ν›„ λ§ˆμ§€λ§‰μ— andOperator둜 μ μš©ν•˜λŠ” λ°©μ‹μœΌλ‘œ ν†΅μΌλ˜μ–΄ μ½”λ“œ 일관성이 ν–₯μƒλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Also applies to: 71-74, 98-101, 113-116


92-92: Null-safe 비ꡐ νŒ¨ν„΄ μ‚¬μš©

μƒμˆ˜λ₯Ό μ™Όμͺ½μ— λ‘λŠ” null-safe 비ꡐ νŒ¨ν„΄μ„ μ‚¬μš©ν•˜μ—¬ NullPointerException을 λ°©μ§€ν•œ 것이 μ’‹μŠ΅λ‹ˆλ‹€.

Also applies to: 107-107

src/main/java/site/kikihi/custom/platform/application/in/recommendation/RecommendationUseCase.java (1)

18-18: μ μ ˆν•œ λ°˜ν™˜ νƒ€μž… λ³€κ²½

getSimilarProducts λ©”μ„œλ“œκ°€ List<Product> λŒ€μ‹  List<KeyboardRecommendationResponse>λ₯Ό λ°˜ν™˜ν•˜λ„λ‘ λ³€κ²½λ˜μ–΄, 뢁마크 μ—¬λΆ€(likedByMe) 정보λ₯Ό ν¬ν•¨ν•œ 응닡을 μ œκ³΅ν•  수 있게 λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” ν΄λΌμ΄μ–ΈνŠΈμ—κ²Œ 더 ν’λΆ€ν•œ 정보λ₯Ό μ œκ³΅ν•˜λŠ” 쒋은 κ°œμ„ μž…λ‹ˆλ‹€.

src/main/java/site/kikihi/custom/platform/adapter/in/web/RecommendationController.java (1)

79-82: μ„œλΉ„μŠ€ 계측 μ±…μž„ 뢄리 κ°œμ„ 

μ»¨νŠΈλ‘€λŸ¬μ—μ„œ DTO λ³€ν™˜ 둜직이 제거되고 μ„œλΉ„μŠ€ κ³„μΈ΅μ—μ„œ 직접 KeyboardRecommendationResponse 리슀트λ₯Ό λ°˜ν™˜ν•˜λ„λ‘ κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” 단일 μ±…μž„ 원칙(SRP)에 λΆ€ν•©ν•˜λŠ” 쒋은 λ³€κ²½μž…λ‹ˆλ‹€.

src/main/java/site/kikihi/custom/platform/application/service/RecommendationService.java (1)

122-126: 뢁마크 확인 둜직 μΆ”κ°€

각 μ œν’ˆμ— λŒ€ν•΄ κ°œλ³„μ μœΌλ‘œ 뢁마크 μ—¬λΆ€λ₯Ό ν™•μΈν•˜μ—¬ likedByMe ν•„λ“œλ₯Ό μ„€μ •ν•˜λŠ” 둜직이 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ‚¬μš©μžλ³„ 맞좀 정보 μ œκ³΅μ„ μœ„ν•œ 쒋은 κ°œμ„ μž…λ‹ˆλ‹€.

src/main/java/site/kikihi/custom/platform/adapter/in/web/dto/response/product/KeyboardRecommendationResponse.java (2)

37-37: null κ°€λŠ₯ν•œ 가격 ν•„λ“œλ‘œ λ³€κ²½

price ν•„λ“œκ°€ primitive doubleμ—μ„œ wrapper Double둜 λ³€κ²½λ˜μ–΄ null 값을 μ²˜λ¦¬ν•  수 있게 λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” 가격 정보가 μ—†λŠ” 경우λ₯Ό λͺ…μ‹œμ μœΌλ‘œ μ²˜λ¦¬ν•  수 μžˆμ–΄ 쒋은 κ°œμ„ μž…λ‹ˆλ‹€.


46-55: 뢁마크 정보λ₯Ό ν¬ν•¨ν•œ νŒ©ν† λ¦¬ λ©”μ„œλ“œ κ°œμ„ 

from λ©”μ„œλ“œκ°€ likedByMe νŒŒλΌλ―Έν„°λ₯Ό 받도둝 λ³€κ²½λ˜μ–΄, μ‚¬μš©μžλ³„ 뢁마크 μƒνƒœλ₯Ό μ •ν™•νžˆ λ°˜μ˜ν•  수 있게 λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

@doup2001 doup2001 added the 🐞 BugFix 였λ₯˜ 수 label Aug 28, 2025
@doup2001 doup2001 linked an issue Aug 28, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix 였λ₯˜ 수

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ”₯fix: PR 리뷰 반영

3 participants