From 94defe5a4c4800d50245f5041b9efbb5153cf99f Mon Sep 17 00:00:00 2001 From: Donghun Won Date: Tue, 22 Oct 2024 11:16:53 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20CreatedDate=20=EC=82=AD=EC=A0=9C,=20v?= =?UTF-8?q?alidation=20=EC=98=88=EC=99=B8=20=EC=B2=98=EB=A6=AC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InformationCommentController.java | 6 +++++- .../information_comment/entity/InformationComment.java | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/solitour_backend/solitour/information_comment/controller/InformationCommentController.java b/src/main/java/solitour_backend/solitour/information_comment/controller/InformationCommentController.java index be6163b..b66d01d 100644 --- a/src/main/java/solitour_backend/solitour/information_comment/controller/InformationCommentController.java +++ b/src/main/java/solitour_backend/solitour/information_comment/controller/InformationCommentController.java @@ -8,9 +8,11 @@ import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import solitour_backend.solitour.auth.config.Authenticated; import solitour_backend.solitour.auth.config.AuthenticationPrincipal; +import solitour_backend.solitour.error.Utils; import solitour_backend.solitour.information_comment.dto.request.InformationCommentRequest; import solitour_backend.solitour.information_comment.dto.respose.InformationCommentListResponse; import solitour_backend.solitour.information_comment.dto.respose.InformationCommentResponse; @@ -28,7 +30,9 @@ public class InformationCommentController { @PostMapping("/{informationId}") public ResponseEntity createInformationComment(@AuthenticationPrincipal Long userId, @PathVariable Long informationId, - @Valid @RequestBody InformationCommentRequest informationCommentRequest) { + @Valid @RequestBody InformationCommentRequest informationCommentRequest, + BindingResult bindingResult) { + Utils.validationRequest(bindingResult); InformationCommentResponse informationCommentResponse = informationCommentService.createInformationComment(userId, informationId, informationCommentRequest); diff --git a/src/main/java/solitour_backend/solitour/information_comment/entity/InformationComment.java b/src/main/java/solitour_backend/solitour/information_comment/entity/InformationComment.java index caa4c96..fc2f15b 100644 --- a/src/main/java/solitour_backend/solitour/information_comment/entity/InformationComment.java +++ b/src/main/java/solitour_backend/solitour/information_comment/entity/InformationComment.java @@ -43,7 +43,6 @@ public class InformationComment { @Column(name = "information_comment_created_date") private LocalDateTime createdDate; - @CreatedDate @Column(name = "information_comment_updated_date") private LocalDateTime updatedDate;