|
@@ -48,7 +48,7 @@ namespace TEAMModelFunction
|
|
|
_notificationService = notificationService;
|
|
|
_configuration = configuration;
|
|
|
}
|
|
|
- [FunctionName("Exam")]
|
|
|
+ [FunctionName("AsbExam")]
|
|
|
public async Task Exam([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "exam", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -73,7 +73,7 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("Vote")]
|
|
|
+ [FunctionName("AsbVote")]
|
|
|
public async Task Vote([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "vote", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -97,7 +97,7 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("Correct")]
|
|
|
+ [FunctionName("AsbCorrect")]
|
|
|
public async Task Correct([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "correct", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -121,7 +121,7 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("Survey")]
|
|
|
+ [FunctionName("AsbSurvey")]
|
|
|
public async Task Survey([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "survey", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -145,7 +145,7 @@ namespace TEAMModelFunction
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()\n{ex.Message}\n{ex.StackTrace}\n{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
}
|
|
|
- [FunctionName("Homework")]
|
|
|
+ [FunctionName("AsbHomework")]
|
|
|
public async Task Homework([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "homework", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -168,7 +168,7 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("Study")]
|
|
|
+ [FunctionName("AsbStudy")]
|
|
|
public async Task Study([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "study", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -192,7 +192,7 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("ExamLite")]
|
|
|
+ [FunctionName("AsbExamLite")]
|
|
|
public async Task ExamLite([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "examlite", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -216,37 +216,13 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- [FunctionName("Blob")]
|
|
|
- public async Task Blob([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "blob", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
|
|
|
- try
|
|
|
- {
|
|
|
- //11 await _dingDing.SendBotMsg($"ServiceBus,Blob(){msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
- var jsonMsg = JsonDocument.Parse(msg);
|
|
|
- if(jsonMsg.RootElement.TryGetProperty("name", out JsonElement name)&& name.ValueKind==JsonValueKind.String)
|
|
|
- {
|
|
|
- var client = _azureStorage.GetBlobContainerClient($"{name}");
|
|
|
- var size = await client.GetBlobsCatalogSize();
|
|
|
- await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", new RedisValue($"{name}"), new RedisValue($"{long.Parse($"{size.Item1}")}"));
|
|
|
- foreach (var key in size.Item2.Keys)
|
|
|
- {
|
|
|
- await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{name}", key);
|
|
|
- await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", key, size.Item2[key].HasValue ? size.Item2[key].Value : 0);
|
|
|
- }
|
|
|
- //await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Blob() 容器:{name}使用:{size.Item1},文件分类:{size.Item2.ToJsonString()}",
|
|
|
- // GroupNames.成都开发測試群組);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Blob()\n{ex.Message}\n{ex.StackTrace}\n{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 根据容器的根目录刷新redis并获取redis的最新使用情况
|
|
|
/// </summary>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
|
- [FunctionName("BlobRoot")]
|
|
|
+ [FunctionName("AsbBlobRoot")]
|
|
|
public async Task BlobRoot([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "blobroot", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -368,7 +344,7 @@ namespace TEAMModelFunction
|
|
|
///// </data>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
|
- [FunctionName("TeacherTrainChange")]
|
|
|
+ [FunctionName("AsbTeacherTrainChange")]
|
|
|
public async Task TeacherTrainChange([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "teacher-train-change", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
|
|
|
try {
|
|
|
|
|
@@ -496,7 +472,7 @@ namespace TEAMModelFunction
|
|
|
///// </data>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
|
- [FunctionName("GroupChange")]
|
|
|
+ [FunctionName("AsbGroupChange")]
|
|
|
public async Task GroupChange([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "group-change", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -535,7 +511,7 @@ namespace TEAMModelFunction
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-GroupChange-GroupChange\n{ex.Message}\n{ex.StackTrace}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
- [FunctionName("ItemCond")]
|
|
|
+ [FunctionName("AsbItemCond")]
|
|
|
public async Task ItemCond([ServiceBusTrigger("%Azure:ServiceBus:ItemCondQueue%", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|
|
@@ -751,7 +727,7 @@ namespace TEAMModelFunction
|
|
|
/// </summary>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
|
- [FunctionName("CopyStandardFile")]
|
|
|
+ [FunctionName("AsbCopyStandardFile")]
|
|
|
public async Task BatchCopyBlob([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "copy-standard-file", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
{
|
|
|
try
|