package com.tzy.framework.web.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class LimitRule {
    public static final String COMMON="common";
    public static final String USER="user";
    public static final String ACT="act";
    /**需要token*/
    public static final String ACT_TOKEN="act_token";

    /**几秒内限制*/
    private int seconds;
    /**可访问次数*/
    private int limitCount;
    /**锁定次数,limitCount相比取更大*/
    private int lockCount;
    /**锁定时间*/
    private int lockTime;

    public boolean enableLimitLock() {
        return this.getLockTime() > 0 && this.getLockCount() > 0;
    }
}