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.

46 lines
1.0 KiB
C#

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