Ejemplo n.º 1
0
        private Task HandleStoreCatalogReady(Message message, CancellationToken arg2)
        {
            try
            {
                _logService.SendMessagesAsync($"- Iniciando leitura de HandleStoreCatalogReady");

                var messageString = "";
                if (message.Body != null)
                {
                    messageString = Encoding.UTF8.GetString(message.Body);
                }

                ShowDisplayMessage showDisplayMessage = new ShowDisplayMessage();

                showDisplayMessage.Properties = new Dictionary <String, Object>();
                showDisplayMessage.Properties.Add("ServicoEnvio", "GeekBurger.UI");
                showDisplayMessage.Label = "showwelcomepage";
                showDisplayMessage.Body  = "Exibir página de boas vindas";
                _showDisplayService.AddMessage(showDisplayMessage);
                _showDisplayService.SendMessagesAsync(Topics.uicommand);

                return(Task.CompletedTask);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public void CatalogVerify()
        {
            //Ready ready = _metodosApi.retornoGet<Ready>("http://localhost:50135/Mock/api/store");


            Ready ready = _metodosApi.retornoGet <Ready>("http://geekburgerstorecatalog.azurewebsites.net/api/store");


            ShowDisplayMessage showDisplayMessage = new ShowDisplayMessage();

            showDisplayMessage.Properties = new Dictionary <String, Object>();
            showDisplayMessage.Properties.Add("ServicoEnvio", "GeekBurger.UI");


            if (ready?.IsReady == true)
            {
                showDisplayMessage.Label = "showwelcomepage";
                showDisplayMessage.Body  = "Exibir página de boas vindas";
            }
            else
            {
                showDisplayMessage.Label = "storeunavailable";
                showDisplayMessage.Body  = "Catálogo não disponível";
            }

            _showDisplayService.AddMessage(showDisplayMessage);
            _showDisplayService.SendMessagesAsync(Topics.uicommand);
        }
Ejemplo n.º 3
0
        public IActionResult PostOrder([FromBody] OrderToUpsert order)
        {
            ShowDisplayMessage showDisplayMessage = new ShowDisplayMessage();

            showDisplayMessage.Properties = new Dictionary <String, Object>();
            showDisplayMessage.Properties.Add("ServicoEnvio", "GeekBurger.UI");

            showDisplayMessage.Label = "NewOrder";
            showDisplayMessage.Body  = order;
            _showDisplayService.AddMessage(showDisplayMessage);
            _showDisplayService.SendMessagesAsync(Topics.neworder);


            return(CreatedAtRoute("GetFace",
                                  new { OrderId = orderToGet.OrderId },
                                  orderToGet));
        }