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

import cn.reghao.tnb.auth.app.model.constant.LoginPlat;
import cn.reghao.tnb.auth.app.model.constant.LoginType;
import cn.reghao.jutil.jdk.web.validator.ValidEnum;
import lombok.Getter;
import lombok.Setter;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;

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

    @ValidEnum(value = LoginType.class, message = "登入类型不正确")
    private Integer loginType;
    @NotBlank
    private String principal;
    @NotBlank
    private String credential;
    @Size(min = 5, max = 5, message = "图形验证码应是 5 个字符")
    private String captchaCode;
    @ValidEnum(value = LoginPlat.class, message = "登入平台类型不正确")
    private Integer plat;
    private Boolean rememberMe;

    public AccountLoginDto() {
        this.rememberMe = false;
    }
}
