コード例 #1
0
        public async Task UpdateLastDestination(UpdateLastDestinationDto updateLastDestinationDto)
        {
            var tracker = _busTrackerRepository.Set.Single(bt => bt.BusId == updateLastDestinationDto.BusId);

            tracker.LastDestinationId = updateLastDestinationDto.LastDestinationId;
            tracker.CurrentLattitude  = updateLastDestinationDto.CurrentLocation.Lattitude;
            tracker.CurrentLongitude  = updateLastDestinationDto.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(updateLastDestinationDto.BusId);

            await _pushNotifyService.NotifyUsers(tracker);
        }
コード例 #2
0
        public async Task <TrackResponse> Notify(Guid busId)
        {
            TrackResponse response = await _service.BroadCast(busId);

            return(response);
        }