1
zj
2025-06-25 a0361e762fc672d844ef15e18db5971893cce2bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package project.ddos.utils;
 
import org.springframework.beans.factory.InitializingBean;
 
import kernel.util.TimeWindow;
 
public class SystemParaReadRequestTimeWindow implements InitializingBean {
    
    private TimeWindow timeWindow = new TimeWindow();
 
    public void afterPropertiesSet() throws Exception {
        /**
         * 1分钟
         */
        this.timeWindow.setTimeSize(60 * 1);
        this.timeWindow.start();
    }
 
    public String get(String key) {
        Object authcode = this.timeWindow.findObject(key);
        if (authcode != null) {
            return String.valueOf(authcode.toString());
        }
        return null;
    }
 
    public void put(String key, String value) {
        this.timeWindow.add(key, value);
    }
 
    public void del(String key) {
        this.timeWindow.remove(key);
    }
}