From 95b5a08faf4eff16ffe3e01feebfd80ff1ed9d85 Mon Sep 17 00:00:00 2001 From: Joona Choi Date: Sat, 12 Oct 2024 13:30:52 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=EB=A0=88=EC=8B=9C=ED=94=BC=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=A0=95=EB=A0=AC=EA=B0=92?= =?UTF-8?q?=EC=9D=84=20views,=20scraps,=20newest=EB=A1=9C=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/recipe/app/src/recipe/api/BlogRecipeController.java | 2 +- .../java/com/recipe/app/src/recipe/api/RecipeController.java | 2 +- .../recipe/app/src/recipe/api/YoutubeRecipeController.java | 2 +- .../app/src/recipe/application/RecipeSearchService.java | 4 ++-- .../app/src/recipe/application/blog/BlogRecipeService.java | 4 ++-- .../src/recipe/application/youtube/YoutubeRecipeService.java | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/recipe/app/src/recipe/api/BlogRecipeController.java b/src/main/java/com/recipe/app/src/recipe/api/BlogRecipeController.java index 74375fac..194ee1ba 100644 --- a/src/main/java/com/recipe/app/src/recipe/api/BlogRecipeController.java +++ b/src/main/java/com/recipe/app/src/recipe/api/BlogRecipeController.java @@ -36,7 +36,7 @@ public RecipesResponse getBlogRecipes(@Parameter(hidden = true) User user, @RequestParam(value = "startAfter") long startAfter, @Parameter(example = "20", name = "사이즈") @RequestParam(value = "size") int size, - @Parameter(example = "조회수순(blogViews) / 좋아요순(blogScraps) / 최신순(newest) = 기본값", name = "정렬") + @Parameter(example = "조회수순(views) / 좋아요순(scraps) / 최신순(newest) = 기본값", name = "정렬") @RequestParam(value = "sort") String sort) { return blogRecipeService.findBlogRecipesByKeyword(user, keyword, startAfter, size, sort); diff --git a/src/main/java/com/recipe/app/src/recipe/api/RecipeController.java b/src/main/java/com/recipe/app/src/recipe/api/RecipeController.java index bbb73df4..b1a5dd77 100644 --- a/src/main/java/com/recipe/app/src/recipe/api/RecipeController.java +++ b/src/main/java/com/recipe/app/src/recipe/api/RecipeController.java @@ -44,7 +44,7 @@ public RecipesResponse getRecipes(@Parameter(hidden = true) User user, @RequestParam(value = "startAfter") long startAfter, @Parameter(example = "20", name = "사이즈") @RequestParam(value = "size") int size, - @Parameter(example = "조회수순(recipeViews) / 좋아요순(recipeScraps) / 최신순(newest) = 기본값", name = "정렬") + @Parameter(example = "조회수순(views) / 좋아요순(scraps) / 최신순(newest) = 기본값", name = "정렬") @RequestParam(value = "sort") String sort) { return recipeSearchService.findRecipesByKeywordOrderBy(user, keyword, startAfter, size, sort); diff --git a/src/main/java/com/recipe/app/src/recipe/api/YoutubeRecipeController.java b/src/main/java/com/recipe/app/src/recipe/api/YoutubeRecipeController.java index 048d0507..05090930 100644 --- a/src/main/java/com/recipe/app/src/recipe/api/YoutubeRecipeController.java +++ b/src/main/java/com/recipe/app/src/recipe/api/YoutubeRecipeController.java @@ -38,7 +38,7 @@ public RecipesResponse getYoutubeRecipes(@Parameter(hidden = true) User user, @RequestParam(value = "startAfter") long startAfter, @Parameter(example = "20", name = "사이즈") @RequestParam(value = "size") int size, - @Parameter(example = "조회수순(youtubeViews) / 좋아요순(youtubeScraps) / 최신순(newest) = 기본값", name = "정렬") + @Parameter(example = "조회수순(views) / 좋아요순(scraps) / 최신순(newest) = 기본값", name = "정렬") @RequestParam(value = "sort") String sort) throws IOException { return youtubeRecipeService.findYoutubeRecipesByKeyword(user, keyword, startAfter, size, sort); diff --git a/src/main/java/com/recipe/app/src/recipe/application/RecipeSearchService.java b/src/main/java/com/recipe/app/src/recipe/application/RecipeSearchService.java index afdf843d..0e388e16 100644 --- a/src/main/java/com/recipe/app/src/recipe/application/RecipeSearchService.java +++ b/src/main/java/com/recipe/app/src/recipe/application/RecipeSearchService.java @@ -45,9 +45,9 @@ public RecipesResponse findRecipesByKeywordOrderBy(User user, String keyword, lo long totalCnt = recipeRepository.countByKeyword(keyword); List recipes; - if (sort.equals("recipeScraps")) { + if (sort.equals("scraps")) { recipes = findByKeywordOrderByRecipeScrapCnt(keyword, lastRecipeId, size); - } else if (sort.equals("recipeViews")) { + } else if (sort.equals("views")) { recipes = findByKeywordOrderByRecipeViewCnt(keyword, lastRecipeId, size); } else { recipes = findByKeywordOrderByCreatedAt(keyword, lastRecipeId, size); diff --git a/src/main/java/com/recipe/app/src/recipe/application/blog/BlogRecipeService.java b/src/main/java/com/recipe/app/src/recipe/application/blog/BlogRecipeService.java index 2b539d00..d3c08c79 100644 --- a/src/main/java/com/recipe/app/src/recipe/application/blog/BlogRecipeService.java +++ b/src/main/java/com/recipe/app/src/recipe/application/blog/BlogRecipeService.java @@ -55,9 +55,9 @@ public RecipesResponse findBlogRecipesByKeyword(User user, String keyword, long @Transactional(readOnly = true) public List findByKeywordOrderBy(String keyword, long lastBlogRecipeId, int size, String sort) { - if (sort.equals("blogScraps")) { + if (sort.equals("scraps")) { return findByKeywordOrderByBlogScrapCnt(keyword, lastBlogRecipeId, size); - } else if (sort.equals("blogViews")) { + } else if (sort.equals("views")) { return findByKeywordOrderByBlogViewCnt(keyword, lastBlogRecipeId, size); } else { return findByKeywordOrderByPublishedAt(keyword, lastBlogRecipeId, size); diff --git a/src/main/java/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeService.java b/src/main/java/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeService.java index a5c52987..3690f9f1 100644 --- a/src/main/java/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeService.java +++ b/src/main/java/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeService.java @@ -54,9 +54,9 @@ public RecipesResponse findYoutubeRecipesByKeyword(User user, String keyword, lo @Transactional(readOnly = true) public List findByKeywordOrderBy(String keyword, long lastYoutubeRecipeId, int size, String sort) { - if (sort.equals("youtubeScraps")) { + if (sort.equals("scraps")) { return findByKeywordOrderByYoutubeScrapCnt(keyword, lastYoutubeRecipeId, size); - } else if (sort.equals("youtubeViews")) { + } else if (sort.equals("views")) { return findByKeywordOrderByYoutubeViewCnt(keyword, lastYoutubeRecipeId, size); } else { return findByKeywordOrderByPostDate(keyword, lastYoutubeRecipeId, size); From 900b13f8a43e084644fe7e237f31bcbe7ccce68c Mon Sep 17 00:00:00 2001 From: Joona Choi Date: Sun, 13 Oct 2024 08:53:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=EC=B7=A8=EC=95=BD=EC=A0=90=20?= =?UTF-8?q?=EB=B0=9C=EA=B2=AC=EB=90=9C=20=EB=9D=BC=EC=9D=B4=EB=B8=8C?= =?UTF-8?q?=EB=9F=AC=EB=A6=AC=20=EB=B2=84=EC=A0=84=20=EC=97=85=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 8b8adc2c..f0263c07 100644 --- a/build.gradle +++ b/build.gradle @@ -50,9 +50,9 @@ dependencies { runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2' runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2' - implementation 'org.jsoup:jsoup:1.13.1' + implementation 'org.jsoup:jsoup:1.18.1' - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2' + implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '5.0.0-alpha.14' implementation group: 'com.google.api-client', name: 'google-api-client', version: '1.25.0' implementation group: 'com.google.apis', name: 'google-api-services-youtube', version: 'v3-rev212-1.25.0' @@ -64,7 +64,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-redis' - implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.0' + implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '4.1.3' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' From 53196b5caa3c8152c65488fc41c9a52da568b046 Mon Sep 17 00:00:00 2001 From: Joona Choi Date: Sun, 13 Oct 2024 08:59:15 +0900 Subject: [PATCH 3/3] =?UTF-8?q?test:=20=EC=A0=95=EB=A0=AC=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/recipe/application/RecipeSearchServiceTest.groovy | 4 ++-- .../src/recipe/application/blog/BlogRecipeServiceTest.groovy | 4 ++-- .../application/youtube/YoutubeRecipeServiceTest.groovy | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/groovy/com/recipe/app/src/recipe/application/RecipeSearchServiceTest.groovy b/src/test/groovy/com/recipe/app/src/recipe/application/RecipeSearchServiceTest.groovy index d268e37f..840ee4d5 100644 --- a/src/test/groovy/com/recipe/app/src/recipe/application/RecipeSearchServiceTest.groovy +++ b/src/test/groovy/com/recipe/app/src/recipe/application/RecipeSearchServiceTest.groovy @@ -44,7 +44,7 @@ class RecipeSearchServiceTest extends Specification { String keyword = "테스트" long lastRecipeId = 0 int size = 10 - String sort = "recipeScraps" + String sort = "scraps" recipeRepository.countByKeyword(keyword) >> 2 @@ -118,7 +118,7 @@ class RecipeSearchServiceTest extends Specification { String keyword = "테스트" long lastRecipeId = 0 int size = 10 - String sort = "recipeViews" + String sort = "views" recipeRepository.countByKeyword(keyword) >> 2 diff --git a/src/test/groovy/com/recipe/app/src/recipe/application/blog/BlogRecipeServiceTest.groovy b/src/test/groovy/com/recipe/app/src/recipe/application/blog/BlogRecipeServiceTest.groovy index 92a2a11b..d876ee95 100644 --- a/src/test/groovy/com/recipe/app/src/recipe/application/blog/BlogRecipeServiceTest.groovy +++ b/src/test/groovy/com/recipe/app/src/recipe/application/blog/BlogRecipeServiceTest.groovy @@ -32,7 +32,7 @@ class BlogRecipeServiceTest extends Specification { String keyword = "테스트" long lastBlogRecipeId = 0 int size = 2 - String sort = "blogScraps" + String sort = "scraps" blogRecipeRepository.countByKeyword(keyword) >> 20 @@ -102,7 +102,7 @@ class BlogRecipeServiceTest extends Specification { String keyword = "테스트" long lastBlogRecipeId = 0 int size = 2 - String sort = "blogViews" + String sort = "views" blogRecipeRepository.countByKeyword(keyword) >> 20 diff --git a/src/test/groovy/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeServiceTest.groovy b/src/test/groovy/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeServiceTest.groovy index e7b6f04e..b6c55173 100644 --- a/src/test/groovy/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeServiceTest.groovy +++ b/src/test/groovy/com/recipe/app/src/recipe/application/youtube/YoutubeRecipeServiceTest.groovy @@ -33,7 +33,7 @@ class YoutubeRecipeServiceTest extends Specification { String keyword = "테스트" long lastYoutubeRecipeId = 0 int size = 2 - String sort = "youtubeScraps" + String sort = "scraps" youtubeRecipeRepository.countByKeyword(keyword) >> 20 @@ -103,7 +103,7 @@ class YoutubeRecipeServiceTest extends Specification { String keyword = "테스트" long lastYoutubeRecipeId = 0 int size = 2 - String sort = "youtubeViews" + String sort = "views" youtubeRecipeRepository.countByKeyword(keyword) >> 20