|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.sxtvs.open.api.review.service.impl.SSEService;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.http.util.TextUtils;
|
|
|
import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -75,8 +76,11 @@ public class KimiChatServiceImpl extends ServiceImpl<KimiChatMapper, KimiChat> i
|
|
|
.thenApply(HttpResponse::body)
|
|
|
.thenAccept(x -> {
|
|
|
log.info("流数据 -- ",x);
|
|
|
- sseService.sendData( dataId, x );
|
|
|
- stream2db(x.substring(6), dataId);
|
|
|
+ if(!TextUtils.isEmpty(x.trim())){
|
|
|
+
|
|
|
+ sseService.sendData( dataId, x );
|
|
|
+ stream2db(x.substring(6), dataId);
|
|
|
+ }
|
|
|
})
|
|
|
.join();
|
|
|
|