admin
2022-04-29 6cc97918a5a42e37a3c3867cc5b78a0b9fd43a24
app/src/main/java/com/yeshi/makemoney/app/entity/goldcorn/GoldCornGetFrequencyConfig.java
@@ -1,6 +1,8 @@
package com.yeshi.makemoney.app.entity.goldcorn;
import com.yeshi.makemoney.app.entity.SystemEnum;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
@@ -14,24 +16,52 @@
@Document(collection = "goldCornGetFrequencyConfig")
public class GoldCornGetFrequencyConfig {
    enum GoldCornGetFrequencyTimeUnit {
        hour, day, week, month, year
    public enum GoldCornGetFrequencyTimeUnit {
        minute("分钟"), hour("小时"), day("天"), week("周"), month("月"), year("年");
        private String name;
        private GoldCornGetFrequencyTimeUnit(String name) {
            this.name = name;
        }
        public String getName() {
            return name;
        }
    }
    @Id
    private String id;
    @Indexed
    private SystemEnum system;
    @Indexed
    private GoldCornGetType type;
    /**
     * 限制的次数,配合单位使用,表示 每一个unit周期内limitCount次限制
     * 限制的(次数/分钟数),配合单位使用,表示 每一个unit周期内limitCount次限制
     */
    private Integer limitCount;
    private Long limitCount;
    /**
     * 单位
     */
    private GoldCornGetFrequencyTimeUnit timeUnit;
    /**
     * 最小间隔时间(秒)
     */
    private Long minSpaceTime;
    @Indexed
    private Date validateTime;
    private String remarks;
    private Date createTime;
    private Date updateTime;
    public String toId() {
        return system.name() + "-" + type.name() + "-" + validateTime.getTime();
    }
    public String getId() {
        return id;
@@ -57,11 +87,11 @@
        this.type = type;
    }
    public Integer getLimitCount() {
    public Long getLimitCount() {
        return limitCount;
    }
    public void setLimitCount(Integer limitCount) {
    public void setLimitCount(Long limitCount) {
        this.limitCount = limitCount;
    }
@@ -96,4 +126,21 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    public Long getMinSpaceTime() {
        return minSpaceTime;
    }
    public void setMinSpaceTime(Long minSpaceTime) {
        this.minSpaceTime = minSpaceTime;
    }
}