|
|
@@ -3,9 +3,14 @@ package com.webflux.launchadmin.mysql.task;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
|
|
import org.springframework.data.redis.core.ScanOptions;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import reactor.core.publisher.Flux;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
public class MatchByKeyDeleteAll {
|
|
|
@Resource
|
|
|
private ReactiveRedisTemplate<String,String> reactiveRedisTemplate;
|
|
|
@@ -27,4 +32,32 @@ public class MatchByKeyDeleteAll {
|
|
|
return reactiveRedisTemplate.delete(Flux.fromIterable(keys));
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ public Mono<List<String>> get16() {
|
|
|
+ ScanOptions options = ScanOptions.scanOptions().match("*" + 6 + "*").build();
|
|
|
+ Flux<Map.Entry<Object, Object>> sync_poster_temp_info_hash_json = reactiveRedisTemplate
|
|
|
+ .opsForHash().scan("sync_poster_temp_info_hash_json", options);
|
|
|
+
|
|
|
+ Mono<List<String>> listMono = sync_poster_temp_info_hash_json.flatMap(entry -> {
|
|
|
+ return Mono.just(entry.getValue());
|
|
|
+ }).filter(Objects::nonNull).map(String::valueOf).collectList();
|
|
|
+ reactiveRedisTemplate
|
|
|
+ .opsForHash()
|
|
|
+ .entries("sync_poster_temp_info_hash_json")
|
|
|
+ .filter(entry -> entry.getKey().toString().contains("6"))
|
|
|
+ .map(entry -> entry.getKey().toString()).collectList();
|
|
|
+
|
|
|
+ return reactiveRedisTemplate
|
|
|
+ .opsForHash()
|
|
|
+ .entries("sync_poster_temp_info_hash_json")
|
|
|
+ .filter(entry -> entry.getKey().toString().contains("6"))
|
|
|
+ .map(entry -> entry.getKey().toString()).collectList();
|
|
|
+ }
|
|
|
+
|
|
|
+ public Mono<List<String>> get15() {
|
|
|
+ String key="sync_material_info_set_ids_*-13";
|
|
|
+ Mono<List<String>> listMono = reactiveRedisTemplate
|
|
|
+ .scan(ScanOptions.scanOptions().match(key).build()).collectList();
|
|
|
+ return listMono;
|
|
|
+ }
|
|
|
}
|