Skip to content

Commit

Permalink
chore: (#261) validation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
softpeanut committed Dec 30, 2022
1 parent 7acb34a commit 8ca4c39
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class NotificationWebAdapter(
@PostMapping
fun sendNotification(@RequestBody @Valid request: SendNotificationWebRequest) {
sendNotificationUseCase.execute(
userId = request.userId,
title = request.title,
content = request.content,
type = request.type.name,
userId = request.userId!!,
title = request.title!!,
content = request.content!!,
type = request.type!!.name,
identify = request.identify
)
}
Expand All @@ -38,9 +38,9 @@ class NotificationWebAdapter(
fun sendMultiNotification(@RequestBody @Valid request: SendMultiNotificationWebRequest) {
sendNotificationUseCase.execute(
userIds = request.userIds,
title = request.title,
content = request.content,
type = request.type.name,
title = request.title!!,
content = request.content!!,
type = request.type!!.name,
identify = request.identify
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package team.comit.simtong.domain.notification.dto

import java.util.UUID
import javax.validation.constraints.NotBlank
import javax.validation.constraints.NotNull

/**
*
Expand All @@ -11,10 +13,19 @@ import java.util.UUID
* @version 1.1.0
**/
data class SendNotificationWebRequest(
val userId: UUID,
val title: String,
val content: String,
val type: WebNotificationType,

@field:NotNull
val userId: UUID?,

@field:NotBlank
val title: String?,

@field:NotBlank
val content: String?,

@field:NotNull
val type: WebNotificationType?,

val identify: UUID?
)

Expand All @@ -28,8 +39,15 @@ data class SendNotificationWebRequest(
**/
data class SendMultiNotificationWebRequest(
val userIds: List<UUID>,
val title: String,
val content: String,
val type: WebNotificationType,

@field:NotBlank
val title: String?,

@field:NotBlank
val content: String?,

@field:NotNull
val type: WebNotificationType?,

val identify: UUID?
)

0 comments on commit 8ca4c39

Please sign in to comment.