|
@@ -71,46 +71,42 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(stu?.channel) && !string.IsNullOrWhiteSpace(stu?.userid))
|
|
|
{
|
|
|
- var serviceManager = _azureSignalR.GetServiceManager();
|
|
|
- var cancel = new CancellationToken();
|
|
|
- var hub = await serviceManager.CreateHubContextAsync($"C{stu.channel}", cancel);
|
|
|
- try
|
|
|
+ var hub = _azureSignalR.GetServiceManager().GetHubContext($"C{stu.channel}");
|
|
|
+ //var cancel = new CancellationToken();
|
|
|
+ //using var hub = await serviceManager.CreateHubContextAsync($"C{stu.channel}", cancel);
|
|
|
+
|
|
|
+ var con = content.GetString();
|
|
|
+ var ans = con switch
|
|
|
{
|
|
|
- var con = content.GetString();
|
|
|
- var ans = con switch
|
|
|
- {
|
|
|
- string _ when con.Length == 1 => new string[] { con },
|
|
|
- string _ when con.Contains('+', StringComparison.OrdinalIgnoreCase) => con.Split('+'),
|
|
|
- string _ when con.Equals("true", StringComparison.OrdinalIgnoreCase) => new string[] { "A" },
|
|
|
- string _ when con.Equals("false", StringComparison.OrdinalIgnoreCase) => new string[] { "B" },
|
|
|
- _ => throw new ArgumentNullException(nameof(content))
|
|
|
- };
|
|
|
+ string _ when con.Length == 1 => new string[] { con },
|
|
|
+ string _ when con.Contains('+', StringComparison.OrdinalIgnoreCase) => con.Split('+'),
|
|
|
+ string _ when con.Equals("true", StringComparison.OrdinalIgnoreCase) => new string[] { "A" },
|
|
|
+ string _ when con.Equals("false", StringComparison.OrdinalIgnoreCase) => new string[] { "B" },
|
|
|
+ _ => throw new ArgumentNullException(nameof(content))
|
|
|
+ };
|
|
|
|
|
|
- var common = JsonSerializer.Serialize(new
|
|
|
- {
|
|
|
- action = "DirectIRS.Answer",
|
|
|
- clientType = "DI",
|
|
|
- sender = stu.stuid,
|
|
|
- timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
- waitReturn = false,
|
|
|
- payload = new { irsno = "", answer = ans }
|
|
|
- });
|
|
|
+ var common = JsonSerializer.Serialize(new
|
|
|
+ {
|
|
|
+ action = "DirectIRS.Answer",
|
|
|
+ clientType = "DI",
|
|
|
+ sender = stu.stuid,
|
|
|
+ timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
+ waitReturn = false,
|
|
|
+ payload = new { irsno = "", answer = ans }
|
|
|
+ });
|
|
|
|
|
|
- await hub.Clients.User(stu.userid).SendCoreAsync("onMessage", new[]{new {
|
|
|
+ await hub.Clients.User(stu.userid).SendCoreAsync("onMessage", new[]{new {
|
|
|
connectionId = (string)null,
|
|
|
to = (string)null,
|
|
|
groupname = (string)null,
|
|
|
sender = stu.stuid,
|
|
|
text = common
|
|
|
}});
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- hub.Dispose();
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},tianbo/api/course/cardUploadData()\n{stu?.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
- await _dingDing.SendBotMsg($"IES5,{_option.Location},tianbo/api/course/cardUploadData()\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+
|
|
|
return Ok(new { code = 200, msg = "成功", data = (string)null });
|
|
|
}
|
|
|
catch (Exception ex)
|