content: package cn.edu.seig.vibemusic.model.dto;
  
  import cn.edu.seig.vibemusic.constant.MessageConstant;
  import jakarta.validation.constraints.Email;
  import jakarta.validation.constraints.NotBlank;
  import jakarta.validation.constraints.Pattern;
  import lombok.Data;
  
  import java.io.Serial;
  import java.io.Serializable;
  
  @Data
  public class UserResetPasswordDTO implements Serializable {
  
      @Serial
      private static final long serialVersionUID = 1L;
  
      /**
       * 用户邮箱
       */
      @NotBlank(message = MessageConstant.EMAIL + MessageConstant.NOT_NULL)
      @Email(message = MessageConstant.EMAIL + MessageConstant.FORMAT_ERROR)
      private String email;
  
      /**
       * 验证码
       * 验证码格式：6位字符（大小写字母、数字）
       */
      @NotBlank(message = MessageConstant.VERIFICATION_CODE + MessageConstant.NOT_NULL)
      @Pattern(regexp = "^[0-9a-zA-Z]{6}$", message = MessageConstant.VERIFICATION_CODE + MessageConstant.FORMAT_ERROR)
      private String verificationCode;
  
      /**
       * 新密码
       * 密码格式：8-18 位数字、字母、符号的任意两种组合
       */
      @NotBlank(message = MessageConstant.PASSWORD + MessageConstant.NOT_NULL)
      @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{8,18}$", message = MessageConstant.PASSWORD + MessageConstant.FORMAT_ERROR)
      private String newPassword;
  
      /**
       * 确认密码
       * 密码格式：8-18 位数字、字母、符号的任意两种组合
       */
      @NotBlank(message = MessageConstant.PASSWORD + MessageConstant.NOT_NULL)
      @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{8,18}$", message = MessageConstant.PASSWORD + MessageConstant.FORMAT_ERROR)
      private String repeatPassword;
  
  }
  