fix(module-key): make module keys standalone MD format with system_key relation

This commit is contained in:
Chris
2026-03-30 20:02:17 +08:00
parent b4c02835bd
commit fb515c6c44
7 changed files with 77 additions and 48 deletions

View File

@@ -18,8 +18,8 @@ class ModulesRepository:
stmt = stmt.order_by(Module.created_at.desc()).limit(limit).offset(offset)
return list(self.db.scalars(stmt).all()), int(self.db.scalar(count_stmt) or 0)
def create(self, module_key: str, name: str, status: str = "active") -> Module:
item = Module(module_key=module_key, name=name, status=status)
def create(self, module_key: str, system_key: str, name: str, status: str = "active") -> Module:
item = Module(module_key=module_key, system_key=system_key, name=name, status=status)
self.db.add(item)
self.db.commit()
self.db.refresh(item)