Skip to content

Instantly share code, notes, and snippets.

@sabbarmehdi
Created July 28, 2021 16:01
Show Gist options
  • Save sabbarmehdi/66c43299a92ba9de587dda0a3160f879 to your computer and use it in GitHub Desktop.
Save sabbarmehdi/66c43299a92ba9de587dda0a3160f879 to your computer and use it in GitHub Desktop.
feign
@Service
public class UserService{
@Autowired
private ItemsServiceClient itemsServiceClient;
@Autowired
protected UserRepository userRepository;
public List<Item> findAllItemById() {
Long userId = userRepository.findByEmail(getUsername()).get().getId();
List<Item> itemList= itemsServiceClient.getItems(userId);
return itemList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment