Class GenerationProcessor<TSegment>
- Namespace
- CMS.Plugin.BarcodeManagement.Abstractions.Processors
- Assembly
- CMS.Plugin.BarcodeManagement.Abstractions.dll
抽象类,用于定义条码生成处理器的基本行为。
public abstract class GenerationProcessor<TSegment> : Processor<(bool IsSucceeded, string? ErrorMsg, string? Barcode)>
Type Parameters
TSegment
条码生成规则的类型。
- Inheritance
-
GenerationProcessor<TSegment>
- Derived
- Inherited Members
Properties
SegmentContent
条码生成规则。
protected TSegment SegmentContent { get; set; }
Property Value
- TSegment
Methods
AbortAsync((bool IsSucceeded, string? ErrorMsg, string? Barcode))
判断是否需要中止处理。
protected override Task<bool> AbortAsync((bool IsSucceeded, string? ErrorMsg, string? Barcode) result)
Parameters
Returns
ExecuteProcessAsync()
执行当前处理器的核心逻辑。
protected override Task<(bool IsSucceeded, string? ErrorMsg, string? Barcode)> ExecuteProcessAsync()
Returns
- Task<(bool IsUsed, string UsedObject, string Error)>
返回一个元组,包含处理结果:
IsSucceeded
: 是否成功。ErrorMsg
: 错误信息(如果有)。Barcode
: 生成的条码(如果有)。
IterateProcessAsync()
异步迭代处理方法。
public override Task<(bool IsSucceeded, string? ErrorMsg, string? Barcode)> IterateProcessAsync()
Returns
- Task<(bool IsUsed, string UsedObject, string Error)>
返回一个元组,包含以下信息:
IsSucceeded
: 是否成功。ErrorMsg
: 错误信息(如果有)。Barcode
: 生成的条码(如果有)。
ProcessAsync(TSegment)
抽象方法,用于实现具体的条码生成逻辑。
protected abstract Task<(bool IsPassed, string? ErrorMsg, string? Barcode)> ProcessAsync(TSegment segment)
Parameters
segment
TSegment条码生成规则。