|
| 1 | +package com.backgu.amaker.api.event.dto.response |
| 2 | + |
| 3 | +import com.backgu.amaker.api.event.dto.TaskEventDetailDto |
| 4 | +import com.backgu.amaker.api.user.dto.response.UserResponse |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema |
| 6 | +import java.time.LocalDateTime |
| 7 | + |
| 8 | +data class TaskEventDetailResponse( |
| 9 | + @Schema(description = "이벤트 id", example = "1") |
| 10 | + val id: Long, |
| 11 | + @Schema(description = "이벤트 제목", example = "우리 어디서 만날지") |
| 12 | + val eventTitle: String, |
| 13 | + @Schema(description = "이벤트 디테일 한 정보", example = "우리 어디서 만날지 정해봅시다") |
| 14 | + val eventDetails: String, |
| 15 | + @Schema(description = "데드라인", example = "2024-07-24T07:39:37.598") |
| 16 | + val deadLine: LocalDateTime, |
| 17 | + @Schema(description = "알림 보낼 시작 시간", example = "2024-07-24T06:09:37.598") |
| 18 | + val notificationStartTime: LocalDateTime, |
| 19 | + @Schema(description = "알림 주기", example = "15") |
| 20 | + val notificationInterval: Int, |
| 21 | + @Schema(description = "이벤트 생성자") |
| 22 | + val eventCreator: UserResponse, |
| 23 | + @Schema(description = "이벤트를 수행한 유저") |
| 24 | + val finishUser: List<UserResponse>, |
| 25 | + @Schema(description = "이벤트 수행 대기중인 유저") |
| 26 | + val waitingUser: List<UserResponse>, |
| 27 | +) { |
| 28 | + companion object { |
| 29 | + fun of(taskEventDetailDto: TaskEventDetailDto) = |
| 30 | + TaskEventDetailResponse( |
| 31 | + id = taskEventDetailDto.id, |
| 32 | + eventTitle = taskEventDetailDto.eventTitle, |
| 33 | + eventDetails = taskEventDetailDto.eventDetails, |
| 34 | + deadLine = taskEventDetailDto.deadLine, |
| 35 | + notificationStartTime = taskEventDetailDto.notificationStartTime, |
| 36 | + notificationInterval = taskEventDetailDto.notificationInterval, |
| 37 | + eventCreator = UserResponse.of(taskEventDetailDto.eventCreator), |
| 38 | + finishUser = taskEventDetailDto.finishUser.map { UserResponse.of(it) }, |
| 39 | + waitingUser = taskEventDetailDto.waitingUser.map { UserResponse.of(it) }, |
| 40 | + ) |
| 41 | + } |
| 42 | +} |
0 commit comments