From 3a59994e761bfe18b6a69225c8f34d6ff33c8e41 Mon Sep 17 00:00:00 2001 From: taejin1221 Date: Mon, 2 Sep 2024 15:22:45 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20/api/auth/member=20API=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20DTO=20=EB=82=B4=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 Related to: #2 --- .../domain/dto/request/MemberInfoUpdateRequest.java | 13 +++++++++++++ .../dto/request/MemberIntroduceUpdateRequest.java | 8 ++++++++ .../domain/dto/response/MemberInfoResponse.java | 8 ++++++++ .../dto/response/MemberIntroduceResponse.java | 5 +++++ .../domain/dto/response/MemberListResponse.java | 11 +++++++++++ .../kaboo_auth/domain/dto/response/ResponseDTO.java | 6 ++++++ 6 files changed, 51 insertions(+) create mode 100644 src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberInfoUpdateRequest.java create mode 100644 src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberIntroduceUpdateRequest.java diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberInfoUpdateRequest.java b/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberInfoUpdateRequest.java new file mode 100644 index 0000000..53ab147 --- /dev/null +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberInfoUpdateRequest.java @@ -0,0 +1,13 @@ +package kaboo.kaboo_auth.domain.dto.request; + +import kaboo.kaboo_auth.domain.Course; +import lombok.Getter; + +@Getter +public class MemberInfoUpdateRequest { + private String koreaName; + private String englishName; + private int classNum; + private Course course; + +} diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberIntroduceUpdateRequest.java b/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberIntroduceUpdateRequest.java new file mode 100644 index 0000000..5720aa7 --- /dev/null +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/request/MemberIntroduceUpdateRequest.java @@ -0,0 +1,8 @@ +package kaboo.kaboo_auth.domain.dto.request; + +import lombok.Getter; + +@Getter +public class MemberIntroduceUpdateRequest { + String introduce; +} diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberInfoResponse.java b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberInfoResponse.java index 474b47d..5942314 100644 --- a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberInfoResponse.java +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberInfoResponse.java @@ -1,6 +1,7 @@ package kaboo.kaboo_auth.domain.dto.response; import kaboo.kaboo_auth.domain.Course; +import kaboo.kaboo_auth.domain.entity.Member; import lombok.AllArgsConstructor; import lombok.Getter; @@ -11,4 +12,11 @@ public class MemberInfoResponse { private String englishName; private int classNum; private Course course; + + public MemberInfoResponse(Member member) { + this.koreaName = member.getKoreaName(); + this.englishName = member.getEnglishName(); + this.classNum = member.getClassNum(); + this.course = member.getCourse(); + } } diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberIntroduceResponse.java b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberIntroduceResponse.java index bc91986..ff2af79 100644 --- a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberIntroduceResponse.java +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberIntroduceResponse.java @@ -1,5 +1,6 @@ package kaboo.kaboo_auth.domain.dto.response; +import kaboo.kaboo_auth.domain.entity.Member; import lombok.AllArgsConstructor; import lombok.Getter; @@ -7,4 +8,8 @@ @AllArgsConstructor public class MemberIntroduceResponse { private String introduce; + + public MemberIntroduceResponse(Member member) { + this.introduce = member.getIntroduce(); + } } diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberListResponse.java b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberListResponse.java index 48fff0f..0612e2d 100644 --- a/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberListResponse.java +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/response/MemberListResponse.java @@ -1,5 +1,8 @@ package kaboo.kaboo_auth.domain.dto.response; +import java.util.List; + +import kaboo.kaboo_auth.domain.entity.Member; import lombok.AllArgsConstructor; import lombok.Getter; @@ -9,4 +12,12 @@ public class MemberListResponse { private int classNum; private int memberNum; private MemberInfoResponse[] memberList; + + public MemberListResponse(List members, int classNum) { + this.classNum = classNum; + this.memberNum = members.size(); + this.memberList = members.stream() + .map(MemberInfoResponse::new) + .toArray(MemberInfoResponse[]::new); + } } diff --git a/src/main/java/kaboo/kaboo_auth/domain/dto/response/ResponseDTO.java b/src/main/java/kaboo/kaboo_auth/domain/dto/response/ResponseDTO.java index 6190dd1..a292021 100644 --- a/src/main/java/kaboo/kaboo_auth/domain/dto/response/ResponseDTO.java +++ b/src/main/java/kaboo/kaboo_auth/domain/dto/response/ResponseDTO.java @@ -9,4 +9,10 @@ public class ResponseDTO { private boolean success; private String message; private T data; + + public ResponseDTO(T data) { + success = true; + message = "요청이 성공적으로 처리되었습니다."; + this.data = data; + } }