修复导入用户学科问题
This commit is contained in:
parent
d28791558d
commit
4824180441
|
|
@ -201,7 +201,11 @@ namespace WGShare.API.Controllers.Backend
|
|||
else if (x.RoleId == "房间管理员")
|
||||
roleId = "3";
|
||||
x.RoleId = roleId;
|
||||
x.Subject = x.SubjectName.GetEnumValueFromDescription<SubjectType>();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(x.SubjectName))
|
||||
x.Subject = SubjectType.All;
|
||||
else
|
||||
x.Subject = x.SubjectName.GetEnumValueFromDescription<SubjectType>();
|
||||
});
|
||||
|
||||
await _sqlSugar.Insertable(users).ExecuteCommandAsync();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace WGShare.API.Controllers.Frontend
|
|||
this._agoraHelper = agoraHelper;
|
||||
this._configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost("event")]
|
||||
public async Task Event()
|
||||
|
|
@ -84,12 +84,13 @@ namespace WGShare.API.Controllers.Frontend
|
|||
switch (body.eventType)
|
||||
{
|
||||
case Domain.Enums.EventType.channel_create:
|
||||
CreateChannel(body);
|
||||
break;
|
||||
case Domain.Enums.EventType.channel_destroy:
|
||||
break;
|
||||
case Domain.Enums.EventType.broadcaster_join_channel:
|
||||
case Domain.Enums.EventType.audience_join_channel:
|
||||
JoinChannelEvent(bodyString);
|
||||
JoinChannelEvent(bodyString, body);
|
||||
break;
|
||||
case Domain.Enums.EventType.broadcaster_leave_channel:
|
||||
case Domain.Enums.EventType.audience_leave_channel:
|
||||
|
|
@ -103,7 +104,7 @@ namespace WGShare.API.Controllers.Frontend
|
|||
await ExceptionNotice.SendAsync(new Exception("声网事件未知类型"), "声网回调异常");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -111,10 +112,9 @@ namespace WGShare.API.Controllers.Frontend
|
|||
/// 加入频道
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
private void JoinChannelEvent(string bodyString)
|
||||
private void JoinChannelEvent(string bodyString, EventBody eventBody)
|
||||
{
|
||||
_logger.LogDebug($"Agora回调内容 加入频道:{bodyString}");
|
||||
|
||||
RedisHelper.Instance.LPush(RedisKeyConstant.PubSub.MeetingRecord, bodyString);
|
||||
}
|
||||
|
||||
|
|
@ -130,6 +130,14 @@ namespace WGShare.API.Controllers.Frontend
|
|||
RedisHelper.Instance.LPush(RedisKeyConstant.PubSub.MeetingRecord, bodyString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建频道
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
private void CreateChannel(EventBody eventBody)
|
||||
{
|
||||
ExceptionNotice.JoinAsync(eventBody);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,6 +234,9 @@ namespace WGShare.API.Controllers.Frontend
|
|||
|
||||
if (string.IsNullOrWhiteSpace(x.SubjectName))
|
||||
x.Subject = SubjectType.All;
|
||||
else
|
||||
x.Subject = x.SubjectName.GetEnumValueFromDescription<SubjectType>();
|
||||
|
||||
});
|
||||
|
||||
await _sqlSugar.Insertable(users).ExecuteCommandAsync();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
Agora接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WGShare.API.Controllers.Frontend.AgoraCallbackController.JoinChannelEvent(System.String)">
|
||||
<member name="M:WGShare.API.Controllers.Frontend.AgoraCallbackController.JoinChannelEvent(System.String,WGShare.Domain.DTOs.AgoraCallback.EventBody)">
|
||||
<summary>
|
||||
加入频道
|
||||
</summary>
|
||||
|
|
@ -83,6 +83,11 @@
|
|||
离开频道
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WGShare.API.Controllers.Frontend.AgoraCallbackController.CreateChannel(WGShare.Domain.DTOs.AgoraCallback.EventBody)">
|
||||
<summary>
|
||||
创建频道
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WGShare.API.Controllers.Frontend.HomeController">
|
||||
<summary>
|
||||
首页接口
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Net.Http.Json;
|
||||
using WGShare.Domain.DTOs.AgoraCallback;
|
||||
|
||||
namespace WGShare.Domain.FriendlyException
|
||||
{
|
||||
|
|
@ -39,6 +40,19 @@ namespace WGShare.Domain.FriendlyException
|
|||
return reponse.IsSuccessStatusCode;
|
||||
|
||||
}
|
||||
|
||||
public static async Task JoinAsync(EventBody eventBody)
|
||||
{
|
||||
var reponse = await httpClient.PostAsync(string.Empty, JsonContent.Create(new
|
||||
{
|
||||
msgtype = "markdown",
|
||||
markdown = new
|
||||
{
|
||||
title = "有人入会通知",
|
||||
text = $"有人进入会议室了,会议号:{eventBody.payload.channelName},点击查看:https://analytics-lab.agora.io/analytics/call/search?projectId=0tOpVUrmf"
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue