diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b61595f..deb1bc3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,13 @@
mysql-connector-j
runtime
+
+
+ com.oracle.database.jdbc
+ ojdbc8
+ runtime
+
+
org.springframework.boot
spring-boot-starter-test
diff --git a/src/main/java/com/election/lokshaba/component/UserSession.java b/src/main/java/com/election/lokshaba/component/UserSession.java
index b45f530..30e3ff3 100644
--- a/src/main/java/com/election/lokshaba/component/UserSession.java
+++ b/src/main/java/com/election/lokshaba/component/UserSession.java
@@ -8,53 +8,64 @@ import org.springframework.web.context.WebApplicationContext;
@Component
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class UserSession {
- private Integer userId;
- private long mobNo;
- private String userType;
- private String dispayName;
- private String zone;
-
- public Integer getUserId() {
- return userId;
- }
-
- public void setUserId(Integer userId) {
- this.userId = userId;
- }
-
- public String getUserType() {
- return userType;
- }
-
- public void setUserType(String userType) {
- this.userType = userType;
- }
-
- public String getDispayName() {
- return dispayName;
- }
-
- public void setDispayName(String dispayName) {
- this.dispayName = dispayName;
- }
-
- public long getMobNo() {
- return mobNo;
+ private String USR_NAME;
+ private String ACNOS;
+ private String SNO;
+ private String DESCRIPTION;
+ private String PERS_CODE;
+ private String PWD;
+ private String MOBILENO;
+ private String USER_LEVEL;
+ public String getUSR_NAME() {
+ return USR_NAME;
}
-
- public void setMobNo(long mobNo) {
- this.mobNo = mobNo;
+ public void setUSR_NAME(String uSR_NAME) {
+ USR_NAME = uSR_NAME;
}
-
- public String getZone() {
- return zone;
+ public String getACNOS() {
+ return ACNOS;
}
-
- public void setZone(String zone) {
- this.zone = zone;
+ public void setACNOS(String aCNOS) {
+ ACNOS = aCNOS;
+ }
+ public String getSNO() {
+ return SNO;
+ }
+ public void setSNO(String sNO) {
+ SNO = sNO;
}
+ public String getDESCRIPTION() {
+ return DESCRIPTION;
+ }
+ public void setDESCRIPTION(String dESCRIPTION) {
+ DESCRIPTION = dESCRIPTION;
+ }
+ public String getPERS_CODE() {
+ return PERS_CODE;
+ }
+ public void setPERS_CODE(String pERS_CODE) {
+ PERS_CODE = pERS_CODE;
+ }
+ public String getPWD() {
+ return PWD;
+ }
+ public void setPWD(String pWD) {
+ PWD = pWD;
+ }
+ public String getMOBILENO() {
+ return MOBILENO;
+ }
+ public void setMOBILENO(String mOBILENO) {
+ MOBILENO = mOBILENO;
+ }
+ public String getUSER_LEVEL() {
+ return USER_LEVEL;
+ }
+ public void setUSER_LEVEL(String uSER_LEVEL) {
+ USER_LEVEL = uSER_LEVEL;
+ }
+
-
-
+
}
diff --git a/src/main/java/com/election/lokshaba/component/UserSessionInterceptor.java b/src/main/java/com/election/lokshaba/component/UserSessionInterceptor.java
index 8547508..3aeb942 100644
--- a/src/main/java/com/election/lokshaba/component/UserSessionInterceptor.java
+++ b/src/main/java/com/election/lokshaba/component/UserSessionInterceptor.java
@@ -38,7 +38,7 @@ public class UserSessionInterceptor implements HandlerInterceptor {
// If logged in, add the userSession to the model
// Return true to allow the request to proceed
//if (isLoggedIn()) {
- if(userSession.getUserId() != null && userSession.getUserType() != null) {
+ if(userSession.getUSR_NAME() != null && userSession.getPWD() != null) {
request.setAttribute("userSession", userSession);
} else {
request.setAttribute("title", "Login");
@@ -52,6 +52,6 @@ public class UserSessionInterceptor implements HandlerInterceptor {
private boolean isLoggedIn() {
// Implement your login check logic here
// For example, check if the userSession contains the necessary information
- return userSession.getUserId() != null && userSession.getUserType() != null;
+ return userSession.getUSR_NAME() != null && userSession.getPWD() != null;
}
}
diff --git a/src/main/java/com/election/lokshaba/controller/MainController.java b/src/main/java/com/election/lokshaba/controller/MainController.java
index b2e2eac..66afa2e 100644
--- a/src/main/java/com/election/lokshaba/controller/MainController.java
+++ b/src/main/java/com/election/lokshaba/controller/MainController.java
@@ -4,6 +4,7 @@ import com.election.lokshaba.Repository.Userloginrepository;
import com.election.lokshaba.component.UserSession;
import com.election.lokshaba.model.Userlogin;
import com.election.lokshaba.others.AppConfig;
+import com.election.lokshaba.service.pollingPersonal.firstOrder.TrainingCenterRepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -13,10 +14,14 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
@Controller
public class MainController {
+ @Autowired
+ TrainingCenterRepService trainingCenterRepService;
+
@Autowired
private UserSession userSession;
@@ -45,23 +50,30 @@ public class MainController {
//
// return "login";
// }
-
-
-
-
+
+
+
+
@PostMapping("/login")
- public String login(Model model,@RequestParam String username,@RequestParam String password) {
- model.addAttribute("title","ElectionDashboard");
- System.out.println(username +" "+password);
- Optional user = userloginrepository.userchecking(username,password);
+ public String getLogin(@RequestParam("username") String name,
+ @RequestParam("password") String password){
+ System.out.println(name);
+ System.out.println(password);
+ List