Created
July 18, 2022 10:57
-
-
Save andyi2it/98346ca70463d54ff3efb75f24eb3609 to your computer and use it in GitHub Desktop.
interview.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.i2it.interview; | |
@Service | |
public class Example{ | |
@Autowired | |
private UserRepo userRepo; | |
private User user; | |
@Transactional | |
public UserResponse saveUser(UserRequest userReq){ | |
user = buildUser(userReq); | |
// Update user | |
// ... | |
updatePermissions(); | |
} | |
public void updatePermissions(){ | |
user.setPermissions(DefaultPermissions.builder().build()); | |
userRepo.saveUser(user); | |
} | |
private User buildUser(UserRequest userReq){ | |
// ... | |
return user; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment