Standardize InsertResultCommand status and info fields
Updated InsertResultCommand usage to replace QuerySuccess with OK and Failed with Error for status reporting. Changed Info to InfoDetail for both preprocessing and postprocessing behaviors to ensure consistent result and error handling.
This commit is contained in:
@@ -23,9 +23,9 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = RecStatus.QuerySuccess,
|
||||
Status = RecStatus.OK,
|
||||
ActionId = request.Action.Id,
|
||||
Info = info,
|
||||
InfoDetail = info,
|
||||
Type = ResultType.Post
|
||||
}, cancel);
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = RecStatus.Failed,
|
||||
Status = RecStatus.Error,
|
||||
ActionId = request.Action.Id,
|
||||
Error = error,
|
||||
Type = ResultType.Post
|
||||
|
||||
@@ -20,9 +20,9 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
|
||||
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = RecStatus.QuerySuccess,
|
||||
Status = RecStatus.OK,
|
||||
ActionId = request.Action.Id,
|
||||
Info = JsonSerializer.Serialize(result),
|
||||
InfoDetail = JsonSerializer.Serialize(result),
|
||||
Type = ResultType.Pre
|
||||
}, cancel);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
|
||||
{
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
Status = RecStatus.Failed,
|
||||
Status = RecStatus.Error,
|
||||
ActionId = request.Action.Id,
|
||||
Error = ex.ToString(),
|
||||
Type = ResultType.Pre
|
||||
|
||||
Reference in New Issue
Block a user