Changeset 676144b for src/main/java/com/example/autopartz/service
- Timestamp:
- 01/05/23 04:11:40 (23 months ago)
- Branches:
- main
- Children:
- 1bd8d1e
- Parents:
- 7d43957
- Location:
- src/main/java/com/example/autopartz/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/service/UserService.java
r7d43957 r676144b 8 8 List<User> findAllUsers(); 9 9 User findByUsername(String username); 10 10 User findById(Integer id); 11 11 } -
src/main/java/com/example/autopartz/service/impl/UserServiceImpl.java
r7d43957 r676144b 1 1 package com.example.autopartz.service.impl; 2 2 3 import com.example.autopartz.model.Role; 3 4 import com.example.autopartz.model.User; 4 5 import com.example.autopartz.repository.UserRepository; … … 6 7 import org.springframework.stereotype.Service; 7 8 9 import java.util.Collections; 8 10 import java.util.List; 9 11 … … 25 27 return userRepository.findAllByUsername(username).stream().findFirst().orElseThrow(RuntimeException::new); 26 28 } 29 30 @Override 31 public User findById(Integer id) { 32 return userRepository.findById(id).get(); 33 } 27 34 }
Note:
See TracChangeset
for help on using the changeset viewer.