fix storage

This commit is contained in:
jxxghp
2024-07-02 18:31:17 +08:00
parent 8530d54fcc
commit b37e50480a
6 changed files with 59 additions and 25 deletions

View File

@@ -3,15 +3,31 @@ from pathlib import Path
from typing import Optional, List
from app import schemas
from app.helper.storage import StorageHelper
class StorageBase(metaclass=ABCMeta):
"""
存储基类
"""
schema = None
transtype = {}
def __init__(self):
self.storagehelper = StorageHelper()
def get_config(self) -> Optional[schemas.StorageConf]:
"""
获取配置
"""
return self.storagehelper.get_storage(self.schema.value)
def set_config(self, conf: dict):
"""
设置配置
"""
self.storagehelper.set_storage(self.schema.value, conf)
def support_transtype(self) -> dict:
"""
支持的整理方式