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

65 lines
1.7 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 CardBLL
{
#region
private readonly LxmInfraRepository _lxmInfraRepository;
public CardBLL(LxmInfraRepository lxmInfraRepository)
{
_lxmInfraRepository = lxmInfraRepository;
}
#endregion
#region GetLxmServiceResp()
/// <summary>
/// 得到服务的明细
/// </summary>
/// <param name="skuId"></param>
/// <returns></returns>
private LxmCardResp GetLxmCardResp(Guid cardId)
{
var cardInfo = _lxmInfraRepository.GetCard(cardId);
if (cardInfo == null)
{
return new LxmCardResp()
{
Name = "卡券"
};
}
return new LxmCardResp() { Name = cardInfo.Name };
}
#endregion
#region GetCacheLxmCardResp()
/// <summary>
/// 得到缓存的卡券信息
/// </summary>
/// <param name="skuId"></param>
/// <returns></returns>
public LxmCardResp GetCacheLxmCardResp(Guid cardId)
{
return CacheHelper.GetCacheValue<LxmCardResp>(
$"GetLxmCardResp-{cardId}",
() => { return GetLxmCardResp(cardId); },
3600
);
}
#endregion
}
}