Skip to content

Commit

Permalink
[refactor] UserId -> AuthUser 유저 받는 로직 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
wnd01jun committed Nov 28, 2024
1 parent d440dd2 commit 2e3fd21
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -36,9 +37,9 @@ public CommentController(CommentService<CommentRequestDto.DiscountInfoCommentReq

@PostMapping("/discounts/comments")
public ApiResponse<CommentResponseDto.DiscountInfoCommentResponseDto> 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);
}

Expand All @@ -54,9 +55,9 @@ public ApiResponse<Page<CommentResponseDto.DiscountInfoCommentResponseDto>> find

@PostMapping("/supports/comments")
public ApiResponse<CommentResponseDto.SupportInfoCommentResponseDto> 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);
}

Expand Down

0 comments on commit 2e3fd21

Please sign in to comment.