From 5fa6eea09ae5f7811c5644ef0db4ac993bbd77a0 Mon Sep 17 00:00:00 2001 From: sanseongKo Date: Wed, 8 Oct 2025 00:41:56 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[FP-32]=20git=20ignore=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 0d30112..d28dd37 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ jacoco.exec .git/ config/** + +out/ +generated/ From bfd44e74b48addb82e6d482da77645737c66f72b Mon Sep 17 00:00:00 2001 From: sanseongKo Date: Wed, 8 Oct 2025 00:42:09 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[FP-32]=20kafka=20=EB=A1=9C=EA=B7=B8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- finpik-api/src/main/resources/application.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/finpik-api/src/main/resources/application.yml b/finpik-api/src/main/resources/application.yml index 29d9ef8..003a109 100644 --- a/finpik-api/src/main/resources/application.yml +++ b/finpik-api/src/main/resources/application.yml @@ -119,11 +119,7 @@ management: logging: level: org.springframework.security.web.authentication: debug - org.apache.kafka: error - org.apache.kafka.clients: warn - org.springframework.kafka: error - org.springframework.kafka.listener: warn - org.springframework.security: info + org.apache.kafka.clients.NetworkClient: ERROR # 필터 체인과 보안 디버깅(요청마다 어떤 필터가 적용됐는지) org.springframework.security.web.FilterChainProxy: TRACE From 9eddd172880338ba902ad96144ec005c32663c67 Mon Sep 17 00:00:00 2001 From: sanseongKo Date: Wed, 8 Oct 2025 00:44:26 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[FP-32]=20querydsql=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 뱃지 리스트를 들고 올 때 projection으로 넣을 때 캐스팅이 안되는 문제 - 이 전까지는 문제가 없었던 이유는 뱃지 리스트로 들고오지 않고 뱃지가 하나밖에 없어서 운이 좋았음 - 뱃지가 리스트가 되자마자 querydsl row하나당 객체 하나를 만들려고 하니 문제가 발생 --- ...commendedLoanProductJpaRepositoryImpl.java | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java index b042464..9fb69fc 100644 --- a/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java +++ b/finpik-infra/mysql/src/main/java/finpik/jpa/repository/loanproduct/impl/CustomRecommendedLoanProductJpaRepositoryImpl.java @@ -3,6 +3,7 @@ import com.querydsl.core.types.OrderSpecifier; import com.querydsl.core.types.Projections; import com.querydsl.jpa.impl.JPAQueryFactory; +import finpik.entity.loanproduct.RecommendedLoanProductEntity; import finpik.jpa.repository.loanproduct.CustomRecommendedLoanProductJpaRepository; import finpik.jpa.repository.loanproduct.projection.RecommendedLoanProductProjection; import finpik.util.db.OrderSpecifierTransformer; @@ -25,35 +26,39 @@ public class CustomRecommendedLoanProductJpaRepositoryImpl implements CustomReco private final JPAQueryFactory jpaQueryFactory; private static final String SIMILARITY_PROPERTY = "similarity"; - public Slice findAllByProfileId(Long productId, Pageable pageable) { - List proejctionList = jpaQueryFactory - .select(Projections.constructor(RecommendedLoanProductProjection.class, - recommendedLoanProductEntity.id, - recommendedLoanProductEntity.profileId, - loanProductEntity.bankName, - loanProductEntity.id, - loanProductEntity.productName, - loanProductEntity.maxInterestRate, - loanProductEntity.minInterestRate, - loanProductEntity.maxLoanLimitAmount, - recommendedLoanProductEntity.similarity, - recommendedLoanProductEntity.loanProductBadgeList - )) - .from(recommendedLoanProductEntity) - .where(recommendedLoanProductEntity.profileId.eq(productId)) - .leftJoin(loanProductEntity).on(recommendedLoanProductEntity.loanProductEntity.id.eq(loanProductEntity.id)) + public Slice findAllByProfileId(Long profileId, Pageable pageable) { + List recommendedLoanProducts = jpaQueryFactory + .selectFrom(recommendedLoanProductEntity) + .leftJoin(recommendedLoanProductEntity.loanProductEntity, loanProductEntity).fetchJoin() + .leftJoin(recommendedLoanProductEntity.loanProductBadgeList).fetchJoin() + .where(recommendedLoanProductEntity.profileId.eq(profileId)) + .orderBy(orderBySort(pageable.getSort())) .offset(pageable.getOffset()) .limit(getLimit(pageable.getPageSize())) - .orderBy(orderBySort(pageable.getSort())) + .distinct() .fetch(); - boolean hasNext = hasNext(proejctionList.size(), pageable.getPageSize()); - - if (hasNext) { - proejctionList.remove(pageable.getPageSize()); + boolean hasNextPage = hasNext(recommendedLoanProducts.size(), pageable.getPageSize()); + if (hasNextPage) { + recommendedLoanProducts.remove(pageable.getPageSize()); } - return new SliceImpl<>(proejctionList, pageable, hasNext); + List projections = recommendedLoanProducts.stream() + .map(entity -> new RecommendedLoanProductProjection( + entity.getId(), + entity.getProfileId(), + entity.getLoanProductEntity().getBankName(), + entity.getLoanProductEntity().getId(), + entity.getLoanProductEntity().getProductName(), + entity.getLoanProductEntity().getMinInterestRate(), + entity.getLoanProductEntity().getMaxInterestRate(), + entity.getLoanProductEntity().getMaxLoanLimitAmount(), + entity.getSimilarity(), + entity.getLoanProductBadgeList() + )) + .toList(); + + return new SliceImpl<>(projections, pageable, hasNextPage); } private OrderSpecifier[] orderBySort(Sort sort) { From dce2743a14ecbd15b8b225de8c2f4ec7ee7e7f5f Mon Sep 17 00:00:00 2001 From: sanseongKo Date: Wed, 8 Oct 2025 00:46:44 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[FP-32]=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EC=9D=98=20=ED=95=84=EB=93=9C=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20float=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mysql/src/test/java/entity/profile/ProfileEntityTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java b/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java index 9e6043b..f724ea9 100644 --- a/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java +++ b/finpik-infra/mysql/src/test/java/entity/profile/ProfileEntityTest.java @@ -78,7 +78,7 @@ private Profile getDefaultProfile() { null, user, 0, - 0.0, + 0.0f, LocalDateTime.now(), LocalDateTime.now() );