From 3bcee5d0b86da31aa11b255de9cd3f139d0b7837 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Wed, 14 May 2025 17:45:34 +0530 Subject: [PATCH] dlf --- .../OpenAi/Services/SureopsService.java | 24 +++++++++++++++---- .../Repository/Design_lbraryRepository.java | 10 ++++---- .../dlf/Services/Design_lbraryService.java | 8 +++---- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/OpenAi/Services/SureopsService.java b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/OpenAi/Services/SureopsService.java index 44a8a64..e144732 100644 --- a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/OpenAi/Services/SureopsService.java +++ b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/OpenAi/Services/SureopsService.java @@ -41,17 +41,31 @@ public class SureopsService { + PRJ_NAME; int i = 0; - String index = "\n" + "\n" + "\n" + " Welcome\n" + "\n" - + "\n" + "

Welcome to the Web App

\n" + " \n" + "\n" + ""; +// String index = "\n" + "\n" + "\n" + " Welcome\n" + "\n" +// + "\n" + "

Welcome to the Web App

\n" + " \n" + "\n" + ""; - String filename = "index.html"; - fileHelper.createFile(folderPath, filename, index); +// String filename = "index.html"; +// fileHelper.createFile(folderPath, filename, index); + + String startindex = "\n" + "\n" + "\n" + " Welcome\n" + "\n" + + "\n"; + + String endindex = "\n" + ""; for (Map.Entry entry : pageHtmlMap.entrySet()) { + String pageName = entry.getKey().trim().replaceAll("\\s+", "_") + ".html"; // remove spaces from name String htmlContent = entry.getValue(); + if (pageName.equalsIgnoreCase("home.html")) { + + pageName = "index.html"; + + htmlContent = startindex + " \n" + htmlContent + endindex; + + } + fileHelper.createFile(folderPath, pageName, htmlContent); i++; System.out.println(i + " file created "); diff --git a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Repository/Design_lbraryRepository.java b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Repository/Design_lbraryRepository.java index 1c749f4..2ebc3b1 100644 --- a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Repository/Design_lbraryRepository.java +++ b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Repository/Design_lbraryRepository.java @@ -20,13 +20,13 @@ public interface Design_lbraryRepository extends JpaRepository findAll(Pageable page, Long creayedBy); - @Query(value = "SELECT * from design_lbrary WHERE templatetype=:operation_type && uitype=:fieldtype limit 1", nativeQuery = true) - Design_lbrary getallByHeaderIdAndFieldType(@Param("operation_type") String operation_type, - @Param("fieldtype") String fieldtype); + @Query(value = "SELECT * from design_lbrary WHERE active=:active && templatetype=:operation_type && uitype=:fieldtype limit 1", nativeQuery = true) + Design_lbrary getallByHeaderIdAndFieldType(@Param("active") boolean active, + @Param("operation_type") String operation_type, @Param("fieldtype") String fieldtype); - @Query(value = "SELECT * FROM design_lbrary " + "WHERE templatetype = :operation_type " + @Query(value = "SELECT * FROM design_lbrary " + "WHERE active=:active && templatetype = :operation_type " + "AND LOWER(uitype) LIKE CONCAT(LOWER(:fieldtype), '%')", nativeQuery = true) - List getallFlfLine(@Param("operation_type") String operationType, + List getallFlfLine(@Param("active") boolean active, @Param("operation_type") String operationType, @Param("fieldtype") String fieldtype); @Query(value = "select * from design_lbrary WHERE id BETWEEN :startId AND :endId", nativeQuery = true) diff --git a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Services/Design_lbraryService.java b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Services/Design_lbraryService.java index 5229b9a..c9ae549 100644 --- a/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Services/Design_lbraryService.java +++ b/visaproject-back-b/authsec_springboot/backend/src/main/java/com/realnet/dlf/Services/Design_lbraryService.java @@ -127,7 +127,7 @@ public class Design_lbraryService { // GET LINE BY header id, operation type, field type public Design_lbrary getflflinerandom(String operationType, String fieldType) { - List flf = designLibraryRepository.getallFlfLine(operationType.toLowerCase().trim(), + List flf = designLibraryRepository.getallFlfLine(true, operationType.toLowerCase().trim(), fieldType.toLowerCase().trim()); if (flf == null || flf.isEmpty()) { @@ -141,8 +141,8 @@ public class Design_lbraryService { // GET LINE BY header id, operation type, field type public Design_lbrary getLinestraight(String operationType, String fieldType) { - Design_lbrary flf = designLibraryRepository.getallByHeaderIdAndFieldType(operationType.toLowerCase().trim(), - fieldType.toLowerCase().trim()); + Design_lbrary flf = designLibraryRepository.getallByHeaderIdAndFieldType(true, + operationType.toLowerCase().trim(), fieldType.toLowerCase().trim()); if (flf == null) { return null; // ya throw new RuntimeException("No data found"); @@ -153,7 +153,7 @@ public class Design_lbraryService { } public List listOfTemplate(String operationType, String fieldType) { - List flf = designLibraryRepository.getallFlfLine(operationType.toLowerCase().trim(), + List flf = designLibraryRepository.getallFlfLine(true, operationType.toLowerCase().trim(), fieldType.toLowerCase().trim()); if (flf == null || flf.isEmpty()) {