Changeset 7926d68 for src/main/java/com
- Timestamp:
- 02/10/23 01:52:11 (23 months ago)
- Branches:
- master
- Children:
- ef84238
- Parents:
- 73f0dbc
- Location:
- src/main/java/com/example/moviezone
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/config/WebSecurityConfig.java
r73f0dbc r7926d68 33 33 .authorizeRequests() 34 34 .antMatchers("/","/films","/home/projections","/home/events","/home/getProjections/**","/home/films","/home/getFilm/**","/getFilm/**","/home/getEvent/**","/getEvent/**","/login","/events","/projections" ,"/home", "/assets/**", "/register", "/api/**").permitAll() 35 .antMatchers("/home/getSeats/**","/myTickets","/home/addRating/**","/addRating/**","/getProjection/**","/home/makeReservation" ).hasRole("USER")35 .antMatchers("/home/getSeats/**","/myTickets","/home/addRating/**","/addRating/**","/getProjection/**","/home/makeReservation","/profileUser").hasRole("USER") 36 36 .antMatchers("/**").hasRole("ADMIN") 37 37 .anyRequest() -
src/main/java/com/example/moviezone/repository/WorkerRepository.java
r73f0dbc r7926d68 7 7 @Repository 8 8 public interface WorkerRepository extends JpaRepository<Worker,Integer> { 9 Worker getByUsername(String username); 9 10 } -
src/main/java/com/example/moviezone/service/Impl/WorkerServiceImpl.java
r73f0dbc r7926d68 20 20 return workerRepository.findAll(); 21 21 } 22 23 @Override 24 public Worker getWorkerByUsername(String username) { 25 return workerRepository.getByUsername(username); 26 } 22 27 } -
src/main/java/com/example/moviezone/service/WorkerService.java
r73f0dbc r7926d68 7 7 public interface WorkerService { 8 8 List<Worker> findAllWorkers(); 9 Worker getWorkerByUsername(String username); 9 10 } -
src/main/java/com/example/moviezone/web/HomeController.java
r73f0dbc r7926d68 403 403 return "redirect:/home/getFilm/"+id; 404 404 } 405 405 @GetMapping("/profileWorker") 406 public String getWorkerProfile(Model model,HttpServletRequest request) 407 { 408 Worker worker=workerService.getWorkerByUsername(request.getRemoteUser()); 409 model.addAttribute("worker",worker); 410 model.addAttribute("bodyContent", "profileWorker"); 411 return "master-template"; 412 } 413 @GetMapping("/profileUser") 414 public String getUserProfile(Model model,HttpServletRequest request) 415 { 416 Customer customer=customerService.findByUsername(request.getRemoteUser()); 417 System.out.println(customer.getFirst_name()); 418 model.addAttribute("customer",customer); 419 model.addAttribute("bodyContent", "profileUser"); 420 return "master-template"; 421 } 406 422 }
Note:
See TracChangeset
for help on using the changeset viewer.