Optimize: parameters - optimize verification #18

Merged
FatttSnake merged 1 commits from FatttSnake into dev 2024-03-26 11:45:34 +08:00
9 changed files with 7 additions and 12 deletions
Showing only changes of commit 2d2a6641fb - Show all commits

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.annotation.Trim
import top.fatweb.oxygen.api.entity.common.ResponseCode import top.fatweb.oxygen.api.entity.common.ResponseCode
import top.fatweb.oxygen.api.entity.common.ResponseResult 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.ToolBaseAddParam
import top.fatweb.oxygen.api.param.tool.ToolBaseGetParam import top.fatweb.oxygen.api.param.tool.ToolBaseGetParam
import top.fatweb.oxygen.api.param.tool.ToolBaseUpdateParam 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 io.swagger.v3.oas.annotations.Operation
import jakarta.validation.Valid import jakarta.validation.Valid
import jakarta.validation.constraints.NotNull
import org.springframework.web.bind.annotation.* import org.springframework.web.bind.annotation.*
import top.fatweb.oxygen.api.annotation.BaseController import top.fatweb.oxygen.api.annotation.BaseController
import top.fatweb.oxygen.api.annotation.Trim import top.fatweb.oxygen.api.annotation.Trim

View File

@@ -49,6 +49,6 @@ data class RegisterParam(
*/ */
@Schema(description = "密码", required = true) @Schema(description = "密码", required = true)
@field:NotBlank(message = "Password can not be blank") @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? val password: String?
) : CaptchaCodeParam() ) : CaptchaCodeParam()

View File

@@ -32,6 +32,6 @@ data class RetrieveParam(
*/ */
@Schema(description = "新密码") @Schema(description = "新密码")
@field:NotBlank(message = "New password can not be blank") @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? val password: String?
) : CaptchaCodeParam() ) : CaptchaCodeParam()

View File

@@ -2,7 +2,7 @@ package top.fatweb.oxygen.api.param.permission
import io.swagger.v3.oas.annotations.media.Schema import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Pattern import jakarta.validation.constraints.Size
import top.fatweb.oxygen.api.annotation.Trim import top.fatweb.oxygen.api.annotation.Trim
/** /**
@@ -32,7 +32,7 @@ data class VerifyParam(
*/ */
@Trim @Trim
@Schema(description = "昵称", example = "QwQ") @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?, var nickname: String?,
/** /**

View File

@@ -30,6 +30,6 @@ data class UserChangePasswordParam(
*/ */
@Schema(description = "原密码", required = true) @Schema(description = "原密码", required = true)
@field:NotBlank(message = "New password can not be blank") @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? val newPassword: String?
) )

View File

@@ -32,6 +32,6 @@ data class UserInfoUpdateParam(
@Trim @Trim
@Schema(description = "昵称", example = "QwQ") @Schema(description = "昵称", example = "QwQ")
@field:NotBlank(message = "Nickname can not be blank") @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? var nickname: String?
) )

View File

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

View File

@@ -62,8 +62,5 @@ logging:
# max-file-size: 10MB # Maximum log file size # max-file-size: 10MB # Maximum log file size
# max-history: 7 # Maximum number of archive log files to keep # max-history: 7 # Maximum number of archive log files to keep
mybatis-plus:
type-aliases-package: top.fatweb.oxygen.api.entity
knife4j: knife4j:
production: true # Production environment mode will block doc production: true # Production environment mode will block doc