Ignore:
Timestamp:
02/10/23 01:52:11 (21 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
ef84238
Parents:
73f0dbc
Message:

Profiles for user and worker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/web/HomeController.java

    r73f0dbc r7926d68  
    403403        return "redirect:/home/getFilm/"+id;
    404404    }
    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    }
    406422}
Note: See TracChangeset for help on using the changeset viewer.