using ApiTools.Core;
using Mapster;
using MediatR;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApiTools.Application
{
///
/// 查询渠道钱包交易详情
///
public class ChannelWalletQueryHandler(
ChannelWalletRepository channelWalletRepository,
ChannelWalletTransactionRepository channelWalletTransactionRepository
) :
IRequestHandler,
IRequestHandler
{
private readonly ChannelWalletRepository channelWalletRepository = channelWalletRepository;
private readonly ChannelWalletTransactionRepository channelWalletTransactionRepository = channelWalletTransactionRepository;
///
/// 查询渠道平安银行钱包
///
///
///
///
public async Task Handle(GetChannelPingAnPayWalletQuery request, CancellationToken cancellationToken)
{
return await channelWalletRepository.GetQueryable()
.Where(it => it.OutWalletId == request.OutWalletId)
.ProjectToType()
.FirstOrDefaultAsync();
}
///
/// 查询渠道钱包交易详情
///
///
///
///
public async Task Handle(GetChannelWalletTransactionQuery request, CancellationToken cancellationToken)
{
return await channelWalletTransactionRepository.GetQueryable()
.Where(it => it.OutCode == request.OutCode)
.ProjectToType()
.FirstOrDefaultAsync();
}
}
}