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