feat: 实现配置文件管理器并适配main.py中的引用

This commit is contained in:
RockChinQ
2023-11-26 22:46:27 +08:00
parent 26e4215054
commit db2e366014
6 changed files with 145 additions and 19 deletions

27
pkg/config/model.py Normal file
View File

@@ -0,0 +1,27 @@
import abc
class ConfigFile(metaclass=abc.ABCMeta):
"""配置文件抽象类"""
config_file_name: str = None
"""配置文件名"""
template_file_name: str = None
"""模板文件名"""
@abc.abstractmethod
def exists(self) -> bool:
pass
@abc.abstractmethod
async def create(self):
pass
@abc.abstractmethod
async def load(self) -> dict:
pass
@abc.abstractmethod
async def save(self, data: dict):
pass