/// <summary>
        /// 请求api替换其中占位符
        /// </summary>
        /// <param name="answer"></param>
        /// <param name="dingCode"></param>
        /// <returns></returns>
        private async Task <DialogDto> ReplaceAnswer(QandA answer, string conversationId)
        {
            if (!string.IsNullOrWhiteSpace(answer.RequestUrl))
            {
                if (string.IsNullOrWhiteSpace(_ddUser?.UserId))
                {
                    // 没有获取到钉钉userId
                    _logger.LogError("没有获取到 当前钉钉用户信息。");
                    return(new DialogDto(conversationId, "不好意思,小摩摩未能认出你,所以不能回答你😥。"));
                }

                var parameters  = new Dictionary <string, string>();
                var queryParams = await _context.AnswerQueries
                                  .Where(q => q.AnswerId == answer.Id)
                                  .Include(q => q.Parameter)?
                                  .ToListAsync();

                if (queryParams?.Count > 0)
                {
                    foreach (var item in queryParams)
                    {
                        var key   = string.IsNullOrEmpty(item.Alias) ? item.Parameter.Name : item.Alias;
                        var value = GetParameterValue(item.Parameter.Name);
                        parameters.Add(key, value);
                    }
                }
                parameters.Add("token", DingDingScrypt.jEncrypt("DING" + DingDingScrypt.GetTimeSpanByDate()));
                var holder = await SendHttpRequestAsync((RequestMethods)answer.Method, answer.RequestUrl, parameters);

                // 发生了错误
                if (holder.Contains("ERROR"))
                {
                    _logger.LogError($"请求值发生错误 {holder}");
                    answer.Answer = "没有找到相关信息!";
                }
                else
                {
                    answer.Answer = answer.Answer.Replace("[$h]", holder);
                }
            }
            return(new DialogDto(conversationId, answer.Id, answer.Intent, answer.Answer));
        }
 /// <summary>
 /// 获取请求参数的值
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dingUserId">钉钉用户id</param>
 /// <returns></returns>
 private string GetParameterValue(string name)
 {
     // TODO : 参数获取途径
     if (name.Equals("userName", StringComparison.OrdinalIgnoreCase))
     {
         if (!string.IsNullOrWhiteSpace(_ddUser.UserName))
         {
             return(DingDingScrypt.jEncrypt(_ddUser.UserName));
         }
     }
     else if (name.Equals("email", StringComparison.OrdinalIgnoreCase))
     {
         if (!string.IsNullOrWhiteSpace(_ddUser?.Email))
         {
             return(DingDingScrypt.jEncrypt(_ddUser.Email));
         }
     }
     else
     {
         _logger.LogError($"请求参数{name}没有设定值!");
     }
     return(string.Empty);
 }