示例#1
0
        public async Task UpdateCurrentLocation(UpdateCurrentLocationDto updateCurrentLocationDto)
        {
            var tracker = _busTrackerRepository.Set.Single(bt => bt.BusId == updateCurrentLocationDto.BusId);

            tracker.CurrentLattitude = updateCurrentLocationDto.CurrentLocation.Lattitude;
            tracker.CurrentLongitude = updateCurrentLocationDto.CurrentLocation.Longitude;

            await _entityService.SaveAsync(CancellationToken.None);

            var trackResponse = await _trackService.GetTrack(tracker.BusId);

            tracker.CurrentRouteStatus = JsonConvert.SerializeObject(trackResponse.Places);

            await _entityService.SaveAsync(CancellationToken.None);

            await _broadCastService.BroadCast(updateCurrentLocationDto.BusId);
        }
示例#2
0
        public async Task <OkResult> UpdateCurrentLocation(UpdateCurrentLocationDto updateCurrentLocationDto)
        {
            await _busTrackService.UpdateCurrentLocation(updateCurrentLocationDto);

            return(Ok());
        }