示例#1
0
        public async Task <List <EventCommand> > getFilteredData(EventCommandFilterDTO filterData)
        {
            HttpResponseMessage response = await _unitOfWork.HttpClient.PostAsync(_unitOfWork.CommandLocation + _APILocation + _filteredEndpoint,
                                                                                  new StringContent(JsonSerializer.Serialize(filterData), Encoding.UTF8, "application/json"));

            return(await JsonSerializer.DeserializeAsync <List <EventCommand> >(await response.Content.ReadAsStreamAsync()));
        }
示例#2
0
 public List <EventCommand> getFilteredData(EventCommandFilterDTO eventCommandFilterDTO)
 {
     if (eventCommandFilterDTO.Timeframe == null)
     {
         return(_cassandraService.SelectFilteredQuery(_unitOfWork.CassandraTable, eventCommandFilterDTO.StationName, eventCommandFilterDTO.EventType, eventCommandFilterDTO.DataInfluenced));
     }
     return(_cassandraService.SelectTimeframeFilteredQuery(_unitOfWork.CassandraTable, eventCommandFilterDTO.Timeframe.From, eventCommandFilterDTO.Timeframe.To,
                                                           eventCommandFilterDTO.StationName, eventCommandFilterDTO.EventType, eventCommandFilterDTO.DataInfluenced));
 }
示例#3
0
 public async Task <IActionResult> GetFilteredData([FromBody] EventCommandFilterDTO filterInfo)
 {
     return(Ok(_dataService.getFilteredData(filterInfo)));
 }