From a3f5deedacb9300603e98c6d4b0ffdfa4cd787ab Mon Sep 17 00:00:00 2001 From: OJOJIN Date: Fri, 12 Jan 2024 15:47:23 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#37=20Post=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EB=AC=BC=20=EB=AA=A8=EC=A7=91=20=EC=83=81=ED=83=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20dto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/PostStateUpdateRequestDto.java | 9 +++++++++ .../response/PostStateUpdateResponseDto.java | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/main/java/org/gachon/checkmate/domain/post/dto/request/PostStateUpdateRequestDto.java create mode 100644 src/main/java/org/gachon/checkmate/domain/post/dto/response/PostStateUpdateResponseDto.java diff --git a/src/main/java/org/gachon/checkmate/domain/post/dto/request/PostStateUpdateRequestDto.java b/src/main/java/org/gachon/checkmate/domain/post/dto/request/PostStateUpdateRequestDto.java new file mode 100644 index 0000000..7664380 --- /dev/null +++ b/src/main/java/org/gachon/checkmate/domain/post/dto/request/PostStateUpdateRequestDto.java @@ -0,0 +1,9 @@ +package org.gachon.checkmate.domain.post.dto.request; + +import jakarta.validation.constraints.NotNull; +import org.gachon.checkmate.domain.post.entity.PostState; + +public record PostStateUpdateRequestDto( + @NotNull(message = "게시글 상태를 입력해주세요") PostState postState +) { +} diff --git a/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostStateUpdateResponseDto.java b/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostStateUpdateResponseDto.java new file mode 100644 index 0000000..8e22647 --- /dev/null +++ b/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostStateUpdateResponseDto.java @@ -0,0 +1,17 @@ +package org.gachon.checkmate.domain.post.dto.response; + +import lombok.Builder; +import org.gachon.checkmate.domain.post.entity.Post; + +@Builder +public record PostStateUpdateResponseDto ( + Long postId, + String postState +) { + public static PostStateUpdateResponseDto of(Post post) { + return PostStateUpdateResponseDto.builder() + .postId(post.getId()) + .postState(post.getPostState().getDesc()) + .build(); + } +}