|
@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.basic.service.impl;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.CryptoConfigService;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.bean.CryptoConfigInfo;
|
|
|
import cn.com.qmth.examcloud.starters.crypto.CryptoProperties;
|
|
|
+import cn.com.qmth.examcloud.support.CacheConstants;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
@@ -26,8 +27,6 @@ public class CryptoConfigServiceImpl implements CryptoConfigService {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(CryptoConfigServiceImpl.class);
|
|
|
|
|
|
- private static final String CRYPTO_CONFIG_CACHE_KEY = "$CRYPTO_CONFIG";
|
|
|
-
|
|
|
@Autowired
|
|
|
private CryptoProperties cryptoProperties;
|
|
|
|
|
@@ -58,7 +57,7 @@ public class CryptoConfigServiceImpl implements CryptoConfigService {
|
|
|
newConfigCaches.add(new CryptoConfigInfo(group, true, System.currentTimeMillis()));
|
|
|
}
|
|
|
|
|
|
- redisClient.set(CRYPTO_CONFIG_CACHE_KEY, newConfigCaches);
|
|
|
+ redisClient.set(CacheConstants.CACHE_B_CRYPTO_CONFIG, newConfigCaches);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -66,7 +65,7 @@ public class CryptoConfigServiceImpl implements CryptoConfigService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<CryptoConfigInfo> getAllCryptoConfigs() {
|
|
|
- return redisClient.get(CRYPTO_CONFIG_CACHE_KEY, List.class);
|
|
|
+ return redisClient.get(CacheConstants.CACHE_B_CRYPTO_CONFIG, List.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -99,7 +98,7 @@ public class CryptoConfigServiceImpl implements CryptoConfigService {
|
|
|
}
|
|
|
|
|
|
if (needUpdate) {
|
|
|
- redisClient.set(CRYPTO_CONFIG_CACHE_KEY, configCaches);
|
|
|
+ redisClient.set(CacheConstants.CACHE_B_CRYPTO_CONFIG, configCaches);
|
|
|
}
|
|
|
}
|
|
|
|