Changeset 6832924 for src/main/java/com/example/autopartz/controller
- Timestamp:
- 01/03/23 23:14:33 (23 months ago)
- Branches:
- main
- Children:
- ae042f4
- Parents:
- 60de3eb
- Location:
- src/main/java/com/example/autopartz/controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/controller/HomeController.java
r60de3eb r6832924 3 3 import com.example.autopartz.model.User; 4 4 import com.example.autopartz.repository.PartsForCarTypeAndCategoryRepository; 5 import com.example.autopartz.repository.RepairShopReviewSummaryRepository; 5 6 import com.example.autopartz.service.CarService; 6 7 import com.example.autopartz.service.CategoryService; … … 22 23 private final CarService carService; 23 24 private final CategoryService categoryService; 25 private final RepairShopReviewSummaryRepository repairShopReviewSummaryRepository; 24 26 25 public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService ) {27 public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository) { 26 28 this.loginService = loginService; 27 29 this.partService = partService; … … 29 31 this.carService = carService; 30 32 this.categoryService = categoryService; 33 this.repairShopReviewSummaryRepository = repairShopReviewSummaryRepository; 31 34 } 32 35 33 36 @GetMapping() 34 37 public String getHomePage(Model model){ 38 model.addAttribute("bodyContent","home"); 39 return "master-template"; 40 } 41 @GetMapping("/products") 42 public String getProducts(Model model){ 35 43 model.addAttribute("parts",partService.findAll()); 36 44 model.addAttribute("cars",carService.findAll()); 37 45 model.addAttribute("categories",categoryService.findAll()); 38 model.addAttribute("bodyContent","homepage"); 46 model.addAttribute("bodyContent","products"); 47 return "master-template"; 48 } 49 @GetMapping("/services") 50 public String getServices(Model model){ 51 model.addAttribute("services",repairShopReviewSummaryRepository.findAll()); 52 model.addAttribute("bodyContent","services"); 39 53 return "master-template"; 40 54 } -
src/main/java/com/example/autopartz/controller/UserController.java
r60de3eb r6832924 15 15 public class UserController { 16 16 private final UserService userService; 17 private final RepairShopReviewSummaryRepository repairShopReviewSummaryRepository;18 19 17 private final OrdersForUserRepository ordersForUserRepository; 20 18 private final RepairsForUserRepository repairsForUserRepository; 21 19 private final ReviewsForUserRepository reviewsForUserRepository; 22 public UserController(UserService userService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository,OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository) {20 public UserController(UserService userService, OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository) { 23 21 this.userService = userService; 24 this.repairShopReviewSummaryRepository = repairShopReviewSummaryRepository;25 22 this.ordersForUserRepository = ordersForUserRepository; 26 23 this.repairsForUserRepository = repairsForUserRepository; 27 24 this.reviewsForUserRepository = reviewsForUserRepository; 28 }29 @GetMapping("reportTest")30 public List<RepairShopReviewsSummary> getRepairShopReport(){31 return repairShopReviewSummaryRepository.findAll();32 25 } 33 26 @GetMapping("usersTest")
Note:
See TracChangeset
for help on using the changeset viewer.