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(得到流行美自定义套餐明细)
///
/// 得到商品的明细
///
///
///
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(得到缓存的自定义套餐信息)
///
/// 得到缓存的自定义套餐信息
///
///
///
public LxmCustomPackageResp GetCacheLxmCustomPackageResp(Guid packageId)
{
return CacheHelper.GetCacheValue(
$"GetLxmCustomPackageResp-{packageId}",
() => { return GetLxmCustomPackageResp(packageId); },
3600
);
}
#endregion
}
}