整理代码
This commit is contained in:
@@ -23,10 +23,7 @@ class UnitsApiHandler(BaseApiHandler):
|
||||
"""机组 API Handler"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._node_type = "units"
|
||||
self._node_class = UnitsSyncNode
|
||||
self._schema = GeneratorUnitProject
|
||||
super().__init__(node_class=UnitsSyncNode, schema=GeneratorUnitProject)
|
||||
|
||||
async def load(self) -> List[SyncNode]:
|
||||
"""加载机组数据(从 project all_info 中提取)"""
|
||||
|
||||
@@ -11,7 +11,7 @@ from schemas.project_extensions.generator_unit import GeneratorUnitProject
|
||||
class UnitsJsonlHandler(BaseJsonlHandler):
|
||||
"""机组 JSONL Handler"""
|
||||
def __init__(self, datasource: JsonlDataSource):
|
||||
super().__init__(datasource, "units", UnitsSyncNode, GeneratorUnitProject)
|
||||
super().__init__(datasource, UnitsSyncNode, schema=GeneratorUnitProject)
|
||||
|
||||
async def load(self) -> List['SyncNode']:
|
||||
"""加载机组数据(支持 generator_unit_N.jsonl 与 units_N.jsonl)"""
|
||||
|
||||
Reference in New Issue
Block a user