64 lines
1.9 KiB
C#
64 lines
1.9 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
|
|
{
|
|
/// <summary>
|
|
/// 服务套餐
|
|
/// </summary>
|
|
public class ServicePackageBLL
|
|
{
|
|
#region 初始化
|
|
private readonly LxmInfraRepository _lxmInfraRepository;
|
|
public ServicePackageBLL(LxmInfraRepository lxmInfraRepository)
|
|
{
|
|
_lxmInfraRepository = lxmInfraRepository;
|
|
}
|
|
#endregion
|
|
|
|
#region LxmServicePackageResp(得到流行美服务套餐)
|
|
/// <summary>
|
|
/// 得到服务套餐的明细
|
|
/// </summary>
|
|
/// <param name="skuId"></param>
|
|
/// <returns></returns>
|
|
private LxmServicePackageResp GetLxmServicePackage(Guid packageId)
|
|
{
|
|
var info = _lxmInfraRepository.GetServicePackage(packageId);
|
|
|
|
if (info == null)
|
|
{
|
|
return new LxmServicePackageResp()
|
|
{
|
|
Name = "服务套餐"
|
|
};
|
|
}
|
|
|
|
return new LxmServicePackageResp() { Name = info.Name };
|
|
}
|
|
#endregion
|
|
|
|
#region GetCacheLxmServicePackage(得到缓存的服务套餐信息)
|
|
/// <summary>
|
|
/// 得到缓存的服务套餐信息
|
|
/// </summary>
|
|
/// <param name="skuId"></param>
|
|
/// <returns></returns>
|
|
public LxmServicePackageResp GetCacheLxmServicePackage(Guid packageId)
|
|
{
|
|
return CacheHelper.GetCacheValue<LxmServicePackageResp>(
|
|
$"GetLxmServicePackage-{packageId}",
|
|
() => { return GetLxmServicePackage(packageId); },
|
|
3600
|
|
);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|