|
@@ -34,7 +34,7 @@ using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
using System.Xml.Linq;
|
|
|
using Azure.Storage.Sas;
|
|
|
using DocumentFormat.OpenXml.Drawing;
|
|
|
-using static TEAMModelOS.FunctionV4.HttpTrigger.IESHttpTrigger;
|
|
|
+using static TEAMModelOS.FunctionV4.IESHttpTrigger;
|
|
|
using System.Net.Http;
|
|
|
using System.Web;
|
|
|
using System.Net;
|
|
@@ -61,7 +61,8 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
private readonly IConfiguration _configuration;
|
|
|
private readonly IConverter _converter;
|
|
|
private readonly SnowflakeId _snowflakeId;
|
|
|
- public ActiveTaskTopic(SnowflakeId snowflakeId, IConverter converter, CoreAPIHttpService coreAPIHttpService,
|
|
|
+ private readonly HttpTrigger _httpTrigger;
|
|
|
+ public ActiveTaskTopic(HttpTrigger httpTrigger,SnowflakeId snowflakeId, IConverter converter, CoreAPIHttpService coreAPIHttpService,
|
|
|
AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis,
|
|
|
AzureServiceBusFactory serviceBus, IOptionsSnapshot<Option> option,
|
|
|
IConfiguration configuration)
|
|
@@ -76,6 +77,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
_coreAPIHttpService = coreAPIHttpService;
|
|
|
_converter = converter;
|
|
|
_snowflakeId = snowflakeId;
|
|
|
+ _httpTrigger=httpTrigger;
|
|
|
}
|
|
|
[Function("Exam")]
|
|
|
public async Task ExamFunc([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "exam", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
@@ -490,6 +492,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
try
|
|
|
{
|
|
|
//await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-名单成员变更-GroupChange\n{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"名单变化{msg}", GroupNames.成都开发測試群組);
|
|
|
var jsonMsg = JsonDocument.Parse(msg);
|
|
|
GroupChange groupChange = msg.ToObject<GroupChange>();
|
|
|
//名单变动修改学生课程关联信息
|
|
@@ -511,8 +514,9 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
await ActivityService.FixActivity(client, _dingDing, groupChange, "Art");
|
|
|
//TODO学习活动
|
|
|
//await FixActivity(client, stuListChange, "Learn");
|
|
|
- if (groupChange.type.Equals("class") || groupChange.type.Equals("student"))
|
|
|
+ if (groupChange.type.Equals("class") || groupChange.type.Equals("teach") || groupChange.type.Equals("student") )
|
|
|
{
|
|
|
+ await _httpTrigger.RequestHttpTrigger(new { data = groupChange }, Environment.GetEnvironmentVariable("Option:Location"), "webhook/group-member-change");
|
|
|
if (groupChange.stujoin.Count > 0)
|
|
|
await BIStats.SetTypeAddStats(client,_dingDing, groupChange.school, "Student", groupChange.stujoin.Count);//BI统计增/减量
|
|
|
if (groupChange.stuleave.Count > 0)
|
|
@@ -525,7 +529,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
await ActivityService.FixStuCourse(client, _dingDing, groupChange);
|
|
|
//名单变动修改课例关联信息
|
|
|
//await ActivityService.FixLessonRecord(client, _dingDing, groupChange);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|