From 92991a7350536ca80142c4a8eec782a922237fb4 Mon Sep 17 00:00:00 2001 From: SeungHyeon Date: Mon, 5 Feb 2024 21:08:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Chore:=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dpang/item/repository/ItemRepository.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/kea/dpang/item/repository/ItemRepository.java b/src/main/java/kea/dpang/item/repository/ItemRepository.java index 02d9896..8ca62ac 100644 --- a/src/main/java/kea/dpang/item/repository/ItemRepository.java +++ b/src/main/java/kea/dpang/item/repository/ItemRepository.java @@ -11,14 +11,16 @@ public interface ItemRepository extends JpaRepository { - @Query("SELECT i FROM Item i WHERE " + - "(:category IS NULL OR i.category = :category) AND " + - "(:subCategory IS NULL OR i.subCategory = :subCategory) AND " + - "(:sellerId IS NULL OR i.sellerId = :sellerId) AND " + - "(:minPrice = 0 OR i.price >= :minPrice) AND " + - "(:maxPrice = 2000000 OR i.price <= :maxPrice) AND " + - "(i.name LIKE %:keyword%)") -// "(i.itemName LIKE %:keyword% OR i.description LIKE %:keyword%)") + @Query("SELECT i FROM Item i " + + "WHERE (:category IS NULL OR i.category = :category) " + + "AND (:subCategory IS NULL OR i.subCategory = :subCategory) " + + "AND (:sellerId IS NULL OR i.sellerId = :sellerId) " + + "AND (:minPrice = 0 OR i.price >= :minPrice) " + + "AND (:maxPrice = 2000000 OR i.price <= :maxPrice) " + + "AND (i.name LIKE :keyword) " + + "order by i.name asc" + ) + // "(i.itemName LIKE %:keyword% OR i.description LIKE %:keyword%)") Page filterItems( @Param("category") Category category, @Param("subCategory") SubCategory subCategory, @@ -26,6 +28,7 @@ Page filterItems( @Param("minPrice") Double minPrice, @Param("maxPrice") Double maxPrice, @Param("keyword") String keyword, - Pageable pageable); + Pageable pageable + ); } From 9e392109e24ae9a9bf5664a3ff288cebdd05f3cd Mon Sep 17 00:00:00 2001 From: SeungHyeon Date: Mon, 5 Feb 2024 21:20:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Feat:=20FeignConfig=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kea/dpang/item/config/FeignConfig.java | 14 ++++++++++++++ src/main/resources/application.yml | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/java/kea/dpang/item/config/FeignConfig.java diff --git a/src/main/java/kea/dpang/item/config/FeignConfig.java b/src/main/java/kea/dpang/item/config/FeignConfig.java new file mode 100644 index 0000000..e57731b --- /dev/null +++ b/src/main/java/kea/dpang/item/config/FeignConfig.java @@ -0,0 +1,14 @@ +package kea.dpang.item.config; + +import feign.Logger; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FeignConfig { + + @Bean + public Logger.Level feignLoggerLevel() { + return Logger.Level.FULL; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 845dd54..124a082 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -5,3 +5,8 @@ spring: jpa: hibernate: ddl-auto: update + +logging: + level: +# org.springframework.security: DEBUG + kea.dpang.item.feign.*: DEBUG \ No newline at end of file