|
@@ -15,7 +15,6 @@ import org.springframework.http.codec.ServerSentEvent;
|
|
|
import org.springframework.security.core.context.SecurityContextHolder;
|
|
import org.springframework.security.core.context.SecurityContextHolder;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import reactor.core.publisher.Flux;
|
|
import reactor.core.publisher.Flux;
|
|
|
-import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -473,7 +472,9 @@ public class ChatController {
|
|
|
StringBuilder ocrBuilder = new StringBuilder();
|
|
StringBuilder ocrBuilder = new StringBuilder();
|
|
|
for (ServerSentEvent<String> e : events) {
|
|
for (ServerSentEvent<String> e : events) {
|
|
|
String d = e.data();
|
|
String d = e.data();
|
|
|
- if (d != null && !d.equals("\n\n")) ocrBuilder.append(d);
|
|
|
|
|
|
|
+ if (d != null && !"\n\n".equals(d)) {
|
|
|
|
|
+ ocrBuilder.append(d);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
String mediaOcr = ocrBuilder.toString().trim();
|
|
String mediaOcr = ocrBuilder.toString().trim();
|
|
|
// 不重复发送 OCR 事件(已经通过 analyzeMediaStream 实时发送过了)
|
|
// 不重复发送 OCR 事件(已经通过 analyzeMediaStream 实时发送过了)
|
|
@@ -740,9 +741,9 @@ public class ChatController {
|
|
|
if (sectionDisplay == null || sectionDisplay.isEmpty()) {
|
|
if (sectionDisplay == null || sectionDisplay.isEmpty()) {
|
|
|
sectionDisplay = realSection(content, storedSection);
|
|
sectionDisplay = realSection(content, storedSection);
|
|
|
}
|
|
}
|
|
|
- // 跳过"正文"类无意义栏目
|
|
|
|
|
|
|
+ // 把"正文"替换为更友好的显示名
|
|
|
if ("正文".equals(sectionDisplay)) {
|
|
if ("正文".equals(sectionDisplay)) {
|
|
|
- return null;
|
|
|
|
|
|
|
+ sectionDisplay = "药典正文";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 构建完整来源引用
|
|
// 构建完整来源引用
|