MCPcopy Create free account
hub / github.com/aptabase/aptabase / LiveGeo

Method LiveGeo

src/Features/Stats/StatsController.cs:319–336  ·  view source on GitHub ↗
([FromQuery] QueryParams body, CancellationToken cancellationToken)

Source from the content-addressed store, hash-verified

317
318 var rows = await _queryClient.NamedQueryAsync<LiveGeoDataPoint>("live_geo__v1", new {
319 app_id = query.AppId,
320 }, cancellationToken);
321
322 foreach (var row in rows)
323 {
324 var (lat, lng) = _geodb.GetLatLng(row.CountryCode, row.RegionName);
325 row.Latitude = lat;
326 row.Longitude = lng;
327 }
328
329 return Ok(rows);
330 }
331
332 [HttpGet("/api/_stats/live-sessions")]
333 public async Task<IActionResult> LiveSessions([FromQuery] QueryParams body, CancellationToken cancellationToken)
334 {
335 var query = body.Parse();
336
337 var rows = await _queryClient.NamedQueryAsync<LiveRecentSession>("live_sessions__v1", new {
338 app_id = query.AppId,
339 }, cancellationToken);

Callers

nothing calls this directly

Calls 2

ParseMethod · 0.80
GetLatLngMethod · 0.80

Tested by

no test coverage detected