Skip to content

Commit b35f984

Browse files
controller class variable name changed
1 parent 0a766d2 commit b35f984

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

UserManagement/src/main/java/com/hms/mangement/UserManagement/Configurations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class Configurations {
2424

2525
@Bean
2626
public DataSource datasource() throws PropertyVetoException {
27-
System.out.println("hello"+dbPassword);
27+
2828
return DataSourceBuilder
2929
.create()
3030
.username(dbUsername)

UserManagement/src/main/java/com/hms/mangement/UserManagement/Controller.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
public class Controller {
1010

1111
private ApplicationContext context;
12-
private UserDAO userJDBCTemplate;
12+
private UserDAO userDAO;
1313

1414
public Controller() {
1515
this.context = new AnnotationConfigApplicationContext(Configurations.class);
16-
this.userJDBCTemplate = context.getBean(UserDAO.class);
16+
this.userDAO = context.getBean(UserDAO.class);
1717

1818
}
1919

2020
@GetMapping(value = "/Users")
2121
public String viewUsers() {
2222

23-
List<User> users = userJDBCTemplate.viewAllUsers();
23+
List<User> users = userDAO.viewAllUsers();
2424
if (users != null) {
2525
return new Gson().toJson(users);
2626
}
@@ -46,7 +46,7 @@ public String createUsers(@RequestParam(value = "userName", defaultValue = " ")
4646
System.out.println("password cannot exceed 20 characters");
4747
return "password cannot exceed 20 characters";
4848
} else {
49-
userJDBCTemplate.create(user);
49+
userDAO.create(user);
5050
return "created new user";
5151
}
5252

@@ -57,14 +57,14 @@ public String updatePassword(@RequestParam(value = "id", defaultValue = " ") int
5757
@RequestParam(value = "opassword", defaultValue = " ") String oldPassword,
5858
@RequestParam(value = "npassword", defaultValue = " ") String newPassword) {
5959

60-
return userJDBCTemplate.updatePassword(id, oldPassword, newPassword);
60+
return userDAO.updatePassword(id, oldPassword, newPassword);
6161

6262
}
6363

6464
@DeleteMapping("/Users")
6565
public String deleteUser(@RequestParam(value = "id", defaultValue = " ") int id) {
6666

67-
return userJDBCTemplate.deleteUser(id);
67+
return userDAO.deleteUser(id);
6868
}
6969
}
7070

0 commit comments

Comments
 (0)