|
@@ -532,6 +532,38 @@ namespace Hotline.Api.Controllers
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
+ #region 静音和取消静音
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 静音
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [Permission(EPermission.Mute)]
|
|
|
|
+ [HttpGet("mute")]
|
|
|
|
+ public async Task Mute()
|
|
|
|
+ {
|
|
|
|
+ var work = _userCacheManager.GetWorkByUser(_sessionContext.RequiredUserId);
|
|
|
|
+ if (work is null)
|
|
|
|
+ throw UserFriendlyException.SameMessage("当前坐席暂未进行工作");
|
|
|
|
+ await _deviceManager.MuteAsync(work.TelNo, HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 取消静音
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [Permission(EPermission.UnMute)]
|
|
|
|
+ [HttpGet("unmute")]
|
|
|
|
+ public async Task UnMute()
|
|
|
|
+ {
|
|
|
|
+ var work = _userCacheManager.GetWorkByUser(_sessionContext.RequiredUserId);
|
|
|
|
+ if (work is null)
|
|
|
|
+ throw UserFriendlyException.SameMessage("当前坐席暂未进行工作");
|
|
|
|
+ await _deviceManager.UnMuteAsync(work.TelNo, HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
}
|
|
}
|