Skip to content

Commit

Permalink
Feat: /api/auth/member API 관련 DTO 내용 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Taejin1221 committed Sep 2, 2024
1 parent 313acd8 commit 3a59994
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package kaboo.kaboo_auth.domain.dto.request;

import lombok.Getter;

@Getter
public class MemberIntroduceUpdateRequest {
String introduce;
}
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package kaboo.kaboo_auth.domain.dto.response;

import kaboo.kaboo_auth.domain.entity.Member;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class MemberIntroduceResponse {
private String introduce;

public MemberIntroduceResponse(Member member) {
this.introduce = member.getIntroduce();
}
}
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -9,4 +12,12 @@ public class MemberListResponse {
private int classNum;
private int memberNum;
private MemberInfoResponse[] memberList;

public MemberListResponse(List<Member> members, int classNum) {
this.classNum = classNum;
this.memberNum = members.size();
this.memberList = members.stream()
.map(MemberInfoResponse::new)
.toArray(MemberInfoResponse[]::new);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ public class ResponseDTO<T> {
private boolean success;
private String message;
private T data;

public ResponseDTO(T data) {
success = true;
message = "요청이 성공적으로 처리되었습니다.";
this.data = data;
}
}

0 comments on commit 3a59994

Please sign in to comment.