添加项目文件。
This commit is contained in:
63
Atomx.Data/CacheServices/AgencyCacheService.cs
Normal file
63
Atomx.Data/CacheServices/AgencyCacheService.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
//namespace Atomx.Data.CacheServices
|
||||
//{
|
||||
// public partial interface ICacheService
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// 获取代理信息
|
||||
// /// </summary>
|
||||
// /// <param name="id"></param>
|
||||
// /// <param name="reload"></param>
|
||||
// /// <returns></returns>
|
||||
// Task<Agency> GetAgencyById(long id, bool? reload = null);
|
||||
|
||||
// /// <summary>
|
||||
// /// 获取代理的客服信息
|
||||
// /// </summary>
|
||||
// /// <param name="agencyId"></param>
|
||||
// /// <param name="reload"></param>
|
||||
// /// <returns></returns>
|
||||
// Task<List<CustomerService>> GetCustomerServices(long agencyId, bool? reload = null);
|
||||
// }
|
||||
// public partial class CacheService : ICacheService
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// 获取代理信息
|
||||
// /// </summary>
|
||||
// /// <param name="id"></param>
|
||||
// /// <param name="reload"></param>
|
||||
// /// <returns></returns>
|
||||
// public async Task<Agency> GetAgencyById(long id, bool? reload = null)
|
||||
// {
|
||||
// var cacheData = await GetCacheAsync<Agency>($"{CacheKeys.AgencyPrefix}{id}");
|
||||
|
||||
// if (cacheData == null || reload.HasValue)
|
||||
// {
|
||||
// var data = _dbContext.Agencies.SingleOrDefault(p => p.Id == id);
|
||||
// if (data != null)
|
||||
// {
|
||||
// cacheData = data;
|
||||
// await SetCacheAsync($"{CacheKeys.AgencyPrefix}{id}", cacheData);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return cacheData;
|
||||
// }
|
||||
|
||||
// public async Task<List<CustomerService>> GetCustomerServices(long agencyId, bool? reload = null)
|
||||
// {
|
||||
// var cacheData = await GetCacheAsync<List<CustomerService>>($"{CacheKeys.CustomerServicePrefix}{agencyId}");
|
||||
|
||||
// if (cacheData == null || reload.HasValue)
|
||||
// {
|
||||
// var data = _dbContext.CustomerServices.Where(p => p.Enabled && p.AgencyId == agencyId).ToList();
|
||||
// if (data != null)
|
||||
// {
|
||||
// cacheData = data;
|
||||
// await SetCacheAsync($"{CacheKeys.CustomerServicePrefix}{agencyId}", cacheData);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return cacheData;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user