Ejemplo n.º 1
0
        public async Task <IActionResult> GetTweets([FromQuery] DateTime startDate, DateTime endDate)
        {
            if (startDate == default(DateTime) || endDate == default(DateTime))
            {
                return(BadRequest("Please specify date, for example /api/tweets/period?startdate=2016-01-01&enddate=2018-01-01"));
            }

            var badApiUrl = _configuration["ApiUrl"];
            var tweets    = await _tweetsService.GetTweets(badApiUrl, startDate, endDate);

            return(Ok(tweets));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetTweets()
        {
            var tweets = await _tweetsService.GetTweets();

            return(Ok(tweets));
        }