tik集成

This commit is contained in:
wing
2025-10-28 00:08:09 +08:00
parent 0684aedf26
commit a81cd2c2c6
2 changed files with 12 additions and 1 deletions

View File

@@ -121,6 +121,15 @@ public class TikHupController {
}
return applicationResult.getOutput().getWorkflowMessage().getMessage().getContent();
})
// 【新增】设置超时时间30分钟内没有数据则超时
.timeout(java.time.Duration.ofMinutes(30))
// 【新增】超时后返回错误信息
.onErrorResume(java.util.concurrent.TimeoutException.class, e -> {
log.warn("流式输出超时30分钟无数据连接已断开");
return Flux.just("[TIMEOUT]流式输出超时,请检查网络或重新请求");
})
// 【新增】流式输出完成后,发送结束标记
.concatWith(Flux.just("[DONE]"))
// 4.4 流处理异常捕获(如网络中断、阿里 SDK 内部错误)
.onErrorMap(e -> {
log.error("流式处理异常", e); // 打印完整异常栈,便于排查

View File

@@ -82,7 +82,9 @@ public class TikHupServiceImpl implements TikHupService{
.asString();
}
Long userId = SecurityFrameworkUtils.getLoginUser().getId();
return response;
if(response.getBody() != null){
return response.getBody();
}
}catch (Exception e){
log.error("{}接口调用异常",url);
}