更新 docker-compose.yml 中的媒体文件路径,移除 JobTriggerController 和 NotifyController 中的未使用代码
This commit is contained in:
@@ -4,34 +4,6 @@ namespace Core;
|
||||
|
||||
public static class WxNotify
|
||||
{
|
||||
public static async Task SendDiskInfoAsync(string msg)
|
||||
{
|
||||
// 晚上11点到早上8点不通知,输出到控制台
|
||||
if (DateTime.Now.Hour >= 23 || DateTime.Now.Hour < 8)
|
||||
{
|
||||
Console.WriteLine("======================Skip WxNotify======================");
|
||||
Console.WriteLine(msg);
|
||||
Console.WriteLine("======================Skip WxNotify======================");
|
||||
return;
|
||||
}
|
||||
|
||||
var wxRebotUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=96f9fa23-a959-4492-ac3a-7415fae19680";
|
||||
var client = new HttpClient();
|
||||
var requestBody =
|
||||
"""
|
||||
{
|
||||
"msgtype": "markdown",
|
||||
"markdown": {
|
||||
"content": "{Msg}"
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
// 转义
|
||||
requestBody = requestBody.Replace("{Msg}", msg.Replace("\r\n", "\n"));
|
||||
await client.PostAsync(wxRebotUrl, new StringContent(requestBody, Encoding.UTF8, "application/json"));
|
||||
}
|
||||
|
||||
public static async Task SendCommonAsync(string msg)
|
||||
{
|
||||
var wxRebotUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=96f9fa23-a959-4492-ac3a-7415fae19680";
|
||||
|
||||
Reference in New Issue
Block a user