调试音乐延迟-2
This commit is contained in:
parent
89983b291c
commit
cbbae04686
@ -64,7 +64,7 @@ public class MusicService {
|
|||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
return webClient.get().uri(baseUrl+"/search?keywords="+keyword).retrieve()
|
return webClient.get().uri(baseUrl+"/search?keywords="+keyword).retrieve()
|
||||||
.bodyToMono(SearchResponse.class)
|
.bodyToMono(SearchResponse.class)
|
||||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||||
.flatMap(res -> {
|
.flatMap(res -> {
|
||||||
if (!Objects.equals(res.getCode(), 200)) {
|
if (!Objects.equals(res.getCode(), 200)) {
|
||||||
return Mono.empty();
|
return Mono.empty();
|
||||||
@ -91,7 +91,7 @@ public class MusicService {
|
|||||||
} else {
|
} else {
|
||||||
return webClient.get().uri(baseUrl+"/search?keywords="+keyword+"&type=100").retrieve()
|
return webClient.get().uri(baseUrl+"/search?keywords="+keyword+"&type=100").retrieve()
|
||||||
.bodyToMono(SingerResponse.class)
|
.bodyToMono(SingerResponse.class)
|
||||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||||
.flatMap(res -> {
|
.flatMap(res -> {
|
||||||
if (!Objects.equals(res.getCode(), 200) && res.getResult().getArtists().size() == 0) {
|
if (!Objects.equals(res.getCode(), 200) && res.getResult().getArtists().size() == 0) {
|
||||||
return Mono.empty();
|
return Mono.empty();
|
||||||
@ -99,7 +99,7 @@ public class MusicService {
|
|||||||
String id = res.getResult().getArtists().get(0).getId();
|
String id = res.getResult().getArtists().get(0).getId();
|
||||||
return webClient.get().uri(baseUrl+"/artist/top/song?id="+id).retrieve()
|
return webClient.get().uri(baseUrl+"/artist/top/song?id="+id).retrieve()
|
||||||
.bodyToMono(SingerSongsResponse.class)
|
.bodyToMono(SingerSongsResponse.class)
|
||||||
.delaySubscription(Duration.ofMillis(1000), Schedulers.boundedElastic())
|
.delaySubscription(Duration.ofMillis(300), Schedulers.boundedElastic())
|
||||||
.flatMap(song -> {
|
.flatMap(song -> {
|
||||||
if (Objects.equals(200, song.getCode()) && song.getSongs().size() > 0) {
|
if (Objects.equals(200, song.getCode()) && song.getSongs().size() > 0) {
|
||||||
String ids = song.getSongs().stream().limit(3)
|
String ids = song.getSongs().stream().limit(3)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user