|
@@ -63,7 +63,7 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
|
|
|
//https://docs.azure.cn/zh-cn/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp
|
|
|
//0 1 * * * * 一天中每小时的第 1 分钟
|
|
|
//0 */10 * * * * 每五分钟一次
|
|
|
- public async Task FireWallFileLog([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
|
|
|
+ public async Task FireWallFileLog([TimerTrigger("0 1 * * * *")] TimerInfo myTimer, ILogger log)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -90,18 +90,23 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
|
|
|
string publishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retn.saveUrls.First(),Encoding.UTF8)}&time={HttpUtility.UrlEncode(datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时"),Encoding.UTF8)}";
|
|
|
string ulrs = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retn.saveUrls.First()}&time={datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时")}";
|
|
|
string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=980&url={HttpUtility.UrlEncode(ulrs,Encoding.UTF8)}&delay=5000";
|
|
|
+ string image = "";
|
|
|
try
|
|
|
{
|
|
|
string strs = await _httpClient.GetStringAsync(ulr);
|
|
|
if (!string.IsNullOrWhiteSpace(strs)) {
|
|
|
JsonElement json = strs.ToObject<JsonElement>();
|
|
|
json.TryGetProperty("url", out JsonElement base64);
|
|
|
+ using (MemoryStream ms = new MemoryStream(Convert.FromBase64String($"{base64}"))) {
|
|
|
+ image = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer( ms, $"visitCnt/{y}{m}{d}", $"{y}{m}{d}{h}.png",false);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex) {
|
|
|
|
|
|
}
|
|
|
- await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]()\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
|
|
|
+ await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> \n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
|
|
|
$" [发布地址]({publishUrl}) \n", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|