mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-06-12 19:09:47 +08:00
refactor: optimize backend module
This commit is contained in:
17
domain/processors/base.py
Normal file
17
domain/processors/base.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from typing import Protocol, Dict, Any
|
||||
|
||||
|
||||
class BaseProcessor(Protocol):
|
||||
name: str
|
||||
supported_exts: list
|
||||
config_schema: list
|
||||
produces_file: bool
|
||||
|
||||
async def process(self, input_bytes: bytes, path: str, config: Dict[str, Any]) -> bytes:
|
||||
"""处理文件内容并返回处理后的内容"""
|
||||
...
|
||||
|
||||
# 约定:每个处理器需定义
|
||||
# PROCESSOR_TYPE: str
|
||||
# CONFIG_SCHEMA: list
|
||||
# PROCESSOR_FACTORY: Callable[[], BaseProcessor]
|
||||
Reference in New Issue
Block a user