feat:提交
This commit is contained in:
42
tests/dev1/dataHandle/base.ts
Normal file
42
tests/dev1/dataHandle/base.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { ConfigBase } from "./models/config";
|
||||
|
||||
|
||||
/**
|
||||
* 加工处理器上下文
|
||||
*/
|
||||
export abstract class ProcessorContext<TInput,TOutput,TConfig extends ConfigBase>{
|
||||
/**
|
||||
* 输入数据
|
||||
*/
|
||||
public input?:TInput;
|
||||
/**
|
||||
* 合并配置文件与临时输入参
|
||||
*/
|
||||
public params?:TConfig;
|
||||
/**
|
||||
* 输出数据
|
||||
*/
|
||||
public output?:TOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理器基类
|
||||
*/
|
||||
export abstract class ProcessorBase<TInput,TOutput,TConfig extends ConfigBase> {
|
||||
public abstract get name():string;
|
||||
public abstract get version(): string;
|
||||
public abstract exec(context:ProcessorContext<TInput,TOutput,TConfig>):Promise<void>|void
|
||||
}
|
||||
|
||||
export interface resultInfo {
|
||||
code: ResCodeType;
|
||||
data?: any;
|
||||
success?: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export enum ResCodeType{
|
||||
SUCCESS = 1,
|
||||
ERROR = 0,
|
||||
WARNING = -1
|
||||
}
|
Reference in New Issue
Block a user