|
@@ -109,8 +109,7 @@ public class UserController {
|
|
|
// 사용자 팔로우
|
|
|
@PostMapping("/follow")
|
|
|
public ResponseEntity follow(HttpServletRequest request, @RequestBody FollowDTO followDTO) {
|
|
|
- // final int userId = (int) request.getSession().getAttribute("ssId");
|
|
|
- final int userId = 1;
|
|
|
+ final int userId = (int) request.getSession().getAttribute("ssId");
|
|
|
if (userId != followDTO.getFromUser()) {
|
|
|
return ResponseEntity.status(HttpStatus.FORBIDDEN).body("권한이 없습니다");
|
|
|
}
|
|
@@ -121,8 +120,7 @@ public class UserController {
|
|
|
// 사용자 언팔로우
|
|
|
@DeleteMapping("/unfollow")
|
|
|
public ResponseEntity unfollow(HttpServletRequest request, @RequestBody FollowDTO followDTO) {
|
|
|
- // final int userId = (int) request.getSession().getAttribute("ssId");
|
|
|
- final int userId = 1;
|
|
|
+ final int userId = (int) request.getSession().getAttribute("ssId");
|
|
|
if (userId != followDTO.getFromUser()) {
|
|
|
return ResponseEntity.status(HttpStatus.FORBIDDEN).body("권한이 없습니다");
|
|
|
}
|