- Timestamp:
- 02/02/23 22:46:30 (22 months ago)
- Branches:
- master
- Children:
- ac25203
- Parents:
- f60cb20
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.User; 4 import com.example.moviezone.model.exceptions.UserNotFoundException; 5 import com.example.moviezone.repository.UserRepository; 4 6 import com.example.moviezone.service.UserService; 5 7 import org.springframework.stereotype.Service; … … 10 12 public class UserServiceImpl implements UserService { 11 13 14 private final UserRepository userRepository; 15 16 public UserServiceImpl(UserRepository userRepository) { 17 this.userRepository = userRepository; 18 } 12 19 13 20 @Override 14 21 public List<User> findAllUsers() { 15 return null;22 return userRepository.findAll(); 16 23 } 17 24 18 25 @Override 19 public User findById( ) {20 return null;26 public User findById(Integer id) { 27 return userRepository.findById(id).orElseThrow(UserNotFoundException::new); 21 28 } 22 29 }
Note:
See TracChangeset
for help on using the changeset viewer.