Esempio n. 1
0
 public void Handle(ICommandContext context, ChangeWithdrawStatusCommand command)
 {
     context.Get <Wallet>(command.AggregateRootId).ChangeWithdrawApplyStatus(
         command.WithdrawApplyId,
         command.Status,
         command.Remark);
 }
Esempio n. 2
0
        public async Task <BaseApiResponse> ChangeWithdrawApplyStatus(ChangeWithdrawApplyStatusRequest request)
        {
            request.CheckNotNull(nameof(request));
            request.WalletId.CheckNotEmpty(nameof(request.WalletId));


            var command = new ChangeWithdrawStatusCommand(
                request.WithdrawApplyId,
                request.Status,
                request.Remark)
            {
                AggregateRootId = request.WalletId
            };

            var result = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "命令没有执行成功:{0}".FormatWith(result.GetErrorMessage())
                });
            }
            //添加操作记录
            var currentAdmin = _contextService.GetCurrentAdmin(HttpContext.Current);

            RecordOperat(currentAdmin.AdminId.ToGuid(), "提现审核", request.WithdrawApplyId, request.Status.ToDescription());

            return(new BaseApiResponse());
        }
Esempio n. 3
0
        public async Task <BaseApiResponse> ChangeWithdrawApplyStatus([FromBody] ChangeWithdrawApplyStatusRequest request)
        {
            request.CheckNotNull(nameof(request));
            request.WalletId.CheckNotEmpty(nameof(request.WalletId));

            var command = new ChangeWithdrawStatusCommand(
                request.WithdrawApplyId,
                request.Status,
                request.Remark)
            {
                AggregateRootId = request.WalletId
            };

            var result = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "命令没有执行成功:{0}".FormatWith(result.GetErrorMessage())
                });
            }
            return(new BaseApiResponse());
        }