| 279 | var rows = await _queryClient.NamedQueryAsync<PeriodicStatsRow>("key_metrics_periodic__v2", new { |
| 280 | date_from = query.DateFrom?.ToString("yyyy-MM-dd HH:mm:ss"), |
| 281 | date_to = query.DateTo?.ToString("yyyy-MM-dd HH:mm:ss"), |
| 282 | granularity = (query.Granularity ?? GranularityEnum.Hour).ToString(), |
| 283 | app_id = query.AppId, |
| 284 | event_name = query.EventName, |
| 285 | os_name = query.OsName, |
| 286 | app_version = query.AppVersion, |
| 287 | country_code = query.CountryCode, |
| 288 | device_model = query.DeviceModel, |
| 289 | }, cancellationToken); |
| 290 | |
| 291 | return Ok(rows); |
| 292 | } |
| 293 | |
| 294 | [HttpGet("/api/_stats/top-props")] |
| 295 | public async Task<IActionResult> EventProps([FromQuery] QueryParams body, CancellationToken cancellationToken) |
| 296 | { |
| 297 | var query = body.Parse(); |
| 298 | var rows = await _queryClient.NamedQueryAsync<EventPropsItem>("top_props__v2", new { |
| 299 | date_from = query.DateFrom?.ToString("yyyy-MM-dd HH:mm:ss"), |
| 300 | date_to = query.DateTo?.ToString("yyyy-MM-dd HH:mm:ss"), |
| 301 | granularity = (body.Granularity ?? GranularityEnum.Hour).ToString(), |