Skip to content

Instantly share code, notes, and snippets.

@srdelarosa
Created March 19, 2021 01:53
Show Gist options
  • Save srdelarosa/777579e094ee2e8189b36f82f1b105cf to your computer and use it in GitHub Desktop.
Save srdelarosa/777579e094ee2e8189b36f82f1b105cf to your computer and use it in GitHub Desktop.
package com.newhorizons.takeitnow.products.domain.service;
import com.newhorizons.takeitnow.products.application.mainmodule.dto.ProductDto;
import com.newhorizons.takeitnow.products.application.mainmodule.service.IProductService;
import com.newhorizons.takeitnow.products.domain.repository.IProductRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class ProductService implements IProductService {
@Autowired
private IProductRepository productRepository;
public List<ProductDto> getAll() {
return productRepository.getAll();
}
public Optional<ProductDto> getProduct(long productId) {
return productRepository.getProduct(productId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment