Fix PathVariable type
This commit is contained in:
@@ -25,7 +25,7 @@ public class UserController {
|
|||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
@GetMapping("/profile")
|
@GetMapping("/profile")
|
||||||
public ProfileRes profile(@AuthenticationPrincipal UserDetails userDetails) {
|
public ProfileRes profile(@AuthenticationPrincipal UserDetails userDetails) throws UserNotFoundException {
|
||||||
System.out.println("userDetails = " + userDetails);
|
System.out.println("userDetails = " + userDetails);
|
||||||
User userDetail = userService.findByEmail(userDetails.getUsername())
|
User userDetail = userService.findByEmail(userDetails.getUsername())
|
||||||
.orElseThrow(() -> new UserNotFoundException());
|
.orElseThrow(() -> new UserNotFoundException());
|
||||||
@@ -37,9 +37,8 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/profile/user/{username}")
|
@GetMapping("/profile/user/{username}")
|
||||||
public ProfileRes userProfile(@PathVariable ProfileReq username) {
|
public ProfileRes userProfile(@PathVariable String username) throws UserNotFoundException {
|
||||||
System.out.println("username.toString() = " + username.toString());
|
User user = userService.findByName(username)
|
||||||
User user = userService.findByName(username.getName())
|
|
||||||
.orElseThrow(UserNotFoundException::new);
|
.orElseThrow(UserNotFoundException::new);
|
||||||
|
|
||||||
return ProfileRes.builder()
|
return ProfileRes.builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user