|
|
@@ -12,25 +12,33 @@ import jakarta.validation.constraints.Size;
|
|
|
* @date:2026/3/31 20:42
|
|
|
* @description:
|
|
|
*/
|
|
|
-@Schema(description = "用户新增和修改使用的DTO")
|
|
|
+@Schema(
|
|
|
+ description = "用户新增和修改使用的DTO",
|
|
|
+ requiredProperties = {
|
|
|
+ "account",
|
|
|
+ "password",
|
|
|
+ "username",
|
|
|
+ "role"
|
|
|
+ }
|
|
|
+)
|
|
|
public class UserDto {
|
|
|
@Schema(description = "用户ID")
|
|
|
private String id;
|
|
|
@NotBlank(message = "用户账号不能为空")
|
|
|
@Size(min = 4,max = 20,message = "用户账号长度不能小于4且不能大于20")
|
|
|
- @Schema(description = "用户账号")
|
|
|
+ @Schema(description = "用户账号",minLength = 4,maxLength = 20)
|
|
|
private String account;
|
|
|
@NotBlank(message = "用户密码不能为空")
|
|
|
@Size(min = 4,max = 20,message = "用户密码长度不能小于4且不能大于20")
|
|
|
- @Schema(description = "用户密码")
|
|
|
+ @Schema(description = "用户密码",minLength = 4,maxLength = 20)
|
|
|
private String password;
|
|
|
@NotBlank(message = "用户名称不能为空")
|
|
|
@Size(min = 2,max = 32,message = "用户名称长度不能小于2且不能大于32")
|
|
|
- @Schema(description = "用户名称")
|
|
|
+ @Schema(description = "用户名称",minLength = 2,maxLength = 32)
|
|
|
private String username;
|
|
|
@NotBlank(message = "用户角色不能为空")
|
|
|
@Size(min = 4,max = 32,message = "用户角色长度不能小于4且不能大于32")
|
|
|
- @Schema(description = "用户角色")
|
|
|
+ @Schema(description = "用户角色",minLength = 4,maxLength = 32)
|
|
|
private String role;
|
|
|
|
|
|
public String getId() {
|