|
|
|
@ -79,16 +79,20 @@ public class TestController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("testRedisVectorStore")
|
|
|
|
|
public void testRedisVectorStore() {
|
|
|
|
|
|
|
|
|
|
List<AskTemplateQuestionLibrary> list = askTemplateQuestionLibraryService.list();
|
|
|
|
|
for (AskTemplateQuestionLibrary askTemplateQuestionLibrary : list) {
|
|
|
|
|
String description = askTemplateQuestionLibrary.getDescription();
|
|
|
|
|
redisVectorStore.add(List.of(new Document(description, Map.of("type", "1", "medicalId", "222"))));
|
|
|
|
|
redisVectorStore.add(List.of(new Document(description, Map.of("type", "1",
|
|
|
|
|
"standardQuestionId", askTemplateQuestionLibrary.getId(),
|
|
|
|
|
"questionId", askTemplateQuestionLibrary.getId(),
|
|
|
|
|
"dictId", askTemplateQuestionLibrary.getDictId()))));
|
|
|
|
|
List<String> question = askTemplateQuestionLibrary.getQuestion();
|
|
|
|
|
for (String s : question) {
|
|
|
|
|
redisVectorStore.add(List.of(new Document(s, Map.of("type", "1", "medicalId", "222"))));
|
|
|
|
|
redisVectorStore.add(List.of(new Document(s, Map.of("type", "2",
|
|
|
|
|
"standardQuestionId", askTemplateQuestionLibrary.getId(),
|
|
|
|
|
"questionId", askTemplateQuestionLibrary.getId(),
|
|
|
|
|
"dictId", askTemplateQuestionLibrary.getDictId()))));
|
|
|
|
|
}
|
|
|
|
|
// log.info("处理完成:{}", description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -106,6 +110,7 @@ public class TestController {
|
|
|
|
|
});
|
|
|
|
|
return documents;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("testExpireTime")
|
|
|
|
|
public String testExpireTime() {
|
|
|
|
|
return "OK";
|
|
|
|
|