123
This commit is contained in:
@@ -28,10 +28,11 @@ public class DynamicTotalCache {
|
||||
return String.format(RedisHttpConstant.DYNAMIC_TOTAL_CACHE_REDIS,now,userId);
|
||||
}
|
||||
|
||||
public void add(Long userId){
|
||||
public Long add(Long userId){
|
||||
String key = getKey(userId);
|
||||
redisTemplate.opsForValue().increment(key);
|
||||
Long increment = redisTemplate.opsForValue().increment(key);
|
||||
redisTemplate.expire(key,1, TimeUnit.DAYS);
|
||||
return increment;
|
||||
}
|
||||
|
||||
public int get(Long userId){
|
||||
|
||||
@@ -160,6 +160,7 @@ public class DynamicServiceImpl extends ServiceImpl<DynamicMapper, Dynamic> impl
|
||||
dynamicImages.add(po);
|
||||
}
|
||||
dynamicImagesService.saveBatch(dynamicImages);
|
||||
dynamicTotalCache.add(dynamic.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user