Files
springboot-template/src/main/java/com/aisi/template/domain/dto/UserDto.java
shenjianZ 40c85c3c1f feat: 实现完整的 RBAC 权限管理系统与基础设施增强
在初始认证基础上,新增完整的 RBAC 权限模型(角色、权限、菜单三级管理),
  集成审计日志、接口限流、登录失败锁定、Refresh Token 机制、Redis 分布式缓存与锁、
  RocketMQ 消息队列,并引入 Flyway 数据库版本管理,同时补充项目文档与使用示例
2026-04-10 10:58:22 +08:00

60 lines
1.6 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.aisi.template.domain.dto;
import com.aisi.template.annotation.StrongPassword;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
/**
* 用户数据传输对象
* 用于用户注册和登录请求
*
* 验证规则:
* - 用户名2-50 位字符,不能为空
* - 密码:不能为空,需满足强密码要求(@StrongPassword
* - 邮箱:可选,注册时建议提供
*
* 使用场景:
* - 用户注册:需要用户名、密码、邮箱
* - 用户登录:需要用户名、密码
*
* @author Claude
* @since 2024-04-09
*/
@Data
@Schema(description = "用户注册/登录请求")
public class UserDto {
/**
* 用户名
* - 长度2-50 位字符
* - 不能为空
* - 示例admin, user01
*/
@NotBlank(message = "用户名不能为空")
@Size(min = 2, max = 50, message = "用户名长度必须在 2-50 位之间")
@Schema(description = "用户名", example = "admin")
private String username;
/**
* 密码
* - 不能为空
* - 需满足强密码要求:包含大小写字母、数字、特殊字符
* - 示例Password123!
*/
@NotBlank(message = "密码不能为空")
@StrongPassword
@Schema(description = "密码", example = "Password123!")
private String password;
/**
* 邮箱地址
* - 可选字段
* - 注册时建议提供,用于找回密码
* - 示例user@example.com
*/
@Schema(description = "邮箱(注册时可选)", example = "user@example.com")
private String email;
}