diff --git a/backend/src/main/java/net/pengcook/category/controller/CategoryController.java b/backend/src/main/java/net/pengcook/category/controller/CategoryController.java index fe944801..2c4434d6 100644 --- a/backend/src/main/java/net/pengcook/category/controller/CategoryController.java +++ b/backend/src/main/java/net/pengcook/category/controller/CategoryController.java @@ -6,6 +6,7 @@ import net.pengcook.category.service.CategoryService; import net.pengcook.recipe.dto.MainRecipeResponse; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -18,11 +19,7 @@ public class CategoryController { private final CategoryService categoryService; @GetMapping - public List readRecipesOfCategory( - @RequestParam String category, - @RequestParam int pageNumber, - @RequestParam int pageSize) { - RecipeOfCategoryRequest request = new RecipeOfCategoryRequest(category, pageNumber, pageSize); + public List readRecipesOfCategory(@ModelAttribute RecipeOfCategoryRequest request) { return categoryService.readRecipesOfCategory(request); } }