From 2e3fd217e1f84a52a8cc5233a2881858b3e7965b Mon Sep 17 00:00:00 2001 From: wnd01jun Date: Thu, 28 Nov 2024 14:27:44 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20UserId=20->=20AuthUser=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EB=B0=9B=EB=8A=94=20=EB=A1=9C=EC=A7=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/comment/controller/CommentController.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java index 3d96a560..ece131ec 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/comment/controller/CommentController.java @@ -5,7 +5,8 @@ import com.bbteam.budgetbuddies.domain.comment.dto.CommentResponseDto; import com.bbteam.budgetbuddies.domain.comment.service.CommentService; import com.bbteam.budgetbuddies.domain.comment.validation.ExistComment; -import com.bbteam.budgetbuddies.domain.user.validation.ExistUser; +import com.bbteam.budgetbuddies.domain.user.dto.UserDto; +import com.bbteam.budgetbuddies.global.security.utils.AuthUser; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Page; @@ -36,9 +37,9 @@ public CommentController(CommentService saveDiscountInfoComment( - @RequestParam("userId") @ExistUser Long userId, + @AuthUser UserDto.AuthUserDto userDto, @RequestBody CommentRequestDto.DiscountInfoCommentRequestDto discountInfoCommentRequestDto){ - CommentResponseDto.DiscountInfoCommentResponseDto dto = discountCommentService.saveComment(userId, discountInfoCommentRequestDto); + CommentResponseDto.DiscountInfoCommentResponseDto dto = discountCommentService.saveComment(userDto.getId(), discountInfoCommentRequestDto); return ApiResponse.onSuccess(dto); } @@ -54,9 +55,9 @@ public ApiResponse> find @PostMapping("/supports/comments") public ApiResponse saveSupportInfoComment( - @RequestParam("userId") @ExistUser Long userId, + @AuthUser UserDto.AuthUserDto userDto, @RequestBody CommentRequestDto.SupportInfoCommentRequestDto supportInfoCommentRequestDto){ - CommentResponseDto.SupportInfoCommentResponseDto dto = supportCommentService.saveComment(userId, supportInfoCommentRequestDto); + CommentResponseDto.SupportInfoCommentResponseDto dto = supportCommentService.saveComment(userDto.getId(), supportInfoCommentRequestDto); return ApiResponse.onSuccess(dto); }