60 lines
2.5 KiB
C#
60 lines
2.5 KiB
C#
using System.Collections.Generic;
|
|
using System.Runtime.Serialization;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace YLErp.Modules.RiskEngine.Dto
|
|
{
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum BatchOperationOutcome
|
|
{
|
|
[EnumMember(Value = "AllSucceeded")]
|
|
AllSucceeded,
|
|
[EnumMember(Value = "PartiallySucceeded")]
|
|
PartiallySucceeded,
|
|
[EnumMember(Value = "AllFailed")]
|
|
AllFailed
|
|
}
|
|
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum BatchOperationItemStatus
|
|
{
|
|
[EnumMember(Value = "Succeeded")]
|
|
Succeeded,
|
|
[EnumMember(Value = "Unchanged")]
|
|
Unchanged,
|
|
[EnumMember(Value = "Failed")]
|
|
Failed
|
|
}
|
|
|
|
public class BatchOperationItemResult
|
|
{
|
|
public long Id { get; set; }
|
|
public BatchOperationItemStatus Status { get; set; }
|
|
public string Code { get; set; }
|
|
public string Message { get; set; }
|
|
/// <summary>操作影响到的应用 ID(不代表应用状态发生变化)</summary>
|
|
public List<long> AffectedApplicationIds { get; set; } = new List<long>();
|
|
/// <summary>操作后不再包含任何启用规则的应用 ID</summary>
|
|
public List<long> CausedNoAvailableRuleApplicationIds { get; set; } = new List<long>();
|
|
/// <summary>旧版级联字段,解耦后始终为空,仅为兼容旧客户端保留</summary>
|
|
public List<long> CascadedApplicationIds { get; set; } = new List<long>();
|
|
}
|
|
|
|
public class BatchOperationResult
|
|
{
|
|
public BatchOperationOutcome Outcome { get; set; }
|
|
public int TotalCount { get; set; }
|
|
public int SucceededCount { get; set; }
|
|
public int UnchangedCount { get; set; }
|
|
public int FailedCount { get; set; }
|
|
public bool HasChanges { get; set; }
|
|
public List<BatchOperationItemResult> Items { get; set; } = new List<BatchOperationItemResult>();
|
|
/// <summary>所有请求项影响到的应用 ID 去重并集</summary>
|
|
public List<long> AffectedApplicationIds { get; set; } = new List<long>();
|
|
/// <summary>操作后不再包含任何启用规则的应用 ID 去重并集</summary>
|
|
public List<long> CausedNoAvailableRuleApplicationIds { get; set; } = new List<long>();
|
|
/// <summary>旧版级联字段,解耦后始终为空,仅为兼容旧客户端保留</summary>
|
|
public List<long> CascadedApplicationIds { get; set; } = new List<long>();
|
|
}
|
|
}
|