|
@@ -0,0 +1,54 @@
|
|
|
+using Azure.Cosmos;
|
|
|
+using Azure.Storage.Blobs.Models;
|
|
|
+using HTEXLib.COMM.Helpers;
|
|
|
+using Microsoft.Azure.Cosmos.Table;
|
|
|
+using Microsoft.Azure.Functions.Worker;
|
|
|
+using Microsoft.Azure.Functions.Worker.Http;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
+using StackExchange.Redis;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.IO;
|
|
|
+using System.Linq;
|
|
|
+using System.Net;
|
|
|
+using System.Reflection;
|
|
|
+using System.Text;
|
|
|
+using System.Text.Json;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using TEAMModelOS.SDK;
|
|
|
+using TEAMModelOS.SDK.DI;
|
|
|
+using TEAMModelOS.SDK.Extension;
|
|
|
+using TEAMModelOS.SDK.Models;
|
|
|
+using TEAMModelOS.SDK.Models.Cosmos.Teacher;
|
|
|
+using TEAMModelOS.SDK.Models.Service.BI;
|
|
|
+using TEAMModelOS.SDK.Models.Table;
|
|
|
+using static TEAMModelOS.SDK.Models.Teacher;
|
|
|
+
|
|
|
+namespace TEAMModelOS.FunctionV4.HttpTrigger
|
|
|
+{
|
|
|
+ public class IESTimerTrigger
|
|
|
+ {
|
|
|
+ private readonly AzureCosmosFactory _azureCosmos;
|
|
|
+ private readonly DingDing _dingDing;
|
|
|
+ private readonly AzureStorageFactory _azureStorage;
|
|
|
+ private readonly AzureRedisFactory _azureRedis;
|
|
|
+ public IESTimerTrigger(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis)
|
|
|
+ {
|
|
|
+ _azureCosmos = azureCosmos;
|
|
|
+ _dingDing = dingDing;
|
|
|
+ _azureStorage = azureStorage;
|
|
|
+ _azureRedis = azureRedis;
|
|
|
+ } /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="req"></param>
|
|
|
+ /// <param name="log"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Function("FireWallFileLog")]
|
|
|
+ //https://docs.azure.cn/zh-cn/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp
|
|
|
+ //一天中每小时的第 1 分钟
|
|
|
+ public async Task FireWallFileLog([TimerTrigger("0 1 * * * *")] TimerInfo myTimer, ILogger log) {
|
|
|
+ await _dingDing.SendBotMsg($"FireWallFileLog 防火墙日志记录(测试): {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}", GroupNames.成都开发測試群組);
|
|
|
+ BILogAnalyseService.GetPathAnalyse(_azureStorage,"",);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|