Class UserController
- java.lang.Object
-
- edu.cnm.deepdive.interviewprep.controller.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 Summary
Constructors Constructor Description UserController(UserService service)
Constructor that instantiates a new User service object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
me()
This method defines the behavior of a GET request to the URL /interviewprep/users/me.
-
-
-
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 theUser
service.- Returns:
- A User object in the form of JSON.
-
-