mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
create account and recipe working. Explore kind of works
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user