diff --git a/backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/DocumentService.java b/backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/DocumentService.java index 1d33c4f..a74985d 100644 --- a/backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/DocumentService.java +++ b/backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/DocumentService.java @@ -18,6 +18,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.ai.client.AiClient; import org.springframework.ai.client.AiResponse; import org.springframework.ai.client.Generation; @@ -38,7 +40,8 @@ @Service @Transactional public class DocumentService { - private final static String ID = "id"; + private static final Logger LOGGER = LoggerFactory.getLogger(DocumentService.class); + private static final String ID = "id"; private final DocumentRepository documentRepository; private final DocumentVsRepository documentVsRepository; private final AiClient aiClient; @@ -64,6 +67,7 @@ public Long storeDocument(Document document) { myDocument1.getMetadata().put(ID, myDocument.getId()); return Stream.of(myDocument1); }).toList(); + LOGGER.info("Name: {}, size: {}", document.getDocumentName(), documents.size()); this.documentVsRepository.add(documents); return Optional.ofNullable(myDocument.getDocumentContent()).stream() .map(myContent -> Integer.valueOf(myContent.length).longValue()).findFirst().orElse(0L); diff --git a/backend/src/main/resources/dbchangelog/changes/db.changelog-1.xml b/backend/src/main/resources/dbchangelog/changes/db.changelog-1.xml index b11baf2..5aa798a 100644 --- a/backend/src/main/resources/dbchangelog/changes/db.changelog-1.xml +++ b/backend/src/main/resources/dbchangelog/changes/db.changelog-1.xml @@ -11,7 +11,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> - + + CREATE EXTENSION if not exists hstore SCHEMA public; + + @@ -25,7 +28,7 @@ - +