Class UserController


  • @RestController
    @RequestMapping("/users")
    public class UserController
    extends Object
    This class creates REST endpoints that has access to the User entity in the database through the user service. Identified by the URL /interviewprep/users.
    • Constructor Detail

      • UserController

        @Autowired
        public UserController​(UserService service)
        Constructor that instantiates a new User service object.
        Parameters:
        service - User service object.
    • Method Detail

      • me

        @GetMapping(value="/me",
                    produces="application/json")
        public User me()
        This method defines the behavior of a GET request to the URL /interviewprep/users/me. It grabs the current user from the User service.
        Returns:
        A User object in the form of JSON.