package cryptosky.me.graphql.tweets.queries; import com.coxautodev.graphql.tools.GraphQLQueryResolver; import cryptosky.me.graphql.tweets.models.entities.BtcTweetModel; import cryptosky.me.graphql.tweets.service.BtcTweetService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional; @Component public class BtcTweetQuery implements GraphQLQueryResolver { @Autowired private BtcTweetService btcTweetService; public Optional getCurrentTweet() { return this.btcTweetService.getCurrentTweet(); } public List getAllTweets( final int count ) { return this.btcTweetService.getAllTweets(count); } public List getTweetsForDay( final String startDate, final String endDate ) { return this.btcTweetService.getTweetsForDay(startDate, endDate); } public List getTweetsForPeriod( final String startDate, final String endDate ) { return this.btcTweetService.getTweetsForPeriod( startDate, endDate ); } }