package org.dromara.web.domain.bo;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.dromara.common.core.constant.RegexConstants;

/**
 * 短信验证码重置密码对象
 *
 * @author shihongwei
 */
@Data
public class SmsResetPwdBo {

    /**
     * 手机号
     */
    @NotBlank(message = "{user.phonenumber.not.blank}")
    private String mobile;

    /**
     * 短信验证码
     */
    @NotBlank(message = "{user.sms.code.not.blank}")
    private String code;

    /**
     * 新密码
     */
    @NotBlank(message = "{user.new.password.not.blank}")
    @Length(min = 8, max = 20, message = "{user.password.length.valid}")
    @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}")
    private String password;

    /**
     * 确认密码（可选，通常前端校验，后端也可以校验）
     */
    private String confirmPassword;
}
