示例#1
0
        public IActionResult CreateCustomerInteractionRecord([FromBody] CreateCustomerInteractionRequest createCustomerInteraction)
        {
            _logger.LogInformation($"CreateCustomerInteractionRecord({nameof(createCustomerInteraction)}: {createCustomerInteraction.ToJson()}");
            IActionResult result;
            Task <GetCustomerInteractionResponse> customerProfile = null;

            try
            {
                HttpContext.Request.Headers.TryGetValue("Authorization", out StringValues jwt);

                customerProfile = _customerLogic.CreateCustomerInteractionRecord(createCustomerInteraction, jwt);
                if (customerProfile.Result.Success == "true")
                {
                    result = Ok(customerProfile);
                }
                else
                {
                    result = BadRequest(customerProfile);
                }
            }
            catch (Exception e)
            {
                _logger.LogError(e, e.Message);

                result = e.ToActionResult();
            }

            return(result);
        }