Files
YunTongJackYunTask/Reportapi/MyCode.Project.Services/BLL/CustomPackageBLL.cs
2025-07-04 09:50:02 +08:00

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
}
}