2025-07-04 16:47:14 +08:00
|
|
|
import { ConfigBase } from "./models/config";
|
2025-07-03 10:26:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 加工处理器上下文
|
|
|
|
*/
|
|
|
|
export abstract class ProcessorContext<TInput,TOutput,TConfig extends ConfigBase>{
|
|
|
|
/**
|
|
|
|
* 输入数据
|
|
|
|
*/
|
|
|
|
public Input?:TInput;
|
|
|
|
/**
|
|
|
|
* 合并配置文件与临时输入参
|
|
|
|
*/
|
|
|
|
public params?:TConfig;
|
|
|
|
/**
|
|
|
|
* 输出数据
|
|
|
|
*/
|
|
|
|
public Ouput?:TOutput;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 处理器基类
|
|
|
|
*/
|
|
|
|
export abstract class ProcessorBase<TInput,TOutput,TConfig extends ConfigBase> {
|
|
|
|
public readonly name: string = '';
|
|
|
|
public readonly version: string = '1.0.0';
|
|
|
|
public abstract exec(context:ProcessorContext<TInput,TOutput,TConfig>):Promise<void>|void
|
2025-06-24 11:48:26 +08:00
|
|
|
}
|