Add Status and Message to CreateOutResCommand

CreateOutResCommand now includes optional Status and Message properties to capture additional result details. The HTTP response status code is recorded in Status when creating an output result in InvokeRecActionCommandHandler.
This commit is contained in:
2025-12-12 01:32:09 +01:00
parent d932fb522c
commit da1b05347e
2 changed files with 7 additions and 0 deletions

View File

@@ -8,6 +8,10 @@ public class CreateOutResCommand : IRequest
{
public required long ActionId { get; set; }
public short? Status { get; set; }
public string? Message { get; set; }
public string? Header { get; set; }
public string? Body { get; set; }

View File

@@ -54,8 +54,11 @@ public class InvokeRecActionCommandHandler(
var resBody = await response.Content.ReadAsStringAsync(cancel);
var resHeaders = response.Headers.ToDictionary();
var statusCode = (short)response.StatusCode;
await sender.Send(new CreateOutResCommand
{
Status = statusCode,
ActionId = action.Id,
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
Body = resBody,