|
@@ -133,7 +133,6 @@ namespace TEAMModelOS.FunctionV4
|
|
|
tag = 0;
|
|
|
}
|
|
|
|
|
|
- string notifyCode = string.Empty;
|
|
|
List<IdNameCode> ids = new List<IdNameCode>();
|
|
|
Teacher teacher = null;
|
|
|
School school = null;
|
|
@@ -141,7 +140,6 @@ namespace TEAMModelOS.FunctionV4
|
|
|
if (scope.Equals("school", StringComparison.OrdinalIgnoreCase))
|
|
|
{
|
|
|
school = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(name, new PartitionKey("Base"));
|
|
|
- notifyCode = "blob-space-school-notify";
|
|
|
string sql = $"select value c from c where c.code='Teacher-{name}' and c.status='join' and array_contains(c.roles,'admin') ";
|
|
|
List<SchoolTeacher> adminTeachers = new List<SchoolTeacher>();
|
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School)
|
|
@@ -163,7 +161,6 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- notifyCode = "blob-space-private-notify";
|
|
|
teacher= await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReadItemAsync<Teacher>(name, new PartitionKey("Base"));
|
|
|
ids.Add(new IdNameCode
|
|
|
{
|
|
@@ -188,9 +185,6 @@ namespace TEAMModelOS.FunctionV4
|
|
|
|
|
|
if (blobSpaceNotify == null)
|
|
|
{
|
|
|
- blobSpaceNotify = new BlobSpaceNotify { };
|
|
|
- await _azureRedis.GetRedisClient(8).HashSetAsync(key, name, blobSpaceNotify.ToJsonString());
|
|
|
-
|
|
|
if ("school".Equals(scope, StringComparison.OrdinalIgnoreCase))
|
|
|
{
|
|
|
_coreAPIHttpService.PushNotify(ids, $"blob-space-school-notify", Constant.NotifyType_IES5_Management,
|
|
@@ -204,6 +198,9 @@ namespace TEAMModelOS.FunctionV4
|
|
|
new Dictionary<string, object> { { "tmdname", name }, { "percent", $"{tag}" }, { "tmdid", idnamecode.id } },
|
|
|
$"{Environment.GetEnvironmentVariable("Option:Location")}", _configuration, _dingDing, "");
|
|
|
}
|
|
|
+ blobSpaceNotify = new BlobSpaceNotify { id = idnamecode.id, tag = tag, containerName = name, scope = scope, notifyIndex = Guid.NewGuid().ToString() };
|
|
|
+ await _azureRedis.GetRedisClient(8).HashSetAsync(key, name, blobSpaceNotify.ToJsonString());
|
|
|
+ await _azureRedis.GetRedisClient(8).KeyExpireAsync(key, new TimeSpan(hours:7*24,minutes:0,seconds:0));
|
|
|
}
|
|
|
else {
|
|
|
//已经发送过的不在提交
|
|
@@ -216,13 +213,16 @@ namespace TEAMModelOS.FunctionV4
|
|
|
//撤销
|
|
|
var index = blobSpaceNotify.notifyIndex;
|
|
|
await _azureRedis.GetRedisClient(8).HashDeleteAsync(key, filed);
|
|
|
+ _coreAPIHttpService.CancelNotify(index, $"{Environment.GetEnvironmentVariable("Option:Location")}", _configuration);
|
|
|
}
|
|
|
- //等撤销
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- catch (Exception ex) { }
|
|
|
+ catch (Exception ex) {
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},空间不足,通知发送处理异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ }
|
|
|
return response;
|
|
|
}
|
|
|
|