From 4e62421d9402b24cd0e8d370dd7f7dedad8db2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=AC=EC=9E=AC=EC=97=BD?= <jysim0326@ajou.ac.kr> Date: Tue, 19 Nov 2024 18:17:06 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=B2=88=EA=B0=9C=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=20=EC=A1=B0=ED=9A=8C,=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20dto=20=EC=B6=94=EA=B0=80=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dtos/MeetingDetailResponse.js | 20 ++++++++++++++++++++ dtos/MeetingResponse.js | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 dtos/MeetingDetailResponse.js create mode 100644 dtos/MeetingResponse.js diff --git a/dtos/MeetingDetailResponse.js b/dtos/MeetingDetailResponse.js new file mode 100644 index 0000000..6670fe4 --- /dev/null +++ b/dtos/MeetingDetailResponse.js @@ -0,0 +1,20 @@ +class MeetingDetailResponse { + constructor(meeting) { + this.id = meeting.id; + this.title = meeting.title; + this.description = meeting.description; + this.startTime = meeting.start_time; + this.endTime = meeting.end_time; + this.location = meeting.location; + this.deadline = meeting.deadline; + this.type = meeting.type; + this.creatorName = meeting.creator ? meeting.creator.name : 'Unknown'; + this.participants = meeting.participants.map(participant => ({ + userId: participant.user_id, + name: participant.participantUser ? participant.participantUser.name : 'Unknown', + email: participant.participantUser ? participant.participantUser.email : 'Unknown' + })); + } +} + +module.exports = MeetingDetailResponse; \ No newline at end of file diff --git a/dtos/MeetingResponse.js b/dtos/MeetingResponse.js new file mode 100644 index 0000000..8ee8b83 --- /dev/null +++ b/dtos/MeetingResponse.js @@ -0,0 +1,19 @@ +// dtos/MeetingResponse.js + +class MeetingResponse { + constructor(meeting, isParticipant, isScheduleConflict, creatorName) { + this.id = meeting.id; + this.title = meeting.title; + this.description = meeting.description; + this.startTime = meeting.start_time; + this.endTime = meeting.end_time; + this.location = meeting.location; + this.deadline = meeting.deadline; + this.type = meeting.type; + this.creatorName = creatorName; + this.isParticipant = isParticipant; + this.isScheduleConflict = isScheduleConflict; + } +} + +module.exports = MeetingResponse; \ No newline at end of file -- GitLab