using StackExchange.Redis; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Hg.Core.Domain { internal class CustomerDomain : ICustomerDomain { private readonly IConfiguration _configuration; private readonly IHttpClient _httpClient; private readonly IBaseRepository _crmRepository; private readonly IBaseRepository _zxdRepository; private readonly ICacheDomain _cacheDomain; private readonly SystemConfig _systemConfig; public CustomerDomain(IConfiguration configuration, IHttpClient httpClient, IBaseRepository crmRepository, IBaseRepository zxdRepository, ICacheDomain cacheDomain) { _systemConfig = configuration.GetSection("SystemConfig").Get(); _configuration = configuration; _httpClient = httpClient; _crmRepository = crmRepository; _zxdRepository = zxdRepository; _cacheDomain = cacheDomain; } public async Task GetUsername(string? softname) { var data = await _crmRepository.GetRepository().Query() .Where(x => softname == x.Uid) .OrderByDescending(x => x.Ctime) .Select(x => x.Username).FirstOrDefaultAsync(); return data; } } }