mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 17:40:05 +08:00
【代码优化】XingHuoApi stream 变量没有其他地方使用,直接return
This commit is contained in:
parent
6633bf002d
commit
cbf7a1c587
@ -134,7 +134,7 @@ public class XingHuoApi {
|
|||||||
URI uri = URI.create(authUrl);
|
URI uri = URI.create(authUrl);
|
||||||
// 发起 wss 请求并处理响应
|
// 发起 wss 请求并处理响应
|
||||||
// 创建一个 Flux 来处理接收到的消息
|
// 创建一个 Flux 来处理接收到的消息
|
||||||
Flux<XingHuoChatCompletion> messageFlux = Flux.create(sink -> {
|
return Flux.create(sink -> {
|
||||||
socketClient.execute(uri, session ->
|
socketClient.execute(uri, session ->
|
||||||
session.send(Mono.just(session.textMessage(JSONUtil.toJsonStr(request))))
|
session.send(Mono.just(session.textMessage(JSONUtil.toJsonStr(request))))
|
||||||
.thenMany(session.receive()
|
.thenMany(session.receive()
|
||||||
@ -145,6 +145,5 @@ public class XingHuoApi {
|
|||||||
.then())
|
.then())
|
||||||
.subscribe(); // 订阅以开始会话
|
.subscribe(); // 订阅以开始会话
|
||||||
});
|
});
|
||||||
return messageFlux;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user