Optimize: parameters - optimize verification

This commit is contained in:
2024-03-26 11:18:33 +08:00
parent d917818739
commit 2d2a6641fb
9 changed files with 7 additions and 12 deletions

View File

@@ -8,7 +8,6 @@ import top.fatweb.oxygen.api.annotation.BaseController
import top.fatweb.oxygen.api.annotation.Trim
import top.fatweb.oxygen.api.entity.common.ResponseCode
import top.fatweb.oxygen.api.entity.common.ResponseResult
import top.fatweb.oxygen.api.param.PageSortParam
import top.fatweb.oxygen.api.param.tool.ToolBaseAddParam
import top.fatweb.oxygen.api.param.tool.ToolBaseGetParam
import top.fatweb.oxygen.api.param.tool.ToolBaseUpdateParam

View File

@@ -2,7 +2,6 @@ package top.fatweb.oxygen.api.controller.tool
import io.swagger.v3.oas.annotations.Operation
import jakarta.validation.Valid
import jakarta.validation.constraints.NotNull
import org.springframework.web.bind.annotation.*
import top.fatweb.oxygen.api.annotation.BaseController
import top.fatweb.oxygen.api.annotation.Trim

View File

@@ -49,6 +49,6 @@ data class RegisterParam(
*/
@Schema(description = "密码", required = true)
@field:NotBlank(message = "Password can not be blank")
@field:Size(min = 10, max = 30, message = "Password must be 10-20 characters")
@field:Size(min = 10, max = 30, message = "Password must be 10-30 characters")
val password: String?
) : CaptchaCodeParam()

View File

@@ -32,6 +32,6 @@ data class RetrieveParam(
*/
@Schema(description = "新密码")
@field:NotBlank(message = "New password can not be blank")
@field:Size(min = 10, max = 30)
@field:Size(min = 10, max = 30, message = "New password must be 10-30 characters")
val password: String?
) : CaptchaCodeParam()

View File

@@ -2,7 +2,7 @@ package top.fatweb.oxygen.api.param.permission
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import top.fatweb.oxygen.api.annotation.Trim
/**
@@ -32,7 +32,7 @@ data class VerifyParam(
*/
@Trim
@Schema(description = "昵称", example = "QwQ")
@field:Pattern(regexp = "^.{3,20}$", message = "Nickname must be 3-20 characters")
@field:Size(min = 3, max = 20, message = "Nickname must be 3-20 characters")
var nickname: String?,
/**

View File

@@ -30,6 +30,6 @@ data class UserChangePasswordParam(
*/
@Schema(description = "原密码", required = true)
@field:NotBlank(message = "New password can not be blank")
@field:Size(min = 10, max = 30, message = "New password must be 10-20 characters")
@field:Size(min = 10, max = 30, message = "New password must be 10-30 characters")
val newPassword: String?
)

View File

@@ -32,6 +32,6 @@ data class UserInfoUpdateParam(
@Trim
@Schema(description = "昵称", example = "QwQ")
@field:NotBlank(message = "Nickname can not be blank")
@field:Size(min = 3, max = 30, message = "Nickname must be 3-20 characters")
@field:Size(min = 3, max = 20, message = "Nickname must be 3-20 characters")
var nickname: String?
)

View File

@@ -21,6 +21,6 @@ data class MailSendParam(
*/
@Trim
@Schema(description = "接收者", required = true, example = "user@email.com")
@field:NotBlank
@field:NotBlank(message = "Receiver cannot be blank")
var to: String?
)