Skip to content

Commit

Permalink
refactor: Validated 어노테이션 추가 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonbinn committed Dec 28, 2023
1 parent a638ca3 commit 1c14c92
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down Expand Up @@ -49,7 +50,7 @@ public class CommentApiController {
schema = @Schema(implementation = ErrorType.class)))
})
@PostMapping("/post/{postId}/comments")
public SuccessResponse<Long> register(final @PathVariable Long postId, final @RequestBody CommentCreateRequest commentCreateRequest) {
public SuccessResponse<Long> register(final @PathVariable @Validated Long postId, final @RequestBody CommentCreateRequest commentCreateRequest) {
Long createdCommentId = commentService.register(postId, commentCreateRequest);
return new SuccessResponse<>(createdCommentId);
}
Expand Down

0 comments on commit 1c14c92

Please sign in to comment.