34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
package cryptosky.me.tweets.queries;
|
|
|
|
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
|
|
import cryptosky.me.tweets.models.entities.BtcTweetModel;
|
|
import cryptosky.me.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 );
|
|
}
|
|
}
|