Update 16 files

- /src/main/resources/templates/create-account.html
- /src/main/resources/templates/my-profile.html
- /src/main/resources/templates/home.html
- /src/main/resources/templates/update-recipe.html
- /src/main/resources/templates/explore.html
- /src/main/resources/templates/public-profile.html
- /src/main/java/com/example/demo/controller/SiteController.java
- /src/main/java/com/example/demo/controller/ProfileController.java
- /src/main/java/com/example/demo/dto/UserDto.java
- /src/main/java/com/example/demo/dto/UpdateProfileDto.java
- /src/main/java/com/example/demo/dto/ProfileDto.java
- /src/main/java/com/example/demo/service/Impl/RecipeServiceImpl.java
- /src/main/java/com/example/demo/service/Impl/UserServiceImpl.java
- /src/main/java/com/example/demo/service/UserService.java
- /src/main/java/com/example/demo/config/SecurityConfig.java
- /src/main/java/com/example/demo/entity/User.java
This commit is contained in:
Madeleine Stamp
2026-04-18 14:08:08 -06:00
parent c2e6722829
commit 659ab79497
16 changed files with 781 additions and 292 deletions
@@ -2,10 +2,8 @@ package com.example.demo.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.demo.service.RecipeService;
import com.example.demo.dto.RecipeDto;
import com.example.demo.entity.Recipe;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@@ -20,10 +18,10 @@ public class SiteController {
public SiteController(RecipeService recipeService) {
this.recipeService = recipeService;
}
@GetMapping("/")
public String viewHomePage(Model model) {
//model.addAttribute("allemplist", employeeServiceImpl.getAllEmployee());
List<RecipeDto> recipes = recipeService.getAllRecipes();
List<RecipeDto> recipes = recipeService.getAllRecipes();
model.addAttribute("recipes", recipes);
return "home";
}
@@ -49,14 +47,13 @@ public class SiteController {
model.addAttribute("recipe", recipe);
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("/recipes/{id}/edit")
public String viewEditRecipePage(@PathVariable Integer id, Model model) {
RecipeDto recipe = recipeService.getRecipeById(id);
model.addAttribute("recipe", recipe);
return "update-recipe";
}
@GetMapping("/explore")
public String explore(
@@ -69,13 +66,8 @@ public class SiteController {
) {
List<RecipeDto> recipes = recipeService.getRecipes(q, tags, prices, cookTime, prepTime);
model.addAttribute("recipes", recipes);
String displayQuery = q;
model.addAttribute("q", q);
model.addAttribute("tags", tags);
return "explore";
}
}