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");
|
|
|
}
|