You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Tianyi.DingtalkRobotKit
|
|
|
|
|
{
|
|
|
|
|
public class LinkMessage : MessageBase
|
|
|
|
|
{
|
|
|
|
|
public LinkMessage(LinkOption option) : base()
|
|
|
|
|
{
|
|
|
|
|
this.link = option;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LinkMessage(LinkOption option,at linkAt) : base()
|
|
|
|
|
{
|
|
|
|
|
this.link = option;
|
|
|
|
|
this.at = linkAt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LinkOption link { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 消息类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override string msgtype { get => "link"; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 转换为json字符串
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override string ToJson()
|
|
|
|
|
{
|
|
|
|
|
var meaasge = new
|
|
|
|
|
{
|
|
|
|
|
msgtype = this.msgtype,
|
|
|
|
|
link = this.link,
|
|
|
|
|
at = this.at
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string messageJson = JsonConvert.SerializeObject(meaasge);
|
|
|
|
|
|
|
|
|
|
return messageJson;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|