From fa620cd2c35cdf0fa0b225293bfc9813dfd2765c Mon Sep 17 00:00:00 2001 From: pooreumjung Date: Fri, 29 May 2026 01:39:02 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EC=84=B8=EB=AA=A8=ED=94=BC?= =?UTF-8?q?=EB=93=9C=20=EC=83=9D=EC=84=B1=20=EC=9A=94=EC=B2=AD=20DTO=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/semofeed/dto/SemoFeedCreateRequest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/java/com/semosan/api/domain/semofeed/dto/SemoFeedCreateRequest.java diff --git a/src/main/java/com/semosan/api/domain/semofeed/dto/SemoFeedCreateRequest.java b/src/main/java/com/semosan/api/domain/semofeed/dto/SemoFeedCreateRequest.java new file mode 100644 index 0000000..19caebc --- /dev/null +++ b/src/main/java/com/semosan/api/domain/semofeed/dto/SemoFeedCreateRequest.java @@ -0,0 +1,13 @@ +package com.semosan.api.domain.semofeed.dto; + +import jakarta.validation.constraints.NotBlank; + +/** + * 세모피드 생성 요청 DTO. + * {@code @RequestBody String} 대신 사용하여 Jackson이 JSON 문자열의 따옴표를 올바르게 제거하도록 한다. + */ +public record SemoFeedCreateRequest( + @NotBlank(message = "imageUrl 은 필수입니다.") + String imageUrl +) { +} From 0f57a39fa93a254cfdf03c8bafcec5b13d7a9570 Mon Sep 17 00:00:00 2001 From: pooreumjung Date: Fri, 29 May 2026 01:40:15 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=84=B8=EB=AA=A8=ED=94=BC=EB=93=9C?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20=EC=9A=94=EC=B2=AD=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=EB=A5=BC=20DTO=EB=A1=9C=20=EA=B5=90=EC=B2=B4?= =?UTF-8?q?=ED=95=98=EC=97=AC=20image=5Furl=20=EB=94=B0=EC=98=B4=ED=91=9C?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/semofeed/controller/SemoFeedController.java | 6 ++++-- .../semofeed/controller/docs/SemoFeedControllerDocs.java | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.java b/src/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.java index ea9b0d2..68a279e 100644 --- a/src/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.java +++ b/src/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.java @@ -4,6 +4,7 @@ import com.semosan.api.common.response.PageResponse; import com.semosan.api.common.status.SuccessStatus; import com.semosan.api.domain.semofeed.controller.docs.SemoFeedControllerDocs; +import com.semosan.api.domain.semofeed.dto.SemoFeedCreateRequest; import com.semosan.api.domain.semofeed.dto.SemoFeedEmojiRequest; import com.semosan.api.domain.semofeed.dto.SemoFeedEmojiToggleResponse; import com.semosan.api.domain.semofeed.dto.SemoFeedResponse; @@ -30,11 +31,12 @@ public class SemoFeedController implements SemoFeedControllerDocs { @PostMapping @Override + // @RequestBody String 대신 DTO를 사용해 Jackson이 JSON 따옴표를 제거한 뒤 imageUrl을 전달합니다. public ResponseEntity> create( @AuthenticationPrincipal Long userId, - @RequestBody String imageUrl + @Valid @RequestBody SemoFeedCreateRequest request ) { - SemoFeedResponse response = semoFeedService.create(userId, imageUrl); + SemoFeedResponse response = semoFeedService.create(userId, request.imageUrl()); return ApiResponse.success(SuccessStatus.SEMOFEED_CREATE_SUCCESS, response); } diff --git a/src/main/java/com/semosan/api/domain/semofeed/controller/docs/SemoFeedControllerDocs.java b/src/main/java/com/semosan/api/domain/semofeed/controller/docs/SemoFeedControllerDocs.java index 60fb9ec..30e304f 100644 --- a/src/main/java/com/semosan/api/domain/semofeed/controller/docs/SemoFeedControllerDocs.java +++ b/src/main/java/com/semosan/api/domain/semofeed/controller/docs/SemoFeedControllerDocs.java @@ -2,6 +2,7 @@ import com.semosan.api.common.response.ApiResponse; import com.semosan.api.common.response.PageResponse; +import com.semosan.api.domain.semofeed.dto.SemoFeedCreateRequest; import com.semosan.api.domain.semofeed.dto.SemoFeedEmojiRequest; import com.semosan.api.domain.semofeed.dto.SemoFeedEmojiToggleResponse; import com.semosan.api.domain.semofeed.dto.SemoFeedResponse; @@ -42,7 +43,7 @@ public interface SemoFeedControllerDocs { }) ResponseEntity> create( @AuthenticationPrincipal Long userId, - @RequestBody String imageUrl + @RequestBody SemoFeedCreateRequest request ); @Operation(