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.

26 lines
843 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DSWeb.Common.Helper
{
public static class DingTalkMessageHelper
{
/// <summary>
/// 发送钉钉群组消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="keywords">关键字</param>
/// <param name="url">webhook地址</param>
/// <returns></returns>
public static string SendGroupMessage(string title, string content, string keywords, string url)
{
var postdata = new { text = new { content = $"【{ title}】\r\n{content}\r\n----{keywords}" }, msgtype = "text" };
return WebRequestHelper.DoPostJson(url, postdata);
}
}
}