34 lines
1.1 KiB
Java

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<BtcTweetModel> getCurrentTweet() {
return this.btcTweetService.getCurrentTweet();
}
public List<BtcTweetModel> getAllTweets( final int count ) {
return this.btcTweetService.getAllTweets(count);
}
public List<BtcTweetModel> getTweetsForDay( final String startDate, final String endDate ) {
return this.btcTweetService.getTweetsForDay(startDate, endDate);
}
public List<BtcTweetModel> getTweetsForPeriod( final String startDate, final String endDate ) {
return this.btcTweetService.getTweetsForPeriod( startDate, endDate );
}
}