package cryptosky.me.graphql.pricing.queries; import com.coxautodev.graphql.tools.GraphQLQueryResolver; import cryptosky.me.graphql.pricing.models.entities.BtcPriceModel; import cryptosky.me.graphql.pricing.service.BtcPriceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional; @Component public class BtcPriceQuery implements GraphQLQueryResolver { @Autowired private BtcPriceService btcPriceService; public List getAllPrices( final int count ) { return this.btcPriceService.getAllPrices(count); } public List getPricesBetweenCounts( final int startCount, final int endCount ) { return this.btcPriceService.getPricesBetweenCounts(startCount, endCount); } public Optional getLatest() { return this.btcPriceService.getLatest(); } public Optional getPriceForCreatedDate( final String createdDate ) { return this.btcPriceService.getPriceForCreatedDate(createdDate); } public List getPriceBetweenDates(final String startDate, final String endDate ) { return this.btcPriceService.getPriceBetweenDates(startDate, endDate); } }