create account and recipe working. Explore kind of works

This commit is contained in:
durn
2026-04-17 10:46:38 -06:00
parent b32b3d3a03
commit b26af70ef5
8 changed files with 78 additions and 18 deletions
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class SiteController {
@@ -49,12 +50,25 @@ public class SiteController {
return "view-recipe";
}
// @GetMapping("/explore")
// public String viewExplorePage(Model model) {
// //model.addAttribute("allemplist", employeeServiceImpl.getAllEmployee());
// List<RecipeDto> recipes = recipeService.getAllRecipes();
// model.addAttribute("recipes", recipes);
// return "explore";
// }
@GetMapping("/explore")
public String viewExplorePage(Model model) {
//model.addAttribute("allemplist", employeeServiceImpl.getAllEmployee());
List<RecipeDto> recipes = recipeService.getAllRecipes();
model.addAttribute("recipes", recipes);
public String explore(
@RequestParam(required = false) String q,
@RequestParam(required = false) List<String> tags,
Model model
) {
List<RecipeDto> recipes = recipeService.getRecipes(q, tags);
model.addAttribute("recipes", recipes);
model.addAttribute("q", q);
return "explore";
}
}