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

65 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
{
/// <summary>
/// 服务
/// </summary>
public class ServiceBLL
{
#region
private readonly LxmInfraRepository _lxmInfraRepository;
public ServiceBLL(LxmInfraRepository lxmInfraRepository)
{
_lxmInfraRepository = lxmInfraRepository;
}
#endregion
#region GetLxmServiceResp()
/// <summary>
/// 得到服务的明细
/// </summary>
/// <param name="skuId"></param>
/// <returns></returns>
private LxmServiceResp GetLxmServiceResp(Guid serviceId)
{
var serviceInfo = _lxmInfraRepository.GetService(serviceId);
if (serviceInfo == null)
{
return new LxmServiceResp()
{
Name = "服务"
};
}
return new LxmServiceResp() { Name = serviceInfo.Name };
}
#endregion
#region GetCacheLxmSimpleGoodsResp(SKU信息)
/// <summary>
/// 得到缓存的SKU信息
/// </summary>
/// <param name="skuId"></param>
/// <returns></returns>
public LxmServiceResp GetCacheLxmServiceResp(Guid serviceId)
{
return CacheHelper.GetCacheValue<LxmServiceResp>(
$"GetLxmServiceResp-{serviceId}",
() => { return GetLxmServiceResp(serviceId); },
3600
);
}
#endregion
}
}