parent
40bf8cc5ba
commit
ebfd8b9fb7
|
|
@ -165,9 +165,18 @@ namespace WGShare.API.Controllers.Frontend
|
|||
return;
|
||||
}
|
||||
|
||||
if(existsChannel.TryAdd(eventBody.payload.channelName, 0))
|
||||
if (existsChannel.TryAdd(eventBody.payload.channelName, 0))
|
||||
{
|
||||
ExceptionNotice.JoinAsync(eventBody);
|
||||
var roomInfo = await _sqlSugarClient.Queryable<Room>()
|
||||
.LeftJoin<Tenant>((r, t) => r.TenantId == t.Id)
|
||||
.Where((r, t) => r.RoomNum == eventBody.payload.channelName)
|
||||
.Select((r, t) => new Room
|
||||
{
|
||||
Id = r.Id.SelectAll(),
|
||||
TenantName = t.TenantName
|
||||
})
|
||||
.FirstAsync();
|
||||
ExceptionNotice.JoinAsync(eventBody, roomInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -371,5 +371,17 @@ namespace WGShare.API.Controllers.Frontend
|
|||
await _sqlSugar.Insertable(entity).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录用户当前用户版本
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("ver-log")]
|
||||
public async Task RecordVersionLog([FromBody] UserVersionLogDto userVersionLog)
|
||||
{
|
||||
var uvl = userVersionLog.Adapt<UserVersionLog>();
|
||||
uvl.UserId = UId.ToInt64();
|
||||
await _sqlSugar.Insertable(uvl).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,6 +162,12 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WGShare.API.Controllers.Frontend.HomeController.RecordVersionLog(WGShare.Domain.DTOs.Home.UserVersionLogDto)">
|
||||
<summary>
|
||||
记录用户当前用户版本
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WGShare.API.Controllers.Frontend.RoomController">
|
||||
<summary>
|
||||
会议室接口
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace WGShare.Domain.DTOs.Home
|
||||
{
|
||||
public class UserVersionLogDto
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 使用版本
|
||||
///</summary>
|
||||
public string Version { get; set; }
|
||||
/// <summary>
|
||||
/// 平台类型 1:PC 2:微信小程序
|
||||
///</summary>
|
||||
public int PlatformType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房间号
|
||||
///</summary>
|
||||
public string RoomNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -68,5 +68,12 @@ namespace WGShare.Domain.Entities
|
|||
///</summary>
|
||||
[SugarColumn(ColumnName = "allow_anonymous")]
|
||||
public bool AllowAnonymous { get; set; } = true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 租户名称
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string TenantName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace WGShare.Domain.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户版本记录表
|
||||
/// </summary>
|
||||
[SugarTable("user_version_log")]
|
||||
public class UserVersionLog
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public string Id { get; set; } = YitIdHelper.NextId().ToString();
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "user_id")]
|
||||
public long UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 使用版本
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "version")]
|
||||
public string Version { get; set; }
|
||||
/// <summary>
|
||||
/// 平台类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "platform_type")]
|
||||
public int PlatformType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房间号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "room_num")]
|
||||
public string RoomNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进房时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "join_time", IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
|
||||
public DateTime JoinTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using System.Net.Http.Json;
|
||||
using WGShare.Domain.DTOs.AgoraCallback;
|
||||
using WGShare.Domain.Entities;
|
||||
|
||||
namespace WGShare.Domain.FriendlyException
|
||||
{
|
||||
|
|
@ -41,7 +42,7 @@ namespace WGShare.Domain.FriendlyException
|
|||
|
||||
}
|
||||
|
||||
public static async Task JoinAsync(EventBody eventBody)
|
||||
public static async Task JoinAsync(EventBody eventBody, Room roomInfo)
|
||||
{
|
||||
// 获取当前的日期
|
||||
DateTime today = DateTime.Today;
|
||||
|
|
@ -69,7 +70,7 @@ namespace WGShare.Domain.FriendlyException
|
|||
markdown = new
|
||||
{
|
||||
title = "有人入会通知",
|
||||
text = $"有人进入会议室了,会议号:{eventBody.payload.channelName},点击查看:https://analytics-lab.agora.io/analytics/call/search?projectId=0tOpVUrmf&fromTs={startTimestamp}&toTs={endTimestamp}"
|
||||
text = $"有人进入会议室了,学校:{roomInfo.TenantName},会议室名称:{roomInfo.RoomName},会议号:{eventBody.payload.channelName}. \r\n 点击查看:https://analytics-lab.agora.io/analytics/call/search?projectId=0tOpVUrmf&fromTs={startTimestamp}&toTs={endTimestamp}"
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue