package com.yunfeiyun.agmp.common.core.domain.model;

import com.yunfeiyun.agmp.common.framework.validator.annotation.ParamSqlInjection;
import com.yunfeiyun.agmp.common.framework.validator.annotation.PasswordEqual;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 用户登录对象
 * 
 * @author 杨晓辉
 */
@PasswordEqual
public class LoginBody
{
    /**
     * 登录名
     */
    @ParamSqlInjection
    @NotBlank(message = "登录名不能为空")
    @Length(message="登录名长度在{min}-{max}位之间" ,min = 4, max = 10)
//    @Pattern(regexp = "[a-zA-Z]+")
    private String loginname;

    /**
     * 用户密码
     */
    @ParamSqlInjection
    @NotBlank(message = "密码不能为空")
    @Length(message="密码长度在{min}-{max}位之间" ,min = 5,max = 12)
    private String password;

    /**
     * 验证码
     */
    @Length(max = 4)
    @NotNull(message = "验证码不能为空")
    private String code;

    /**
     * 唯一标识
     */
    private String uuid;

    private String redirect;

    public String getLoginname()
    {
        return loginname;
    }

    public void setLoginname(String loginname)
    {
        this.loginname = loginname;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getCode()
    {
        return code;
    }

    public void setCode(String code)
    {
        this.code = code;
    }

    public String getUuid()
    {
        return uuid;
    }

    public void setUuid(String uuid)
    {
        this.uuid = uuid;
    }

    public String getRedirect()
    {
        return redirect;
    }

    public void setRedirect(String redirect)
    {
        this.redirect = redirect;
    }
}
