完成模块2

This commit was merged in pull request #14.
This commit is contained in:
liwentao committed 2026-06-02 17:18:21 +08:00
1 parent bdcd3b2bf0
commit 8af444b7ee
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();
}
}