From 1fdbee2f18dd62add0f5c1316b2de76f29cea001 Mon Sep 17 00:00:00 2001 From: bongsh0112 Date: Tue, 26 Dec 2023 17:05:03 +0900 Subject: [PATCH] spotless apply --- .../ProductCustomRepositoryImpl.java | 12 ++++---- .../strategy/HEEXERecommendationStrategy.java | 29 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Domain/src/main/java/tify/server/domain/domains/product/repository/ProductCustomRepositoryImpl.java b/Domain/src/main/java/tify/server/domain/domains/product/repository/ProductCustomRepositoryImpl.java index 7000949c..5dca4a80 100644 --- a/Domain/src/main/java/tify/server/domain/domains/product/repository/ProductCustomRepositoryImpl.java +++ b/Domain/src/main/java/tify/server/domain/domains/product/repository/ProductCustomRepositoryImpl.java @@ -132,12 +132,12 @@ public List findAllBySmallCategory( @Override public List searchAllByCategoryName(String categoryName) { return queryFactory - .selectFrom(product) - .innerJoin(favorQuestionCategory) - .on( - favorQuestionCategory.id.eq(product.favorQuestionCategoryId), - favorQuestionCategory.name.eq(categoryName)) - .fetch(); + .selectFrom(product) + .innerJoin(favorQuestionCategory) + .on( + favorQuestionCategory.id.eq(product.favorQuestionCategoryId), + favorQuestionCategory.name.eq(categoryName)) + .fetch(); } private OrderSpecifier[] orderByPrice(PriceOrder priceOrder) { diff --git a/Domain/src/main/java/tify/server/domain/domains/question/strategy/HEEXERecommendationStrategy.java b/Domain/src/main/java/tify/server/domain/domains/question/strategy/HEEXERecommendationStrategy.java index 5a361bf7..e6415d0f 100644 --- a/Domain/src/main/java/tify/server/domain/domains/question/strategy/HEEXERecommendationStrategy.java +++ b/Domain/src/main/java/tify/server/domain/domains/question/strategy/HEEXERecommendationStrategy.java @@ -1,11 +1,9 @@ package tify.server.domain.domains.question.strategy; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.transaction.annotation.Transactional; import tify.server.domain.domains.product.adaptor.ProductAdaptor; @@ -24,13 +22,13 @@ public class HEEXERecommendationStrategy implements ProductRecommendationStrateg private static final String CATEGORY_NAME = "HEEXE"; @Override - public List recommendation(Long userId, String categoryName, - List dto) { + public List recommendation( + Long userId, String categoryName, List dto) { List recommendationDTO = getRecommendDTO(userId); - List splitAnswer = Arrays.stream(recommendationDTO.get(0).getAnswer().split(", ")) - .toList(); + List splitAnswer = + Arrays.stream(recommendationDTO.get(0).getAnswer().split(", ")).toList(); if (splitAnswer.contains("그 외")) { return etcStep(splitAnswer); @@ -42,7 +40,7 @@ public List recommendation(Long userId, String categoryName, private List getRecommendDTO(Long userId) { List favorAnswers = new ArrayList<>(); favorAnswers.add( - favorAnswerAdaptor.searchByCategoryNameAndNumber(userId, CATEGORY_NAME, 2L)); + favorAnswerAdaptor.searchByCategoryNameAndNumber(userId, CATEGORY_NAME, 2L)); return favorAnswers.stream().map(FavorRecommendationDTO::from).toList(); } @@ -58,13 +56,16 @@ private List etcStep(List splitAnswer) { // 그 외 라는 답 private List specificStep(List splitAnswer) { // 그 외 라는 답변 존재하지 않을 때 List result = new ArrayList<>(); if (splitAnswer.size() > 1) { // ex) 헬스, 요가&필라테스 - result.addAll(productAdaptor.queryAllByCategoryNameAndCharacter(CATEGORY_NAME, - splitAnswer.get(0))); - result.addAll(productAdaptor.queryAllByCategoryNameAndCharacter(CATEGORY_NAME, - splitAnswer.get(1))); + result.addAll( + productAdaptor.queryAllByCategoryNameAndCharacter( + CATEGORY_NAME, splitAnswer.get(0))); + result.addAll( + productAdaptor.queryAllByCategoryNameAndCharacter( + CATEGORY_NAME, splitAnswer.get(1))); } else { // ex) 헬스 - result.addAll(productAdaptor.queryAllByCategoryNameAndCharacter(CATEGORY_NAME, - splitAnswer.get(0))); + result.addAll( + productAdaptor.queryAllByCategoryNameAndCharacter( + CATEGORY_NAME, splitAnswer.get(0))); } return result; }