overview统计

This commit is contained in:
2025-11-14 18:31:39 +08:00
parent 6be3cc6abd
commit 9adc0c2058
24 changed files with 723 additions and 178 deletions

View File

@@ -283,6 +283,18 @@ public class RedisService {
return redisTemplate.opsForSet().members(key);
}
/**
* @description 获取Set集合大小等价于Redis的SCARD
* @param key String 键
* @return long 集合元素数量
* @author yslg
* @since 2025-11-14
*/
public long sCard(String key) {
Long size = redisTemplate.opsForSet().size(key);
return size != null ? size : 0L;
}
/**
* @description ZSet操作-添加元素
* @param key String 键