Exemplo n.º 1
0
        public HardwarePanelTokenDto RegisterHardwarePanel(DeviceRegistrationRequestDto deviceRegistrationRequest)
        {
            var hardwarePanelToken = new HardwarePanelToken
            {
                DeviceToken     = Guid.NewGuid().ToString(),
                HardwarePanelId = deviceRegistrationRequest.HardwarePanelId,
                CreatedDateTime = DateTime.Now,
                DeviceIpAddress = _accessor.HttpContext?.Connection.RemoteIpAddress?.ToString()
            };

            hardwarePanelToken = _hardwarePanelTokensRepository.SaveHardwarePanelToken(hardwarePanelToken);
            var hardwarePanelTokenDto = _mapper.Map <HardwarePanelToken, HardwarePanelTokenDto>(hardwarePanelToken);

            return(hardwarePanelTokenDto);
        }
Exemplo n.º 2
0
 public HardwarePanelTokenDto RegisterHardwarePanel(
     [FromBody] DeviceRegistrationRequestDto deviceRegistrationRequest)
 {
     return(_hardwarePanelService.RegisterHardwarePanel(deviceRegistrationRequest));
 }