From ab7175248906d42ede8cb4ffb3aaf4855550f578 Mon Sep 17 00:00:00 2001 From: sumedh Date: Mon, 5 Aug 2024 23:28:24 +0530 Subject: [PATCH] date in simple format added --- .../com/olympus/apollo/controllers/KSFileController.java | 2 ++ src/main/java/com/olympus/apollo/models/KSDocument.java | 1 + src/main/java/com/olympus/apollo/services/KSIngestor.java | 2 ++ .../java/com/olympus/apollo/services/StorageProperties.java | 6 +++--- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/olympus/apollo/controllers/KSFileController.java b/src/main/java/com/olympus/apollo/controllers/KSFileController.java index 94fced1..24ac279 100644 --- a/src/main/java/com/olympus/apollo/controllers/KSFileController.java +++ b/src/main/java/com/olympus/apollo/controllers/KSFileController.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Date; +import java.text.SimpleDateFormat; import org.codelibs.jhighlight.fastutil.Hash; import org.springframework.beans.factory.annotation.Autowired; @@ -44,6 +45,7 @@ public class KSFileController { ksDocument.setName(file.getOriginalFilename()); ksDocument.setDescription(fileUploadDTO.getDescription()); ksDocument.setIngestionStatus("NEW"); + ksDocument.setIngestionDateFormat(new SimpleDateFormat("MM/dd/yy").format(new Date())); Date now = new Date(); ksDocument.setIngestionDate(now); diff --git a/src/main/java/com/olympus/apollo/models/KSDocument.java b/src/main/java/com/olympus/apollo/models/KSDocument.java index 411adf8..6f16fa4 100644 --- a/src/main/java/com/olympus/apollo/models/KSDocument.java +++ b/src/main/java/com/olympus/apollo/models/KSDocument.java @@ -25,6 +25,7 @@ public class KSDocument { private String ingestionStatus; //private String ingestionMessage; private Date ingestionDate; + private String ingestionDateFormat; private KSIngestionInfo ingestionInfo; diff --git a/src/main/java/com/olympus/apollo/services/KSIngestor.java b/src/main/java/com/olympus/apollo/services/KSIngestor.java index 654177c..c8ae1b4 100644 --- a/src/main/java/com/olympus/apollo/services/KSIngestor.java +++ b/src/main/java/com/olympus/apollo/services/KSIngestor.java @@ -1,6 +1,7 @@ package com.olympus.apollo.services; import java.util.*; +import java.text.SimpleDateFormat; import com.olympus.apollo.dto.IngestionOutput; import com.olympus.apollo.models.KSDocument; @@ -82,6 +83,7 @@ public class KSIngestor { }); ksDocument.setIngestionStatus("INGESTED");//we have to set to DONE ksDocument.setIngestionDate(new Date()); + ksDocument.setIngestionDateFormat(new SimpleDateFormat("MM/dd/yy").format(new Date())); ksDocumentRepository.save(ksDocument); diff --git a/src/main/java/com/olympus/apollo/services/StorageProperties.java b/src/main/java/com/olympus/apollo/services/StorageProperties.java index fab5fb6..ba8f790 100644 --- a/src/main/java/com/olympus/apollo/services/StorageProperties.java +++ b/src/main/java/com/olympus/apollo/services/StorageProperties.java @@ -4,10 +4,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("storage") public class StorageProperties { -/** + /** * Folder location for storing files */ - private String location = "C:\\Users\\andrea.terzani\\dev\\olympus\\upload-dir"; + private String location = "C:\\Users\\s.shamrao.shinde\\GenAIStorage"; public String getLocation() { return location; @@ -17,4 +17,4 @@ public class StorageProperties { this.location = location; } -} +} \ No newline at end of file