package cn.reghao.tnb.account.app.model.dto;

import cn.reghao.tnb.account.app.model.constant.LoginPlat;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 用户注册提交的数据
 *
 * @author reghao
 * @date 2021-11-17 16:36:05
 */
@Setter
@Getter
public class UserRegisterDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String principal;
    @NotBlank(message = "密码不能为空")
    private String credential;
    @Length(min = 6, max = 6, message = "验证码长度应为 6 位")
    private String verifyCode;
    @Length(min = 5, max = 5, message = "captcha 长度应为 5 位")
    private String captchaCode;
    private String plat;

    public UserRegisterDto() {
        this.plat = LoginPlat.web.getName();
    }
}
