示例#1
0
        public async Task <IActionResult> SendPoint([FromBody] Point point)
        {
            var msg = JsonConvert.SerializeObject(new
            {
                Type = "Point",
                Msg  = JsonConvert.SerializeObject(point)
            });
            await _eventHubService.SendMsg(msg);

            return(Json(new { result = "ok" }));
        }
示例#2
0
        public async Task <IActionResult> SendGeoTracking([FromRoute] int raptorId, [FromBody] int geneticMutationId)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var msg = JsonConvert.SerializeObject(new
                    {
                        Type = "AssignGeneticMutation",
                        Msg  = new { RaptorId = raptorId, GeneticMutationId = geneticMutationId }
                    });
                    await _eventHubService.SendMsg(msg);

                    return(Ok());
                }

                return(BadRequest());
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }
        }