date in simple format added

This commit is contained in:
sumedh
2024-08-05 23:28:24 +05:30
parent 0c386d4d06
commit ab71752489
4 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Date; import java.util.Date;
import java.text.SimpleDateFormat;
import org.codelibs.jhighlight.fastutil.Hash; import org.codelibs.jhighlight.fastutil.Hash;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,7 @@ public class KSFileController {
ksDocument.setName(file.getOriginalFilename()); ksDocument.setName(file.getOriginalFilename());
ksDocument.setDescription(fileUploadDTO.getDescription()); ksDocument.setDescription(fileUploadDTO.getDescription());
ksDocument.setIngestionStatus("NEW"); ksDocument.setIngestionStatus("NEW");
ksDocument.setIngestionDateFormat(new SimpleDateFormat("MM/dd/yy").format(new Date()));
Date now = new Date(); Date now = new Date();
ksDocument.setIngestionDate(now); ksDocument.setIngestionDate(now);

View File

@@ -25,6 +25,7 @@ public class KSDocument {
private String ingestionStatus; private String ingestionStatus;
//private String ingestionMessage; //private String ingestionMessage;
private Date ingestionDate; private Date ingestionDate;
private String ingestionDateFormat;
private KSIngestionInfo ingestionInfo; private KSIngestionInfo ingestionInfo;

View File

@@ -1,6 +1,7 @@
package com.olympus.apollo.services; package com.olympus.apollo.services;
import java.util.*; import java.util.*;
import java.text.SimpleDateFormat;
import com.olympus.apollo.dto.IngestionOutput; import com.olympus.apollo.dto.IngestionOutput;
import com.olympus.apollo.models.KSDocument; import com.olympus.apollo.models.KSDocument;
@@ -82,6 +83,7 @@ public class KSIngestor {
}); });
ksDocument.setIngestionStatus("INGESTED");//we have to set to DONE ksDocument.setIngestionStatus("INGESTED");//we have to set to DONE
ksDocument.setIngestionDate(new Date()); ksDocument.setIngestionDate(new Date());
ksDocument.setIngestionDateFormat(new SimpleDateFormat("MM/dd/yy").format(new Date()));
ksDocumentRepository.save(ksDocument); ksDocumentRepository.save(ksDocument);

View File

@@ -7,7 +7,7 @@ public class StorageProperties {
/** /**
* Folder location for storing files * 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() { public String getLocation() {
return location; return location;