public IActionResult Post([FromBody] PayloadV2 payload)
        {
            // Check that the post data is good
            if (!this.ModelState.IsValid)
            {
                log.WarnFormat("ClassSerialisationV2 validation failed {0}", this.ModelState.Messages());

                return(this.BadRequest(this.ModelState));
            }
            log.Info($"DevEUI:{payload.hardware_serial} Payload Base64:{payload.payload_raw}");

            return(this.Ok());
        }
示例#2
0
        public IActionResult Post([FromBody] PayloadV2 payload)
        {
            // Check that the post data is good
            if (!this.ModelState.IsValid)
            {
                log.WarnFormat("ClassSerialisationV2Base64Decoded validation failed {0}", this.ModelState.Messages());

                return(this.BadRequest(this.ModelState));
            }

            log.Info($"DevEUI:{payload.hardware_serial} Port:{payload.port} Payload:{ Encoding.UTF8.GetString(Convert.FromBase64String(payload.payload_raw))}");

            return(this.Ok());
        }