コード例 #1
0
        /// <summary>
        /// 扫码
        /// </summary>
        private void ScanHandler()
        {
            EUserInfo ui = _UserSrv.GetUserInfo(_wxMessage.FromUserName);

            if (ui != null)
            {
                _ResultMsg = _wxMessage.toText(WXReplyContent.UserComing(ui.wx_Name));
            }
            else
            {
                _ResultMsg = _wxMessage.toText(WXReplyContent.NewUserLook(ui.wx_Name));
            }
        }
コード例 #2
0
        /// <summary>
        /// 关注
        /// </summary>
        private void SubscribeHandler()
        {
            NLogHelper.InfoTxt("SubscribeHandler In");
            EUserInfo ui = _UserSrv.GetUserInfo(_wxMessage.FromUserName);

            if (ui == null)
            {
                var wxUser = WXApi.GetWXUserInfo(_wxMessage.FromUserName);
                ui = _UserSrv.AddOrUpdateFromWXUser(wxUser);

                _ResultMsg = _wxMessage.toText(WXReplyContent.NewUserAdd(ui.wx_Name));
            }
            else
            {
                _ResultMsg = _wxMessage.toText(WXReplyContent.UserComing(ui.wx_Name));
            }
        }