From 435c3217345dc768695b3a207336e035892e459d Mon Sep 17 00:00:00 2001
From: mohammedthaqi
Date: Tue, 9 Jan 2024 11:30:13 +0530
Subject: [PATCH] changes in feedback Form
---
.../component/UserSessionInterceptor.java | 5 +-
.../controller/FeedbackAPIController.java | 116 +++
.../controller/FeedbackController.java | 2 +-
src/main/resources/application.properties | 4 +-
.../templates/community/communityhall.html | 266 +++++--
.../templates/feedback/RequestForm.html | 674 ++++--------------
6 files changed, 455 insertions(+), 612 deletions(-)
create mode 100644 src/main/java/com/metro/feedback/controller/FeedbackAPIController.java
diff --git a/src/main/java/com/metro/component/UserSessionInterceptor.java b/src/main/java/com/metro/component/UserSessionInterceptor.java
index bd43c2d..ed030ba 100644
--- a/src/main/java/com/metro/component/UserSessionInterceptor.java
+++ b/src/main/java/com/metro/component/UserSessionInterceptor.java
@@ -16,14 +16,15 @@ public class UserSessionInterceptor implements HandlerInterceptor {
@Autowired
private UserSession userSession;
- private static final List EXCLUDED_URLS = Arrays.asList("/login", "/", "/api","/community","/feedback");
+ private static final List EXCLUDED_URLS = Arrays.asList("/login", "/", "/api","/community","/support","/feedback");
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// Get the current request URL
String requestUrl = request.getRequestURI();
// Exclude static resources from the check
- if (requestUrl.startsWith("/assets/") || requestUrl.startsWith("/css/") || requestUrl.startsWith("/js/") || requestUrl.startsWith("/images/") || requestUrl.startsWith("/api/") || requestUrl.startsWith("/community/") ||requestUrl.startsWith("/feedback/")) {
+ if (requestUrl.startsWith("/assets/") || requestUrl.startsWith("/css/") || requestUrl.startsWith("/js/") || requestUrl.startsWith("/images/")
+ || requestUrl.startsWith("/api/") || requestUrl.startsWith("/community/") ||requestUrl.startsWith("/support/")||requestUrl.startsWith("/feedback/")) {
return true; // Allow the request to proceed without checking the login status
}
diff --git a/src/main/java/com/metro/feedback/controller/FeedbackAPIController.java b/src/main/java/com/metro/feedback/controller/FeedbackAPIController.java
new file mode 100644
index 0000000..64c2315
--- /dev/null
+++ b/src/main/java/com/metro/feedback/controller/FeedbackAPIController.java
@@ -0,0 +1,116 @@
+package com.metro.feedback.controller;
+
+import java.util.List;
+
+import org.hibernate.mapping.Map;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLConnection;
+
+
+@RestController
+@RequestMapping("/feedback/api")
+public class FeedbackAPIController {
+
+// @GetMapping("/user")
+// public ResponseEntity> getUser(@RequestParam String mobile){
+// System.out.println("1 croce ");
+// RestTemplate rest =new RestTemplate();
+//
+// String s="https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=getProfileNew&serviceinput={Username:"+mobile+"}";
+// System.out.println(s);
+// Object forObject = rest.getForObject(s, Object.class);
+// return ResponseEntity.ok(forObject);
+// }
+
+// @GetMapping("/deactive")
+// public ResponseEntity> getDeactive(@RequestParam String mobile){
+// RestTemplate rest =new RestTemplate();
+//
+// String s="https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=profileDeactivate&serviceinput={Username:"+mobile+"}";
+// ResponseEntity
-