|
@@ -1,4 +1,5 @@
|
|
-using CallCenter.Calls;
|
|
|
|
|
|
+using CallCenter.Caches;
|
|
|
|
+using CallCenter.Calls;
|
|
using CallCenter.Share.Dtos;
|
|
using CallCenter.Share.Dtos;
|
|
using CallCenter.Share.Enums;
|
|
using CallCenter.Share.Enums;
|
|
using CallCenter.Share.Requests;
|
|
using CallCenter.Share.Requests;
|
|
@@ -6,6 +7,7 @@ using MapsterMapper;
|
|
using MessagePack.Formatters;
|
|
using MessagePack.Formatters;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
+using XF.Domain.Authentications;
|
|
|
|
|
|
namespace CallCenter.Api.Controllers
|
|
namespace CallCenter.Api.Controllers
|
|
{
|
|
{
|
|
@@ -18,13 +20,17 @@ namespace CallCenter.Api.Controllers
|
|
private readonly ICallRepository _callRepository;
|
|
private readonly ICallRepository _callRepository;
|
|
private readonly IMapper _mapper;
|
|
private readonly IMapper _mapper;
|
|
private readonly ICallDetailRepository _callDetailRepository;
|
|
private readonly ICallDetailRepository _callDetailRepository;
|
|
|
|
+ private readonly ISessionContext _sessionContext;
|
|
|
|
+ private readonly IUserCacheManager _userCacheManager;
|
|
|
|
|
|
- public CallController(ICallDomainService callDomainService, ICallRepository callRepository, IMapper mapper, ICallDetailRepository callDetailRepository)
|
|
|
|
|
|
+ public CallController(ICallDomainService callDomainService, ICallRepository callRepository, IMapper mapper, ICallDetailRepository callDetailRepository, ISessionContext sessionContext,IUserCacheManager userCacheManager)
|
|
{
|
|
{
|
|
_callDomainService = callDomainService;
|
|
_callDomainService = callDomainService;
|
|
_callRepository = callRepository;
|
|
_callRepository = callRepository;
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
_callDetailRepository = callDetailRepository;
|
|
_callDetailRepository = callDetailRepository;
|
|
|
|
+ _sessionContext = sessionContext;
|
|
|
|
+ _userCacheManager = userCacheManager;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -36,8 +42,11 @@ namespace CallCenter.Api.Controllers
|
|
/// <param name="request"></param>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpPost("ClearExt")]
|
|
[HttpPost("ClearExt")]
|
|
- public async Task ClearExt([FromBody] ClearExtRequest request)
|
|
|
|
|
|
+ public async Task ClearExt()
|
|
{
|
|
{
|
|
|
|
+ var userid = _sessionContext.RequiredUserId;
|
|
|
|
+ var work = _userCacheManager.GetWorkByUser(userid);
|
|
|
|
+ var request = new ClearExtRequest(work.TelNo);
|
|
await _callDomainService.ClearExtAsync(request, HttpContext.RequestAborted);
|
|
await _callDomainService.ClearExtAsync(request, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|