Class PersonController

java.lang.Object
balu.pizza.webapp.controllers.PersonController

@Controller @RequestMapping("/user") public class PersonController extends Object
Users controller
  • Constructor Details

    • PersonController

      @Autowired public PersonController(UserUtil userUtil, PizzaService pizzaService, PersonValidator personValidator, PersonService personService)
      Parameters:
      userUtil - Set users utils
      pizzaService - Pizza service
      personValidator - User data validation
      personService - User service
  • Method Details

    • userPage

      @GetMapping("/myPage") public String userPage(org.springframework.ui.Model model)
      Personal user area

      admin panel

      Parameters:
      model -
      Returns:
      Generates a page for the route /user/myPage
    • changeUserInfo

      @GetMapping("/edit") public String changeUserInfo(@ModelAttribute("person") Person person, org.springframework.ui.Model model)
      Edit user information page
      Parameters:
      person -
      model -
      Returns:
      Generates a page for the route /user/edit
    • updateUserInfo

      @PatchMapping("/edit") public String updateUserInfo(@ModelAttribute("person") @Valid @Valid Person person, org.springframework.validation.BindingResult bindingResult, String rePassword, org.springframework.ui.Model model)
      Method for validating the information entered by the user
      Parameters:
      person -
      bindingResult -
      rePassword -
      model -
      Returns:
      In case of successful validation - update the user information in the database