Exemple #1
0
        public void FeedCardMessageTest()
        {
            FeedCardMessage message = new FeedCardMessage
            {
                feedCard = new FeedCardMessageItem
                {
                    links = new List <FeedCardLinkItem>
                    {
                        new FeedCardLinkItem
                        {
                            title      = "GitLab 90后泪目测试 曾被成为脑残一代的我们 长大了",
                            messageURL = "https://mp.weixin.qq.com/s/6N-i1S_ycvLJhVJiRmERZQ",
                            picURL     = "https://mmbiz.qpic.cn/mmbiz_png/0WvIQqWiafkkdibCvLibDXicfytDthFvjn4x8BefIqs058rPDYqiaFYqca2MOBezcwLqibngVRbL0KTMNnKhKITHuLHg/640?wx_fmt=gif&tp=webp&wxfrom=5&wx_lazy=1"
                        },
                        new FeedCardLinkItem
                        {
                            title      = "史卷 | 中国最神秘的一个城市,没有名称,只有一个代号404",
                            messageURL = "https://mp.weixin.qq.com/s/uKYfpdCoqRlokCiKLzIoEA",
                            picURL     = ""
                        }
                    }
                }
            };

            var result = DingtalkClient.SendMessageAsync(webHookUrl, message).Result;

            Assert.Equal(0, result.errcode);
        }
        public void TestMethod7()
        {
            IDingDingMessage msg = new FeedCardMessage
            {
                FeedCardItems = new List <FeedCardItem>
                {
                    new FeedCardItem
                    {
                        Title      = "时代的火车向前开",
                        MessageURL = "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
                        PicURL     = "https://www.dingtalk.com/"
                    },
                    new FeedCardItem
                    {
                        Title      = "时代的火车向前开2",
                        MessageURL = "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
                        PicURL     = "https://www.dingtalk.com/"
                    }
                }
            };

            DingDingClient.SendMessageAsync(WebHookUrl, msg).Wait();
        }