Skip to content

Fix : 상품 저장 로직 개선 및 중복 처리 문제 해결#63

Merged
andrewkimswe merged 1 commit intodevelopfrom
fix/#62
Feb 13, 2025
Merged

Fix : 상품 저장 로직 개선 및 중복 처리 문제 해결#63
andrewkimswe merged 1 commit intodevelopfrom
fix/#62

Conversation

@andrewkimswe
Copy link
Member

@andrewkimswe andrewkimswe commented Feb 13, 2025

📌 Summary


Description

상품 크롤링 및 저장 과정에서 중복 검사 방식을 개선하고, Kream처럼 고유 productId가 없는 경우에도 중복 저장을 방지하도록 로직을 수정했습니다.

기존 문제

  • 기존에는 productId가 있는 경우 existsByProductId()를 사용하여 중복 저장을 방지했으나,
    Kream 상품은 productId가 존재하지 않아 중복 검사가 불가능한 문제가 있었습니다.

🛠 해결 방법

  • 상품 저장 로직 개선

    • productId가 존재하는 경우 기존 로직 유지
    • productId가 없는 경우, title + mallName을 기준으로 중복 검사를 수행
    • 동일한 titlemallName을 가진 상품이 존재하면 새로운 정보로 덮어쓰기 (업데이트)
  • ProductRepository에 새로운 중복 검사 메서드 추가

    • findByTitleAndMallName() 메서드 추가하여 title + mallName 기반으로 중복 여부 확인
  • Kream 상품 저장 방식 변경

    • productId가 없는 경우에도 title + mallName을 기준으로 저장
    • 기존에 동일한 상품이 있으면 덮어쓰기, 없으면 새로 추가

🗒️ Review Point

혹시 궁금한 부분이나 수정이 필요한 사항이 있다면 알려주세요!

@andrewkimswe andrewkimswe requested a review from yeoeunn February 13, 2025 10:30
@andrewkimswe andrewkimswe self-assigned this Feb 13, 2025
@andrewkimswe andrewkimswe added the 🐛 fix 버그 수정 label Feb 13, 2025
@andrewkimswe andrewkimswe added this to the 📦 Backend Development milestone Feb 13, 2025
@andrewkimswe andrewkimswe linked an issue Feb 13, 2025 that may be closed by this pull request
3 tasks
@andrewkimswe andrewkimswe merged commit 1d264c8 into develop Feb 13, 2025
1 check passed
@andrewkimswe andrewkimswe deleted the fix/#62 branch February 13, 2025 10:31
@andrewkimswe andrewkimswe changed the title fix #62 : 상품 저장 로직 개선 및 중복 처리 문제 해결 fix : 상품 저장 로직 개선 및 중복 처리 문제 해결 Feb 13, 2025
@andrewkimswe andrewkimswe changed the title fix : 상품 저장 로직 개선 및 중복 처리 문제 해결 Fix : 상품 저장 로직 개선 및 중복 처리 문제 해결 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 fix 버그 수정

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix : 상품 저장 로직 개선 및 중복 처리 문제 해결

1 participant