完成模块2

This commit is contained in:
2026-06-02 16:58:49 +08:00
parent ef9105266a
commit 20bc61b5fe
36 changed files with 3576 additions and 105 deletions
@@ -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();
}
}