完成模块2

This commit is contained in:
liwentao committed 2026-06-02 18:06:54 +08:00
1 parent 5bcf6e26a4
commit 8e3e169984
36 files changed
+3576 -105

No files matched your search

@@ -69,4 +69,12 @@ public class RedisUtil {
public Mono<Boolean> expire(String key, long timeoutSeconds) {
return reactiveRedisTemplate.expire(key, Duration.ofSeconds(timeoutSeconds));
}
/**
* 根据通配符模式删除key
*/
public Mono<Long> deleteByPattern(String pattern) {
return reactiveRedisTemplate.keys(pattern)
.flatMap(keys -> reactiveRedisTemplate.delete(keys)).count();
}
}