Changeset cab5859 for src/main/java/com/example
- Timestamp:
- 01/06/23 21:08:03 (23 months ago)
- Branches:
- main
- Children:
- 89865ae
- Parents:
- 9dcbf44
- Location:
- src/main/java/com/example/autopartz
- Files:
-
- 7 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/config/WebSecurityConfig.java
r9dcbf44 rcab5859 28 28 http.csrf().disable() 29 29 .authorizeRequests() 30 .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied" ).permitAll()30 .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied","/carCategoryReport","/partManufacturersReport","/mostPurchasedPart").permitAll() 31 31 .antMatchers("/orders","/repairs","/reviews","/part/*","/currentOrder","/addCarSampleForUser","/repairs/addReview/*").hasRole("CLIENT") 32 32 .antMatchers("/viewUsers","/approve/*").hasRole("ADMIN") -
src/main/java/com/example/autopartz/controller/AdminController.java
r9dcbf44 rcab5859 37 37 public String getAllUsers(Model model){ 38 38 List<User> pendingList = userService.findAllUsers().stream().filter(u->u.getAuthorities().contains(Role.ROLE_PENDING_DELIVERYMAN) || u.getAuthorities().contains(Role.ROLE_PENDING_WAREHOUSEMAN)).toList(); 39 model.addAttribute("users", pendingList); 39 if(pendingList.size()==0){ 40 model.addAttribute("hasError",true); 41 } 42 else { 43 model.addAttribute("hasError",false); 44 model.addAttribute("users", pendingList); 45 } 40 46 model.addAttribute("bodyContent", "viewUsers"); 41 47 return "master-template"; -
src/main/java/com/example/autopartz/controller/HomeController.java
r9dcbf44 rcab5859 37 37 private final DeliveryService deliveryService; 38 38 private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository; 39 private final CarCategoryReportRepository carCategoryReportRepository; 40 private final PartManufacturersReportRepository partManufacturersReportRepository; 41 private final MostPurchasedPartRepository mostPurchasedPartRepository; 39 42 public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, WarehouseRepository warehouseRepository, 40 OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository ) {43 OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, CarCategoryReportRepository carCategoryReportRepository, PartManufacturersReportRepository partManufacturersReportRepository, MostPurchasedPartRepository mostPurchasedPartRepository) { 41 44 this.loginService = loginService; 42 45 this.partService = partService; … … 52 55 this.deliveryService = deliveryService; 53 56 this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository; 57 this.carCategoryReportRepository = carCategoryReportRepository; 58 this.partManufacturersReportRepository = partManufacturersReportRepository; 59 this.mostPurchasedPartRepository = mostPurchasedPartRepository; 54 60 } 55 61 … … 231 237 return "master-template"; 232 238 } 239 @GetMapping("/carCategoryReport") 240 public String getCarCategoryInfo(Model model){ 241 model.addAttribute("data",carCategoryReportRepository.findAll()); 242 model.addAttribute("bodyContent","carCategoryReport"); 243 return "master-template"; 244 } 245 @GetMapping("/partManufacturersReport") 246 public String getPartManufacturersReport(Model model){ 247 model.addAttribute("data",partManufacturersReportRepository.findAll()); 248 model.addAttribute("bodyContent","partManufacturersReport"); 249 return "master-template"; 250 251 } 252 @GetMapping("/mostPurchasedPart") 253 public String getMostPurchasedPart(Model model){ 254 model.addAttribute("data",mostPurchasedPartRepository.findAll()); 255 model.addAttribute("bodyContent","mostPurchasedPart"); 256 return "master-template"; 257 } 233 258 }
Note:
See TracChangeset
for help on using the changeset viewer.