From df19a6d58ef1d94e11c4dbfd76074e0e54d3d32c Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期五, 05 九月 2025 10:59:32 +0800 Subject: [PATCH] feat:开发 --- FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/GetAlipayNotifyCommandHandler.cs | 39 +++++++++++++++++++++++++++++++++++---- 1 files changed, 35 insertions(+), 4 deletions(-) diff --git a/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/GetAlipayNotifyCommandHandler.cs b/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/GetAlipayNotifyCommandHandler.cs index d1d7d4c..0354bb0 100644 --- a/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/GetAlipayNotifyCommandHandler.cs +++ b/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/GetAlipayNotifyCommandHandler.cs @@ -1,7 +1,12 @@ -锘縰sing FlexJobApi.Core; +锘縰sing Azure; +using FlexJobApi.Core; using Furion; +using Furion.DatabaseAccessor; +using Furion.FriendlyException; using MediatR; using Microsoft.AspNetCore.Http; +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Ocsp; using System; using System.Collections.Generic; using System.Linq; @@ -14,11 +19,16 @@ /// 鏀粯瀹濋�氱煡鍥炰紶 /// </summary> public class GetAlipayNotifyCommandHandler( + IRepository<EnterpriseWallet> rep, + IMediator mediator, IHttpContextAccessor httpContextAccessor ) : IRequestHandler<GetAlipayNotifyCommand, bool>, - IRequestHandler<AlipayUserAgreementPageSignNotifyCommand, bool> + IRequestHandler<AlipayUserAgreementPageSignNotifyCommand, bool>, + IRequestHandler<AlipayFundTransOrderChangedNotifyCommand, bool> { + private readonly IRepository<EnterpriseWallet> rep = rep; + private readonly IMediator mediator = mediator; private readonly IHttpContextAccessor httpContextAccessor = httpContextAccessor; /// <summary> @@ -29,6 +39,7 @@ /// <returns></returns> public Task<bool> Handle(GetAlipayNotifyCommand request, CancellationToken cancellationToken) { + Console.WriteLine("琛ㄥ崟鏁版嵁锛�" + httpContextAccessor.HttpContext.Request.Form.ToJson()); return Task.FromResult(true); } @@ -38,9 +49,29 @@ /// <param name="request"></param> /// <param name="cancellationToken"></param> /// <returns></returns> - public Task<bool> Handle(AlipayUserAgreementPageSignNotifyCommand request, CancellationToken cancellationToken) + public async Task<bool> Handle(AlipayUserAgreementPageSignNotifyCommand request, CancellationToken cancellationToken) { - Console.WriteLine(httpContextAccessor.HttpContext.Request.QueryString); + var entity = await rep.AsQueryable() + .Where(it => it.Code == request.external_agreement_no) + .FirstOrDefaultAsync(); + if (entity == null) throw Oops.Oh(EnumErrorCodeType.s404, "浼佷笟閽卞寘"); + await mediator.Send(new GetEnterpriseWalletQuery + { + EnterpriseId = entity.EnterpriseId, + Access = EnumEnterpriseWalletAccess.Alipay + }); + return true; + } + + /// <summary> + /// 璧勯噾鍗曟嵁鐘舵�佸彉鏇撮�氱煡 + /// </summary> + /// <param name="request"></param> + /// <param name="cancellationToken"></param> + /// <returns></returns> + public Task<bool> Handle(AlipayFundTransOrderChangedNotifyCommand request, CancellationToken cancellationToken) + { + Console.WriteLine("琛ㄥ崟鏁版嵁锛�" + httpContextAccessor.HttpContext.Request.Form.ToJson()); return Task.FromResult(true); } } -- Gitblit v1.9.1