60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using MyCode.Project.Domain.Message.Response.Lxm;
|
|
using MyCode.Project.Infrastructure.Common;
|
|
using MyCode.Project.Repositories.Lxm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MyCode.Project.Services.BLL
|
|
{
|
|
public class CustomPackageBLL
|
|
{
|
|
private readonly LxmInfraRepository _lxmInfraRepository;
|
|
public CustomPackageBLL(LxmInfraRepository lxmInfraRepository)
|
|
{
|
|
_lxmInfraRepository = lxmInfraRepository;
|
|
}
|
|
|
|
#region GetLxmCustomPackageResp(得到流行美自定义套餐明细)
|
|
/// <summary>
|
|
/// 得到商品的明细
|
|
/// </summary>
|
|
/// <param name="skuId"></param>
|
|
/// <returns></returns>
|
|
private LxmCustomPackageResp GetLxmCustomPackageResp(Guid skuId)
|
|
{
|
|
var customPackage = _lxmInfraRepository.GetCustomPackage(skuId);
|
|
|
|
if (customPackage == null)
|
|
{
|
|
return new LxmCustomPackageResp()
|
|
{
|
|
Name = "自定义套餐"
|
|
};
|
|
}
|
|
|
|
return new LxmCustomPackageResp() { Name = customPackage.Name };
|
|
}
|
|
#endregion
|
|
|
|
#region GetCacheLxmCustomPackageResp(得到缓存的自定义套餐信息)
|
|
/// <summary>
|
|
/// 得到缓存的自定义套餐信息
|
|
/// </summary>
|
|
/// <param name="skuId"></param>
|
|
/// <returns></returns>
|
|
public LxmCustomPackageResp GetCacheLxmCustomPackageResp(Guid packageId)
|
|
{
|
|
return CacheHelper.GetCacheValue<LxmCustomPackageResp>(
|
|
|
|
$"GetLxmCustomPackageResp-{packageId}",
|
|
() => { return GetLxmCustomPackageResp(packageId); },
|
|
3600
|
|
);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|