diff --git a/src/main/kotlin/top/fatweb/oxygen/api/param/system/MailSettingsParam.kt b/src/main/kotlin/top/fatweb/oxygen/api/param/system/MailSettingsParam.kt index 8e5cec5..61284fd 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/param/system/MailSettingsParam.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/param/system/MailSettingsParam.kt @@ -40,7 +40,7 @@ data class MailSettingsParam( * @since 1.0.0 */ @Schema(description = "安全类型", allowableValues = ["None", "SSL/TLS", "StartTls"], defaultValue = "None") - val securityType: MailSecurityType? = MailSecurityType.NONE, + val securityType: MailSecurityType = MailSecurityType.NONE, /** * Username diff --git a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolBaseUpdateParam.kt b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolBaseUpdateParam.kt index fd5ef0b..b798fc2 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolBaseUpdateParam.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolBaseUpdateParam.kt @@ -2,6 +2,7 @@ package top.fatweb.oxygen.api.param.tool import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern import top.fatweb.oxygen.api.annotation.Trim /** @@ -30,6 +31,7 @@ data class ToolBaseUpdateParam( */ @Trim @Schema(description = "名称") + @field: Pattern(regexp = "^.*\\S.*$", message = "Name can not be blank") var name: String?, /** @@ -39,6 +41,7 @@ data class ToolBaseUpdateParam( * @since 1.0.0 */ @Schema(description = "源码") + @field: Pattern(regexp = "^.*\\S.*$", message = "Source can not be blank") val source: String?, /** @@ -48,5 +51,6 @@ data class ToolBaseUpdateParam( * @since 1.0.0 */ @Schema(description = "产物") + @field: Pattern(regexp = "^.*\\S.*$", message = "Dist can not be blank") val dist: String? ) diff --git a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolCategoryUpdateParam.kt b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolCategoryUpdateParam.kt index 00fc869..72c63b2 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolCategoryUpdateParam.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolCategoryUpdateParam.kt @@ -2,6 +2,7 @@ package top.fatweb.oxygen.api.param.tool import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern import top.fatweb.oxygen.api.annotation.Trim /** @@ -30,6 +31,7 @@ data class ToolCategoryUpdateParam( */ @Trim @Schema(description = "名称") + @field: Pattern(regexp = "^.*\\S.*$", message = "Name can not be blank") var name: String?, /** diff --git a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolTemplateUpdateParam.kt b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolTemplateUpdateParam.kt index 14ea57a..1f7c232 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolTemplateUpdateParam.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolTemplateUpdateParam.kt @@ -2,6 +2,7 @@ package top.fatweb.oxygen.api.param.tool import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern import top.fatweb.oxygen.api.annotation.Trim /** @@ -30,6 +31,7 @@ data class ToolTemplateUpdateParam( */ @Trim @Schema(description = "名称") + @field: Pattern(regexp = "^.*\\S.*$", message = "Name can not be blank") var name: String?, /** @@ -39,6 +41,7 @@ data class ToolTemplateUpdateParam( * @since 1.0.0 */ @Schema(description = "源码") + @field: Pattern(regexp = "^.*\\S.*$", message = "Source can not be blank") val source: String?, /** @@ -49,6 +52,7 @@ data class ToolTemplateUpdateParam( */ @Trim @Schema(description = "入口文件") + @field: Pattern(regexp = "^.*\\S.*$", message = "Entry point can not be blank") var entryPoint: String?, /** diff --git a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolUpdateParam.kt b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolUpdateParam.kt index 90b4610..8e59883 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolUpdateParam.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/param/tool/ToolUpdateParam.kt @@ -2,6 +2,8 @@ package top.fatweb.oxygen.api.param.tool import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import top.fatweb.oxygen.api.annotation.Trim /** @@ -31,6 +33,7 @@ data class ToolUpdateParam( */ @Trim @Schema(description = "名称") + @field: Pattern(regexp = "^.*\\S.*$", message = "Name can not be blank") var name: String?, /** @@ -40,6 +43,7 @@ data class ToolUpdateParam( * @since 1.0.0 */ @Schema(description = "图标") + @field: Pattern(regexp = "^.*\\S.*$", message = "Icon can not be blank") val icon: String?, /** @@ -58,6 +62,7 @@ data class ToolUpdateParam( * @since 1.0.0 */ @Schema(description = "关键词") + @field:Size(min = 1, message = "Keywords can not be empty") val keywords: List?, /** @@ -67,6 +72,7 @@ data class ToolUpdateParam( * @since 1.0.0 */ @Schema(description = "类别") + @field:Size(min = 1, message = "Categories can not be empty") val categories: List?, /** @@ -76,5 +82,6 @@ data class ToolUpdateParam( * @since 1.0.0 */ @Schema(description = "源码") + @field: Pattern(regexp = "^.*\\S.*$", message = "Source can not be blank") val source: String? )