package com.gci.boot.modules.system.entity;

/**
 * @Author: lyz
 * @Description: TODO:登录次数验证
 * @version: v1.0
 * @Modified by:
 **/
public class LoginTimesValidate
{
    private String loginUser;

    private Integer times ;

    private Integer second = 10*60;

    private final static int MAX_LIMIT = 5;

    public boolean nonTimes(){
        return times>=MAX_LIMIT;
    }

    public LoginTimesValidate(){

    }

    public LoginTimesValidate(String loginUser, Integer second){
        this.loginUser = loginUser;
        this.second = second;
    }

    public LoginTimesValidate(String loginUser){
        this.loginUser = loginUser;
        this.times = 0;
    }

    public synchronized void addTimes(){
        this.times+=1;
    }

    public String getLoginUser() {
        return loginUser;
    }

    public void setLoginUser(String loginUser) {
        this.loginUser = loginUser;
    }

    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public Integer getSecond() {
        return second;
    }

    public void setSecond(Integer second) {
        this.second = second;
    }
}
