-
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 #112 from soma-baekgu/develop
V1.3 배포
- Loading branch information
Showing
41 changed files
with
984 additions
and
74 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
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
13 changes: 13 additions & 0 deletions
13
api/src/main/kotlin/com/backgu/amaker/api/event/dto/ReactionEventCreateDto.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,13 @@ | ||
package com.backgu.amaker.api.event.dto | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class ReactionEventCreateDto( | ||
val eventTitle: String, | ||
val options: List<String>, | ||
val assignees: List<String>, | ||
val deadLine: LocalDateTime, | ||
val notificationStartHour: Int, | ||
val notificationStartMinute: Int, | ||
val interval: Int, | ||
) |
38 changes: 38 additions & 0 deletions
38
api/src/main/kotlin/com/backgu/amaker/api/event/dto/ReactionEventDetailDto.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,38 @@ | ||
package com.backgu.amaker.api.event.dto | ||
|
||
import com.backgu.amaker.api.user.dto.UserDto | ||
import com.backgu.amaker.domain.event.ReactionEvent | ||
import com.backgu.amaker.domain.event.ReactionOption | ||
import java.time.LocalDateTime | ||
|
||
data class ReactionEventDetailDto( | ||
val id: Long, | ||
val eventTitle: String, | ||
val options: List<ReactionOptionDto>, | ||
val deadLine: LocalDateTime, | ||
val notificationStartTime: LocalDateTime, | ||
val notificationInterval: Int, | ||
val eventCreator: UserDto, | ||
val finishUser: List<UserDto>, | ||
val waitingUser: List<UserDto>, | ||
) { | ||
companion object { | ||
fun of( | ||
reactionEvent: ReactionEvent, | ||
reactionOptions: List<ReactionOption>, | ||
eventCreator: UserDto, | ||
finishUser: List<UserDto>, | ||
waitingUser: List<UserDto>, | ||
) = ReactionEventDetailDto( | ||
id = reactionEvent.id, | ||
eventTitle = reactionEvent.eventTitle, | ||
options = reactionOptions.map { ReactionOptionDto.of(it) }, | ||
deadLine = reactionEvent.deadLine, | ||
notificationStartTime = reactionEvent.notificationStartTime, | ||
notificationInterval = reactionEvent.notificationInterval, | ||
eventCreator = eventCreator, | ||
finishUser = finishUser, | ||
waitingUser = waitingUser, | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
api/src/main/kotlin/com/backgu/amaker/api/event/dto/ReactionEventDto.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,28 @@ | ||
package com.backgu.amaker.api.event.dto | ||
|
||
import com.backgu.amaker.domain.event.ReactionEvent | ||
import com.backgu.amaker.domain.event.ReactionOption | ||
import java.time.LocalDateTime | ||
|
||
data class ReactionEventDto( | ||
val id: Long, | ||
val eventTitle: String, | ||
val options: List<String>, | ||
val deadLine: LocalDateTime, | ||
val notificationStartTime: LocalDateTime, | ||
val notificationInterval: Int, | ||
) { | ||
companion object { | ||
fun of( | ||
reactionEvent: ReactionEvent, | ||
options: List<ReactionOption>, | ||
) = ReactionEventDto( | ||
id = reactionEvent.id, | ||
eventTitle = reactionEvent.eventTitle, | ||
options = options.map { it.content }, | ||
deadLine = reactionEvent.deadLine, | ||
notificationStartTime = reactionEvent.notificationStartTime, | ||
notificationInterval = reactionEvent.notificationInterval, | ||
) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
api/src/main/kotlin/com/backgu/amaker/api/event/dto/ReactionOptionDto.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,18 @@ | ||
package com.backgu.amaker.api.event.dto | ||
|
||
import com.backgu.amaker.domain.event.ReactionOption | ||
|
||
data class ReactionOptionDto( | ||
val id: Long, | ||
val eventId: Long, | ||
val content: String, | ||
) { | ||
companion object { | ||
fun of(reactionOption: ReactionOption) = | ||
ReactionOptionDto( | ||
id = reactionOption.id, | ||
eventId = reactionOption.eventId, | ||
content = reactionOption.content, | ||
) | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
api/src/main/kotlin/com/backgu/amaker/api/event/dto/request/ReactionEventCreateRequest.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,39 @@ | ||
package com.backgu.amaker.api.event.dto.request | ||
|
||
import com.backgu.amaker.api.event.dto.ReactionEventCreateDto | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
import jakarta.validation.constraints.NotBlank | ||
import jakarta.validation.constraints.Size | ||
import org.springframework.format.annotation.DateTimeFormat | ||
import java.time.LocalDateTime | ||
|
||
data class ReactionEventCreateRequest( | ||
@Schema(description = "제목", example = "제목 어때요?") | ||
@field:NotBlank(message = "이벤트 제목을 입력해주세요.") | ||
val eventTitle: String, | ||
@Schema(description = "선택지", example = "[\"예\", \"아니오\"]") | ||
val options: List<String>, | ||
@Schema(description = "답변을 요청할 인원", example = "[\"user1\", \"user2\"]") | ||
@field:Size(min = 1, message = "최소 한 명 이상의 인원을 지정해야 합니다.") | ||
val assignees: List<String>, | ||
@Schema(description = "마감 기한", example = "2021-08-01T00:00:00") | ||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
val deadLine: LocalDateTime, | ||
@Schema(description = "알림 시작 시간", example = "1") | ||
val notificationStartHour: Int, | ||
@Schema(description = "알림 시작 분", example = "30") | ||
val notificationStartMinute: Int, | ||
@Schema(description = "알림 주기", example = "15") | ||
val interval: Int, | ||
) { | ||
fun toDto() = | ||
ReactionEventCreateDto( | ||
eventTitle = eventTitle, | ||
options = options, | ||
assignees = assignees, | ||
deadLine = deadLine, | ||
notificationStartMinute = notificationStartMinute, | ||
notificationStartHour = notificationStartHour, | ||
interval = interval, | ||
) | ||
} |
Oops, something went wrong.