/// <summary>
        /// 定时推送消息
        /// </summary>
        /// <param name="push"></param>
        /// <param name="baseMsg"></param>
        /// <param name="apMsgType"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        private async Task SendAutoPushMsg(WxAutoPushShow push, PubKfBaseMsg baseMsg, Enum_ApMsgType apMsgType, WxUserInfo user)
        {
            // 文本消息 昵称赋值
            if (apMsgType == Enum_ApMsgType.Text)
            {
                var txt = push.TextContent.Replace("{nickname}", user.NickName);
                baseMsg = new PubKfTextMsg {
                    text = new PubKfTextContent {
                        content = txt
                    }
                };
            }

            // 红包单独发送
            if (apMsgType == Enum_ApMsgType.RedBag)
            {
                var apiRes = await wxAutoConvertHelper.SendAutoPushRedPack(push, user.OpenId);

                logHelper.Debug("AutoPushJob:发送红包用户:" + user.OpenId + "     结果:" + apiRes);
            }
            else
            {
                // 非红包消息发送
                var apiRes = PubKfApi.SendMsg(baseMsg, user.OpenId);
                if (apiRes.IsSuss)
                {
                    await wxAutoConvertHelper.SaveAutoPushHis(push.Id, user.OpenId);
                }
                else
                {
                    logHelper.Error("AutoPushJob:发送消息给" + user.OpenId + "失败:" + apiRes.errcode + "      " + apiRes.errmsg);
                }

                logHelper.Debug("AutoPushJob:发送消息用户:" + user.OpenId + "     结果:" + apiRes.JsonSerialize());
            }
        }
        /// <summary>
        /// 自动应答(客服消息)
        /// </summary>
        /// <param name="item"></param>
        /// <param name="openId"></param>
        /// <returns></returns>
        public async Task <Result <string> > AutoRespond(WxAutoKeywordShow item, string openId)
        {
            try
            {
                // 自动推送类型
                Enum_ApMsgType type = ComHelper.GetEnumValueByStr <Enum_ApMsgType>(item.ContentType);
                // 发送客服消息预览
                PubApiResult apiRes = new PubApiResult();
                switch (type)
                {
                case Enum_ApMsgType.Text:
                    item.TextContent = item.TextContent.Replace("{nickname}", string.Empty);
                    apiRes           = PubKfApi.SendTextMsg(openId, item.TextContent);
                    break;

                case Enum_ApMsgType.Image:
                    apiRes = PubKfApi.SendImageMsg(openId, item.MediaId);
                    break;

                case Enum_ApMsgType.Voice:
                    apiRes = PubKfApi.SendVoiceMsg(openId, item.MediaId);
                    break;

                case Enum_ApMsgType.News:
                    apiRes = PubKfApi.SendMpNewsMsg(openId, item.MediaId);
                    break;

                case Enum_ApMsgType.Video:
                    apiRes = PubKfApi.SendVideoMsg(openId, item.MediaId, item.VideoThumbMediaId, item.VideoTitle, item.VideoDescription);
                    break;

                case Enum_ApMsgType.BackNews:
                    var lstArts = await wxAutoConvertHelper.GetAutoKeywordBackNews(item);

                    apiRes = PubKfApi.SendNewsMsg(openId, lstArts);
                    break;

                case Enum_ApMsgType.RedBag:
                    return(await wxAutoConvertHelper.SendAutoKeywordRedPack(item, openId));

                default:
                    break;
                }

                logHelper.Debug("PrevKeyword:预览返回结果:" + ComHelper.JsonSerialize(apiRes));
                if (!apiRes.IsSuss)
                {
                    var msg = "预览出错:" + apiRes.errcode + "    " + apiRes.errmsg;
                    logHelper.Error("PrevKeyword:" + msg);
                    return(new Result <string> {
                        Message = msg
                    });
                }

                return(new Result <string> {
                    IsSucc = true, Message = "发送预览消息成功!"
                });
            }
            catch (Exception ex)
            {
                logHelper.Error("PrevKeyword:发送预览消息失败:" + ex.Message + "     " + ex.StackTrace);
            }

            return(new Result <string> {
                Message = "发送预览消息失败!"
            });
        }
        /// <summary>
        /// 构造自动推送消息
        /// </summary>
        /// <param name="push"></param>
        /// <param name="baseMsg"></param>
        /// <param name="apMsgType"></param>
        /// <returns></returns>
        private async Task <PubKfBaseMsg> GetAutoPushMsg(WxAutoPushShow push, PubKfBaseMsg baseMsg, Enum_ApMsgType apMsgType)
        {
            switch (apMsgType)
            {
            // 文本(昵称)和红包消息需要单独发送
            case Enum_ApMsgType.Image:
                baseMsg = new PubKfImgMsg {
                    image = new PubKfImgContent {
                        media_id = push.MediaId
                    }
                };
                break;

            case Enum_ApMsgType.Voice:
                baseMsg = new PubKfVoiceMsg {
                    voice = new PubKfVoiceContent {
                        media_id = push.MediaId
                    }
                };
                break;

            case Enum_ApMsgType.Video:
                baseMsg = new PubKfVideoMsg {
                    video = new PubKfVideoContent {
                        media_id = push.MediaId, thumb_media_id = push.VideoThumbMediaId, title = push.VideoTitle, description = push.VideoDescription
                    }
                };
                break;

            case Enum_ApMsgType.News:
                baseMsg = new PubKfMpNewsMsg {
                    mpnews = new PubKfMpnewsContent {
                        media_id = push.MediaId
                    }
                };
                break;

            case Enum_ApMsgType.BackNews:
                var lstArts = await wxAutoConvertHelper.GetAutoPushBackNews(push);

                baseMsg = new PubKfNewsMsg {
                    news = new PubKfNewsContent {
                        articles = lstArts
                    }
                };
                break;

            default:
                break;
            }

            return(baseMsg);
        }