| | |
| | | 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; |
| | |
| | | @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; |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getLimitCount() { |
| | | public Long getLimitCount() { |
| | | return limitCount; |
| | | } |
| | | |
| | | public void setLimitCount(Integer limitCount) { |
| | | public void setLimitCount(Long limitCount) { |
| | | this.limitCount = limitCount; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | } |