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
8853318834
commit
5a82ae3a41
1 changed files with 10 additions and 3 deletions
|
@ -1,21 +1,28 @@
|
||||||
public class UserService {
|
public class UserService {
|
||||||
public String getUserName(int userId) {
|
public String getUserName(int userId) {
|
||||||
return "User" + userId;
|
return "[Main] User#" + userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUserActive(int userId) {
|
public boolean isUserActive(int userId) {
|
||||||
|
System.out.println("Main branch: checking DB for user activity");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateUserStatus(int userId, boolean isActive) {
|
public void updateUserStatus(int userId, boolean isActive) {
|
||||||
// update logic here
|
System.out.println("Main branch: logging status update");
|
||||||
|
// update logic to DB
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteUser(int userId) {
|
public void deleteUser(int userId) {
|
||||||
|
logDeletion(userId);
|
||||||
// deletion logic
|
// deletion logic
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyUser(int userId, String message) {
|
public void notifyUser(int userId, String message) {
|
||||||
System.out.println("Sending message: " + message);
|
System.out.println("[Main] Sending message to user: " + message);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void logDeletion(int userId) {
|
||||||
|
System.out.println("Logging deletion of user " + userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue