|
@@ -1,6 +1,7 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.student.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.TempConfigService;
|
|
|
+import cn.com.qmth.examcloud.support.CacheConstants;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
@@ -16,8 +17,6 @@ public class TempConfigServiceImpl implements TempConfigService {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(TempConfigServiceImpl.class);
|
|
|
|
|
|
- private static final String DISABLED_ORG_ID_CACHE_KEY = "$DISABLED_ORG_ID";
|
|
|
-
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
|
|
|
@@ -26,7 +25,7 @@ public class TempConfigServiceImpl implements TempConfigService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Long> getDisabledRootOrgIdsForOldApi() {
|
|
|
- List<Long> rootOrgIds = redisClient.get(DISABLED_ORG_ID_CACHE_KEY, List.class);
|
|
|
+ List<Long> rootOrgIds = redisClient.get(CacheConstants.CACHE_OE_OLD_API_BLACK_LIST, List.class);
|
|
|
if (rootOrgIds == null) {
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
@@ -40,10 +39,10 @@ public class TempConfigServiceImpl implements TempConfigService {
|
|
|
@Override
|
|
|
public void updateDisabledRootOrgIdsForOldApi(List<Long> rootOrgIds) {
|
|
|
if (CollectionUtils.isEmpty(rootOrgIds)) {
|
|
|
- redisClient.delete(DISABLED_ORG_ID_CACHE_KEY);
|
|
|
+ redisClient.delete(CacheConstants.CACHE_OE_OLD_API_BLACK_LIST);
|
|
|
log.warn("updateDisabledRootOrgIdsForOldApi ids is empty");
|
|
|
} else {
|
|
|
- redisClient.set(DISABLED_ORG_ID_CACHE_KEY, rootOrgIds);
|
|
|
+ redisClient.set(CacheConstants.CACHE_OE_OLD_API_BLACK_LIST, rootOrgIds);
|
|
|
log.warn("updateDisabledRootOrgIdsForOldApi ids={}", rootOrgIds);
|
|
|
}
|
|
|
}
|