From 64da600b9e31177ea7292e17c1c7d858916bcbcd Mon Sep 17 00:00:00 2001 From: dl-00-e8 Date: Fri, 10 Feb 2023 01:30:08 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20=EA=B2=80=EC=83=89=20Response=20DTO=20?= =?UTF-8?q?#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/search/dto/response/PostArticleRes.java | 10 ++++++++++ .../api/search/dto/response/PostEditorRes.java | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java index b1cc746..2858894 100644 --- a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java +++ b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java @@ -1,7 +1,17 @@ package com.mews.mews_backend.api.search.dto.response; +import com.mews.mews_backend.domain.article.entity.Article; import lombok.Getter; @Getter public class PostArticleRes { + + private Integer id; + + private String title; + + public PostArticleRes(Article article) { + this.id = article.getArticle_id(); + this.title = article.getTitle(); + } } diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java index 26c219c..c8b982e 100644 --- a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java +++ b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java @@ -1,7 +1,21 @@ package com.mews.mews_backend.api.search.dto.response; +import com.mews.mews_backend.domain.editor.entity.Editor; import lombok.Getter; @Getter public class PostEditorRes { + + private Integer id; + + private String name; + + private String imgUrl; + + //Entity to DTO + public PostEditorRes(Editor editor) { + this.id = editor.getId(); + this.name = editor.getName(); + this.imgUrl = editor.getImgUrl(); + } }