mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 06:15:50 +00:00
Update UserService.java
Signed-off-by: jeet041 <mahorjitendra@gmail.com>
This commit is contained in:
parent
297c5f474d
commit
809c26334f
1 changed files with 12 additions and 3 deletions
|
@ -1,14 +1,23 @@
|
||||||
// File: UserService.java
|
// File: UserService.java
|
||||||
public class UserService {
|
public class UserService {
|
||||||
public String getUserName(int userId) {
|
public String getUserName(int userId) {
|
||||||
return "User" + userId;
|
return "MainBranchUser#" + userId; // Different logic
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUserActive(int userId) {
|
public boolean isUserActive(int userId) {
|
||||||
return true;
|
return checkUserStatusFromDB(userId); // Pull from DB now
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateUserStatus(int userId, boolean isActive) {
|
public void updateUserStatus(int userId, boolean isActive) {
|
||||||
// update logic here
|
logStatusUpdate(userId, isActive);
|
||||||
|
// Update in DB
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkUserStatusFromDB(int userId) {
|
||||||
|
return true; // stub
|
||||||
|
}
|
||||||
|
|
||||||
|
private void logStatusUpdate(int userId, boolean isActive) {
|
||||||
|
System.out.println("Main Branch: Logging status update for user " + userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue