65 lines
1.8 KiB
C#
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
|
|
}
|
|
}
|