Class UserConfigController
java.lang.Object
org.ntnu.idi.idatt2106.sparesti.sparestibackend.controller.UserConfigController
@RestController
@CrossOrigin
@RequestMapping("/config")
public class UserConfigController
extends Object
Controller for managing endpoints of a user's configuration
- Since:
- 19.4.24
- Version:
- 1.0
- Author:
- Yasin M.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<UserConfigDTO> getUserConfig
(org.springframework.security.core.userdetails.UserDetails userDetails) Gets a user's configuration
-
Constructor Details
-
UserConfigController
public UserConfigController()
-
-
Method Details
-
getUserConfig
@GetMapping public org.springframework.http.ResponseEntity<UserConfigDTO> getUserConfig(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails) throws UserNotFoundException, ConfigNotFoundException Gets a user's configuration- Parameters:
userDetails
- Current user- Returns:
- User configuration
- Throws:
UserNotFoundException
- User not foundConfigNotFoundException
- If user has not created config
-