|
@@ -5,11 +5,15 @@ using CallCenter.Calls;
|
|
|
using CallCenter.Devices;
|
|
|
using CallCenter.Ivrs;
|
|
|
using CallCenter.Realtimes;
|
|
|
+using CallCenter.Repository.SqlSugar;
|
|
|
using CallCenter.Users;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using NewRock.Sdk;
|
|
|
using NewRock.Sdk.Security;
|
|
|
+using SqlSugar;
|
|
|
+using System.Reactive;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Cache;
|
|
|
|
|
@@ -29,6 +33,7 @@ namespace CallCenter.Api.Controllers
|
|
|
private readonly IIvrDomainService _ivrDomainService;
|
|
|
private readonly ICallCacheManager _callCacheManager;
|
|
|
private readonly ICallRepository _callRepository;
|
|
|
+ private readonly ISugarUnitOfWork<CallCenterDbContext> _uow;
|
|
|
//private readonly ITypedCache<List<User>> _cache;
|
|
|
//private readonly ICacheManager<User> _cache;
|
|
|
|
|
@@ -46,7 +51,8 @@ namespace CallCenter.Api.Controllers
|
|
|
IBlacklistDomainService blacklistDomainService,
|
|
|
IIvrDomainService ivrDomainService,
|
|
|
ICallCacheManager callCacheManager,
|
|
|
- ICallRepository callRepository
|
|
|
+ ICallRepository callRepository,
|
|
|
+ ISugarUnitOfWork<CallCenterDbContext> uow
|
|
|
)
|
|
|
{
|
|
|
_logger = logger;
|
|
@@ -60,13 +66,22 @@ namespace CallCenter.Api.Controllers
|
|
|
_ivrDomainService = ivrDomainService;
|
|
|
_callCacheManager = callCacheManager;
|
|
|
_callRepository = callRepository;
|
|
|
+ _uow = uow;
|
|
|
}
|
|
|
-
|
|
|
+ [AllowAnonymous]
|
|
|
[HttpGet]
|
|
|
public async Task Test1()
|
|
|
{
|
|
|
- var user = User;
|
|
|
- var uid = _sessionContext.UserId;
|
|
|
+ //var user = User;
|
|
|
+ //var uid = _sessionContext.UserId;
|
|
|
+
|
|
|
+
|
|
|
+ //await _callRepository.GetExtAsync(
|
|
|
+ // x => x.ConversationId == "2" &&
|
|
|
+ // x.FromNo == "13408389849" && x.CreationTime >= DateTime.Now.AddHours(-2), x => x.Includes(d => d.CallDetails));
|
|
|
+
|
|
|
+ var list = await _uow.Db.Queryable<Call>().Includes(x => x.CallDetails).Where(x => x.ConversationId == "2" &&
|
|
|
+ x.FromNo == "13408389849").ToListAsync() ;
|
|
|
//var user = await _userRepository.GetAsync("08da8016-72af-48b3-8c8f-b39251229f79");
|
|
|
//_cache.Add(user.Id, user, ExpireMode.None, TimeSpan.FromMinutes(1));
|
|
|
//var user1 = _cache.Get(user.Id);
|