overview统计
This commit is contained in:
@@ -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 键
|
||||
|
||||
Reference in New Issue
Block a user