...
|
...
|
@@ -82,6 +82,20 @@ public class ResourcesServiceImpl implements IResourcesService { |
|
|
log.info("Find all resource content data by content code is {},client type is {} success.", request.getContentCode(), request.getClientType());
|
|
|
resourcesRedisCache.setEx(cacheKey, list, CacheEnum.RESOURCE_GET.getCacheTime()); return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void clearCache(String contentCode) {
|
|
|
String[] clientType = { "android", "ios" };
|
|
|
for (String ct : clientType) {
|
|
|
try {
|
|
|
RedisKeyBuilder cacheKey = CacheEnum.RESOURCE_GET.generateKeyLowerCase(contentCode, ct);
|
|
|
log.info("清除资源位缓存 contentCode={},clientType={}", contentCode, ct);
|
|
|
resourcesRedisCache.delete(cacheKey);
|
|
|
} catch (Exception e) {
|
|
|
log.error("清除资源位缓存错误 contentCode={},clientType={}, err={}", contentCode, ct, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void validateRequestForGet(ResourcesRequest request) {
|
|
|
if (StringUtils.isEmpty(request.getContentCode())) {
|
...
|
...
|
|