예제 #1
0
        public async Task <JsonResult> Trip(int tripId, long since)
        {
            List <Location> locs = await tripaccessor_.GetTripLocations(tripId, TRIPSTATUS.RUNNING, since);

            if (locs == null)
            {
                HttpContext.Response.StatusCode = 404;
                return(Json(new ErrorJSONResult("Not found")));
            }
            return(Json(locs));
        }
        public async Task <JsonResult> DownloadTrip(int tripId)
        {
            Console.WriteLine("Archive");
            List <Location> locs = await tripaccessor_.GetTripLocations(tripId, TRIPSTATUS.TERMINATED, -1);

            if (locs == null)
            {
                HttpContext.Response.StatusCode = 404;
                return(Json(null));
            }
            return(Json(locs));
        }