diff --git a/src/main/java/com/gcc/crslogs/controller/ApiController.java b/src/main/java/com/gcc/crslogs/controller/ApiController.java index 110644e..bbcecbe 100644 --- a/src/main/java/com/gcc/crslogs/controller/ApiController.java +++ b/src/main/java/com/gcc/crslogs/controller/ApiController.java @@ -54,25 +54,8 @@ public class ApiController { // Create an ObjectMapper instance ObjectMapper objectMapper = new ObjectMapper(); - // Check if mobile number is already registered - //List registrations = wasteregistrationrepo.findByMobileNo(mobile); - - // Create a response map Map response = new HashMap<>(); -// if (registrations.isEmpty()) { -// // If mobile number is not registered -// response.put("status", "NOT_REGISTERED"); -// response.put("mobile", mobile); // Return the mobile number -// try { -// return objectMapper.writeValueAsString(response); // Use the instance to convert map to JSON string -// } catch (Exception e) { -// // Handle JSON conversion error -// return "{\"status\": \"ERROR\", \"message\": \"Could not convert response to JSON.\"}"; -// } -// } - - String MobileNo=mobile; System.out.print("\n MobileNo---:"+mobile); Random rand = new Random(); @@ -117,7 +100,7 @@ public class ApiController { } - + /////////////////////verify otp method with session handling///////////////////// @GetMapping(value = "/verifyOTP") public Map verifyOtp(HttpServletRequest request, @RequestParam String otp, @@ -165,7 +148,7 @@ public class ApiController { } - + ///////////////////////birth details getting method/////////////////// @GetMapping("/birth-details") public ResponseEntity fetchBirthCertificateSecurely( @@ -197,6 +180,7 @@ public class ApiController { + ////////////////////////death details getting method/////////////////// @GetMapping("/death-details") public ResponseEntity fetchDeathCertificateSecurely( @@ -228,6 +212,7 @@ public class ApiController { + /////////////////save new user method///////////////// @PostMapping("/saveNewUser") public ResponseEntity saveNewUser (@RequestParam String user_name, @RequestParam(required = false) String user_address, @RequestParam String user_mobile) { @@ -238,6 +223,7 @@ public class ApiController { } + /////////////////check existing or not method//////////// @PostMapping("/checkUser") public ResponseEntity> checkUser(@RequestParam String mobile) { @@ -253,7 +239,7 @@ public class ApiController { } - + ///////////////////////save certificate logs method/////////////////// @PostMapping("/saveCertificateLogs") public ResponseEntity saveCertificateLogs(HttpServletRequest request, @RequestParam String regNo, @RequestParam String eventDate, @@ -269,16 +255,6 @@ public class ApiController { } - - -// @PostMapping("/checkUser") -// public ResponseEntity checkUser(@RequestParam String user_mobile) { -// boolean exists = birthAndDeathDetailsService.isUserExists(user_mobile); -// if (exists) { -// return ResponseEntity.ok().body("User already registered."); -// } else { -// return ResponseEntity.ok().body("User not registered."); -// } -// } + } diff --git a/src/main/java/com/gcc/crslogs/controller/MainController.java b/src/main/java/com/gcc/crslogs/controller/MainController.java index cd9244f..a7a8317 100644 --- a/src/main/java/com/gcc/crslogs/controller/MainController.java +++ b/src/main/java/com/gcc/crslogs/controller/MainController.java @@ -21,6 +21,7 @@ public class MainController { @GetMapping("/birthanddeath") public String birthform(HttpServletRequest request, Model model) { HttpSession session = request.getSession(); + session.setMaxInactiveInterval(10 * 60); //System.out.println("username.."+session.getAttribute("userName")); String username = (String) session.getAttribute("userName"); if (username==null || username.isEmpty()) { @@ -33,9 +34,12 @@ public class MainController { return "modules/crslogspages/birthanddeath"; } + + @GetMapping("/logout") public String logoutForm(HttpServletRequest request) { HttpSession session = request.getSession(); + session.setMaxInactiveInterval(10 * 60); session.invalidate(); return "modules/crslogspages/loginpage"; diff --git a/src/main/resources/templates/modules/crslogspages/birthanddeath.html b/src/main/resources/templates/modules/crslogspages/birthanddeath.html index 0faed4e..000b93f 100644 --- a/src/main/resources/templates/modules/crslogspages/birthanddeath.html +++ b/src/main/resources/templates/modules/crslogspages/birthanddeath.html @@ -8,9 +8,10 @@ GCC - Birth And Death - + + + + @@ -410,18 +454,55 @@ body {
GREATER CHENNAI CORPORATION
- - - - - - -