fix filemanager

This commit is contained in:
jxxghp
2024-07-02 18:16:52 +08:00
parent 1822d01d17
commit 8530d54fcc
8 changed files with 95 additions and 40 deletions

23
app/helper/storage.py Normal file
View File

@@ -0,0 +1,23 @@
from typing import List
from app import schemas
from app.db.systemconfig_oper import SystemConfigOper
from app.schemas.types import SystemConfigKey
class StorageHelper:
"""
存储帮助类
"""
def __init__(self):
self.systemconfig = SystemConfigOper()
def get_storagies(self) -> List[schemas.StorageConf]:
"""
获取所有存储设置
"""
storage_confs: List[dict] = self.systemconfig.get(SystemConfigKey.Storages)
if not storage_confs:
return []
return [schemas.StorageConf(**s) for s in storage_confs]