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