package com.mortals.xhx.common.pdu.user;

import com.mortals.framework.exception.AppException;
import lombok.Data;


@Data
public class LoginPdu {
    private String loginName;

    private String password;

    private String securityCode;

    private String mark;
    /** 加密方式 1不加密，2加密*/
    private Integer type;


    @Override
    public String toString() {
        return "loginName:" + this.loginName + "  password:" + this.password;
    }

    public boolean validate() throws AppException {
        if (loginName == null || loginName.trim().length() == 0) {
            throw new AppException("帐号不能为空！");
        }
        if (password == null || password.trim().length() == 0) {
            throw new AppException("密码不能为空！");
        }
        return true;
    }
}
