マイクロチャネルのマイクロチャネル構造の使用リベートアシスタントロボット

リベート淘宝網公衆マイクロチャンネル番号を、顧客を行う前に、そして多くの人々は今、アシスタントが良いマイクロチャネル、マイクロチャネルは、マイクロ文字リベートロボットアシスタントのインタフェース機能を介して達成することができる開発し、マイクロチャネルリベートロボットを述べました。
次のようにプロセスは以下のとおりです。

以下は、コードのC#のインターフェイスを実装する部分リベートです。

    [HttpPost]
    public async Task<ActionResult> FanliAsync(string appkey)
    {
        WeixinTBKConfigEntity configEntity = GetConfigEntity(appkey);
        if (configEntity == null)
        {
            LogHelper.WriteLog(typeof(OtherWechatController), "appkey接口验证时,appkey不存在");
            return Content("验证失败。appkey接口验证时,appkey不存在");

        }

        Request.InputStream.Position = 0;
        Stream stream = Request.InputStream;
        string json = string.Empty;
        if (stream.Length != 0)
        {
            StreamReader streamreader = new StreamReader(stream);
            json = streamreader.ReadToEnd();
        }

        WeChatToolMessage responseMsg = new WeChatToolMessage();

        if (string.IsNullOrEmpty(json))
        {
            return Json(responseMsg);
        }

        WeChatToolMessage msg = JsonConvert.DeserializeObject<WeChatToolMessage>(json);

        if (string.IsNullOrEmpty(msg.wxid) || string.IsNullOrEmpty(msg.content))
        {
            return Json(responseMsg);
        }

        string content = msg.content;

        string responseStr = string.Empty;

        if (content.Contains("yangkeduo.com"))
        {
            //访问拼多多接口
            responseStr = await GetPddCouponAsync(configEntity, msg);

        }
        else if (content.Contains("jd.com"))
        {
            if (!string.IsNullOrEmpty(configEntity.JdPID))
            {
                //访问京东联盟接口
                responseStr = GetJdCoupon(configEntity, msg);
            }      
        }

        else
        {
            //访问淘宝联盟接口
            responseStr = GetTBKCouponByPassword(configEntity, msg.content);
        }

        responseMsg.wxid = msg.wxid;
        responseMsg.content = responseStr;

        return Json(responseMsg);
    }

以下に示すように、マイクロチャネルインタフェース・アドレス・アシスタント「自動応答」メニューのURL入力欄に記入しますインターフェイスを公開した後:
キャプチャ2.JPG

ここでは、チェックチケットを開始することができ、それは非常に簡単ではありません。

0190917171456.png
20190917171448.png

アシスタントのマイクロチャネルは、ここからダウンロードすることができます:http://blog.yshizi.cn/104.htmlは、
マイクロ文字を追加してくださいリベートインタフェースを必要とznana2019

おすすめ

転載: www.cnblogs.com/gracexu/p/11540136.html