public async Task AddPointsTest() { var list = new List <Point>(); list.Add(new Point() { EntityName = "京Q8374W", LocTime = 1528706006, Latitude = 39.989715, Longitude = 116.437039, CoordTypeInput = "wgs84", Speed = 27.23, Direction = 178, Height = 173.3, Radius = 32, ObjectName = "12836" }); var requset = new AddPointsRequest() { PointList = list }; var result = await Manager.AddPointsAsync(requset); Assert.NotNull(result); Assert.Equal(0, result.Status); }
public HttpResponseMessage AddPoints(AddPointsRequest request) { var handler = Container.Resolve <IHandler <AddPointsRequest, AddPointsResponse> >(); var result = handler.Handle(request); return(Request.CreateResponse(HttpStatusCode.Created, result)); }
private bool AddPoints(AddPointsRequest request) { var existingSquares = _squaresStorage.RetrieveItems(request.ListName, 0, 0); var squares = ProcessPoints(_pointsStorage.RetrieveItems(request.ListName, 0, 0)).OrderBy(c => c.Points, new Square.SquareComparer()); _squaresStorage.AddToList(squares.Where(square => !existingSquares.Any(c => c.Equals(square))).ToList(), request.ListName); return(true); }