using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
namespace Tianyi.DingtalkRobotKit
{
public class MarkdownMessage : MessageBase
{
public MarkdownMessage(MarkdownOption option) : base()
{
this.markdown = option;
}
public MarkdownMessage(MarkdownOption option, at linkAt) : base()
{
this.markdown = option;
this.at = linkAt;
}
public MarkdownOption markdown { get; set; }
///
/// 消息类型
///
public override string msgtype { get => "markdown"; }
///
/// 转换为json字符串
///
public override string ToJson()
{
var meaasge = new
{
msgtype = this.msgtype,
markdown = this.markdown,
at = this.at
};
string messageJson = JsonConvert.SerializeObject(meaasge);
return messageJson;
}
}
}