From e3f313b09a95b18c0bd7e21de9509ead23124fe5 Mon Sep 17 00:00:00 2001 From: Taeun Kim Date: Tue, 30 Nov 2021 13:29:00 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Response=20DTO=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #226 --- .../response/GroupBaseResponse.java | 14 ++++++-------- .../response/GroupReadAllResponse.java | 19 +++++++++++++++++++ .../response/GroupReadAllResponses.java | 14 ++++++++++++++ .../controller/response/GroupResponse.java | 7 ------- .../controller/response/GroupResponses.java | 11 ----------- 5 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponse.java create mode 100644 src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponses.java delete mode 100644 src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponse.java delete mode 100644 src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponses.java diff --git a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupBaseResponse.java b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupBaseResponse.java index 9a7797b9..3779ad4e 100644 --- a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupBaseResponse.java +++ b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupBaseResponse.java @@ -1,19 +1,17 @@ package com.postsquad.scoup.web.group.controller.response; -import com.postsquad.scoup.web.image.controller.ImageResponse; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@NoArgsConstructor +@AllArgsConstructor +@Data public class GroupBaseResponse { private Long id; - // TODO: 필요한지 확인 필요 - private ImageResponse image; - - // TODO: 필요한지 확인 필요 - private long memberCount; - private String name; private String description; - } diff --git a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponse.java b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponse.java new file mode 100644 index 00000000..202509ab --- /dev/null +++ b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponse.java @@ -0,0 +1,19 @@ +package com.postsquad.scoup.web.group.controller.response; + +import com.postsquad.scoup.web.group.domain.Group; +import lombok.*; + +@EqualsAndHashCode(callSuper = false) +@AllArgsConstructor +@Data +public class GroupReadAllResponse extends GroupBaseResponse { + + @Builder + protected GroupReadAllResponse(Long id, String name, String description) { + super(id, name, description); + } + + public static GroupReadAllResponse from(Group group) { + return new GroupReadAllResponse(group.getId(), group.getName(), group.getDescription()); + } +} diff --git a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponses.java b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponses.java new file mode 100644 index 00000000..a62da1e1 --- /dev/null +++ b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupReadAllResponses.java @@ -0,0 +1,14 @@ +package com.postsquad.scoup.web.group.controller.response; + +import lombok.*; + +import java.util.List; + +@NoArgsConstructor +@AllArgsConstructor(staticName = "from") +@Builder +@Data +public class GroupReadAllResponses { + + private List groupReadAllResponse; +} diff --git a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponse.java b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponse.java deleted file mode 100644 index 80b13dd2..00000000 --- a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.postsquad.scoup.web.group.controller.response; - -import lombok.Getter; - -@Getter -public class GroupResponse extends GroupBaseResponse { -} diff --git a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponses.java b/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponses.java deleted file mode 100644 index 9af9a304..00000000 --- a/src/main/java/com/postsquad/scoup/web/group/controller/response/GroupResponses.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.postsquad.scoup.web.group.controller.response; - -import lombok.Getter; - -import java.util.List; - -@Getter -public class GroupResponses { - - private List groupResponses; -}