cn.zhxu.bp.model.FlowAttrs Maven / Gradle / Ivy
The newest version!
package cn.zhxu.bp.model;
import jakarta.validation.constraints.Min;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.Objects;
@Getter
@Setter
@ToString
public class FlowAttrs {
/**
* 全局限流参数:令牌桶每秒新增的速率
*/
@Min(1)
private Integer globalRate;
/**
* 全局限流参数:令牌桶最大容量
*/
@Min(1)
private Integer globalTotal;
/**
* User/IP 限流参数:令牌桶每秒新增的速率
*/
@Min(1)
private Integer userRate;
/**
* User/IP 限流参数:令牌桶最大容量
*/
@Min(1)
private Integer userTotal;
/**
* 转发最大重试次数
*/
@Min(0)
private Integer retries;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FlowAttrs flowAttrs = (FlowAttrs) o;
return Objects.equals(globalRate, flowAttrs.globalRate) && Objects.equals(globalTotal, flowAttrs.globalTotal) && Objects.equals(userRate, flowAttrs.userRate) && Objects.equals(userTotal, flowAttrs.userTotal) && Objects.equals(retries, flowAttrs.retries);
}
}