Exemplo n.º 1
0
        public async Task <BaseApiResponse> AgreeReturn(AgreeReturnRequest request)
        {
            request.CheckNotNull(nameof(request));

            var command = new AgreeReturnCommand(request.Remark)
            {
                AggregateRootId = request.Id
            };

            var result = await ExecuteCommandAsync(command);

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

            return(new BaseApiResponse());
        }
Exemplo n.º 2
0
 public void Handle(ICommandContext context, AgreeReturnCommand command)
 {
     context.Get <StoreOrder>(command.AggregateRootId).AgreeReturn(command.Remark);
 }