-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from soma-baekgu/feature/BG-416-retrieve-task…
…-event [BG-416]: 태스크 이벤트 상세조회 (1h / 1h)
- Loading branch information
Showing
5 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
api/src/main/kotlin/com/backgu/amaker/api/event/dto/TaskEventDetailDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.backgu.amaker.api.event.dto | ||
|
||
import com.backgu.amaker.api.user.dto.UserDto | ||
import com.backgu.amaker.domain.event.TaskEvent | ||
import java.time.LocalDateTime | ||
|
||
data class TaskEventDetailDto( | ||
val id: Long, | ||
val eventTitle: String, | ||
val eventDetails: String, | ||
val deadLine: LocalDateTime, | ||
val notificationStartTime: LocalDateTime, | ||
val notificationInterval: Int, | ||
val eventCreator: UserDto, | ||
val finishUser: List<UserDto>, | ||
val waitingUser: List<UserDto>, | ||
) { | ||
companion object { | ||
fun of( | ||
taskEvent: TaskEvent, | ||
eventCreator: UserDto, | ||
finishUser: List<UserDto>, | ||
waitingUser: List<UserDto>, | ||
) = TaskEventDetailDto( | ||
id = taskEvent.id, | ||
eventTitle = taskEvent.eventTitle, | ||
eventDetails = taskEvent.eventDetails, | ||
deadLine = taskEvent.deadLine, | ||
notificationStartTime = taskEvent.notificationStartTime, | ||
notificationInterval = taskEvent.notificationInterval, | ||
eventCreator = eventCreator, | ||
finishUser = finishUser, | ||
waitingUser = waitingUser, | ||
) | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
api/src/main/kotlin/com/backgu/amaker/api/event/dto/response/TaskEventDetailResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.backgu.amaker.api.event.dto.response | ||
|
||
import com.backgu.amaker.api.event.dto.TaskEventDetailDto | ||
import com.backgu.amaker.api.user.dto.response.UserResponse | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
import java.time.LocalDateTime | ||
|
||
data class TaskEventDetailResponse( | ||
@Schema(description = "이벤트 id", example = "1") | ||
val id: Long, | ||
@Schema(description = "이벤트 제목", example = "우리 어디서 만날지") | ||
val eventTitle: String, | ||
@Schema(description = "이벤트 디테일 한 정보", example = "우리 어디서 만날지 정해봅시다") | ||
val eventDetails: String, | ||
@Schema(description = "데드라인", example = "2024-07-24T07:39:37.598") | ||
val deadLine: LocalDateTime, | ||
@Schema(description = "알림 보낼 시작 시간", example = "2024-07-24T06:09:37.598") | ||
val notificationStartTime: LocalDateTime, | ||
@Schema(description = "알림 주기", example = "15") | ||
val notificationInterval: Int, | ||
@Schema(description = "이벤트 생성자") | ||
val eventCreator: UserResponse, | ||
@Schema(description = "이벤트를 수행한 유저") | ||
val finishUser: List<UserResponse>, | ||
@Schema(description = "이벤트 수행 대기중인 유저") | ||
val waitingUser: List<UserResponse>, | ||
) { | ||
companion object { | ||
fun of(taskEventDetailDto: TaskEventDetailDto) = | ||
TaskEventDetailResponse( | ||
id = taskEventDetailDto.id, | ||
eventTitle = taskEventDetailDto.eventTitle, | ||
eventDetails = taskEventDetailDto.eventDetails, | ||
deadLine = taskEventDetailDto.deadLine, | ||
notificationStartTime = taskEventDetailDto.notificationStartTime, | ||
notificationInterval = taskEventDetailDto.notificationInterval, | ||
eventCreator = UserResponse.of(taskEventDetailDto.eventCreator), | ||
finishUser = taskEventDetailDto.finishUser.map { UserResponse.of(it) }, | ||
waitingUser = taskEventDetailDto.waitingUser.map { UserResponse.of(it) }, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters