Skip to content
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

[BSVR-257] 리뷰 수정 API 업데이트 - 요청 필드 추가, nullable 처리 #185

Merged
merged 12 commits into from
Sep 8, 2024

Conversation

pminsung12
Copy link
Collaborator

📌 개요 (필수)

  • 리뷰 수정 API 업데이트 - 요청 필드 추가, nullable 처리
  • 관련 논의 >> slack

🔨 작업 사항 (필수)

  • request 필드에 stadiumId, rowNumber, reviewType 추가
  • 최대한 적게 디스크에 접근하기 위해 케이스 꼼꼼하게 처리
  • 세부로직은 processor로 이관하여 리팩토링 진행

⚡️ 관심 리뷰 (선택)

  • 다음 pr에 이부분 최적화 진행할 예정 - for문 돌면서 계속 디스크에 접근하는 구조라 비효율적임.
public Map<Long, Keyword> processKeywords(
            Review review, List<String> goodKeywords, List<String> badKeywords) {
        Map<Long, Keyword> keywordMap = new HashMap<>();
        processKeywordList(review, goodKeywords, true, keywordMap);
        processKeywordList(review, badKeywords, false, keywordMap);
        return keywordMap;
    }

    // FIXME: 쿼리 호출 부분 개선 필요
    private void processKeywordList(
            Review review,
            List<String> keywordContents,
            boolean isPositive,
            Map<Long, Keyword> keywordMap) {
        for (String content : keywordContents) {
            Keyword keyword =
                    keywordRepository
                            .findByContent(content)
                            .orElseGet(
                                    () ->
                                            keywordRepository.save(
                                                    Keyword.create(null, content, isPositive)));

            ReviewKeyword reviewKeyword = ReviewKeyword.create(null, keyword.getId());
            review.addKeyword(reviewKeyword);
            keywordMap.put(keyword.getId(), keyword);
        }
    }

🌱 연관 내용 (선택)

  • 관련 있는 내용, 또는 앞으로 고려할 내용을 적어주세요.

💻 실행 화면 (필수)

  • 200 OK
  • rowNumber만 null인경우, seatNumber만 null인 경우, 둘 다 null인 경우 체크 완료

image

@pminsung12 pminsung12 added ♻️ Refactor 코드 리팩토링 및 구조 개선 ✨ Feature 기능 개발 labels Sep 8, 2024
@pminsung12 pminsung12 self-assigned this Sep 8, 2024
@pminsung12 pminsung12 marked this pull request as ready for review September 8, 2024 10:42
@github-actions github-actions bot added the size/M label Sep 8, 2024
Copy link

github-actions bot commented Sep 8, 2024

Test Results

53 tests  ±0   53 ✅ ±0   4s ⏱️ ±0s
18 suites ±0    0 💤 ±0 
18 files   ±0    0 ❌ ±0 

Results for commit 24ed80e. ± Comparison against base commit 1687b42.

@pminsung12 pminsung12 added the 🚀 Self Approve 빨리 merge가 필요한 경우, 코드 리뷰를 생략했다는 의미로 추가해요. 남용하지 말 것. label Sep 8, 2024
@pminsung12 pminsung12 merged commit 586fcbd into main Sep 8, 2024
5 checks passed
@pminsung12 pminsung12 deleted the feat/BSVR-257 branch September 8, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발 ♻️ Refactor 코드 리팩토링 및 구조 개선 🚀 Self Approve 빨리 merge가 필요한 경우, 코드 리뷰를 생략했다는 의미로 추가해요. 남용하지 말 것. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant