Picture.Cut.Service/Dolphin.ExamPictureCut.Core/Extensions/NotifyExt.cs

20 lines
627 B
C#

using Flurl.Http;
namespace Dolphin.ExamPictureCut.Extensions;
public class NotifyExt
{
public static async Task DingTalk(string text)
{
await "https://oapi.dingtalk.com/robot/send?access_token=6ddafcada8f44f4bad4a7314c4d9bd19a895ded0a1ba1afdaff5dd01a5af6781".PostJsonAsync(new
{
msgtype = "markdown",
markdown = new
{
title = "异常通知",
text = $"dotpan,{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}异常\n > 来源:Dplphin.ExamPictureCut\n > 详情:" + text,
}
}).ReceiveString();
}
}