2021与蓝度共同重构项目,服务端
chenjiantian
2022-01-17 a2f23bc97d133bcf7b950cd269eda577be4c0cac
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
package com.sandu.common.redis;
 
import com.sandu.common.security.config.SecurityProperties;
import com.sandu.common.util.SpringContextHolder;
 
/**
 * @author chenjiantian
 * @date 2021/7/20 12:00
 */
public class UserModel extends BasePrefix {
 
    @Override
    public String getModelName() {
        String onlineKey = SpringContextHolder.getBean(SecurityProperties.class).getOnlineKey();
        if (onlineKey == null) {
            throw new IllegalArgumentException("请配置onlineKey");
        }
        return onlineKey;
    }
 
    public UserModel(int expireSeconds, String prefix) {
        super(expireSeconds, prefix);
    }
 
    public static UserModel User = new UserModel(60, "gl");
 
    public static UserModel USER_TOKEN = new UserModel(60 * 60 * 24 * 7, "token");
    public static UserModel USER_INFO = new UserModel(60 * 60 * 24 * 7, "info");
 
 
}