From f02842412d0a92880427682828f7234f52134d67 Mon Sep 17 00:00:00 2001 From: bo Date: Tue, 30 Apr 2024 10:22:44 +0900 Subject: [PATCH] =?UTF-8?q?fix(article):=20UpdateRequest=20=EB=82=B4?= =?UTF-8?q?=EC=9A=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/dto/ArticleUpdateRequest.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/main-server/src/main/java/com/sickgyun/server/article/presentation/dto/ArticleUpdateRequest.java b/main-server/src/main/java/com/sickgyun/server/article/presentation/dto/ArticleUpdateRequest.java index 6a81b6b..ffc071c 100644 --- a/main-server/src/main/java/com/sickgyun/server/article/presentation/dto/ArticleUpdateRequest.java +++ b/main-server/src/main/java/com/sickgyun/server/article/presentation/dto/ArticleUpdateRequest.java @@ -3,8 +3,22 @@ import com.sickgyun.server.article.domain.Article; import com.sickgyun.server.user.domain.User; -public record ArticleUpdateRequest() { +import jakarta.validation.constraints.NotNull; + +public record ArticleUpdateRequest( + @NotNull(message = "title은 필수 값입니다.") + String title, + @NotNull(message = "imgUrl은 필수 값입니다.") + String imgUrl, + @NotNull(message = "url은 필수 값입니다.") + String url +) { public Article toEntity(User currentUser) { - return null; + return new Article( + title, + imgUrl, + url, + currentUser + ); } }