From cc73a77460d7c574a9e7e723c7fe645d31917b8c Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Wed, 6 Nov 2024 23:14:36 +0800 Subject: [PATCH] Update system config to be dynamic --- backend/app/admin/model/sys_config.py | 17 ++++------------- backend/common/enums.py | 6 ++++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/backend/app/admin/model/sys_config.py b/backend/app/admin/model/sys_config.py index b590e4d7..2b7218de 100644 --- a/backend/app/admin/model/sys_config.py +++ b/backend/app/admin/model/sys_config.py @@ -13,16 +13,7 @@ class Config(Base): __tablename__ = 'sys_config' id: Mapped[id_key] = mapped_column(init=False) - login_title: Mapped[str] = mapped_column(String(20), default='登录 FBA', comment='登录页面标题') - login_sub_title: Mapped[str] = mapped_column( - String(50), default='fastapi_best_architecture', comment='登录页面子标题' - ) - footer: Mapped[str] = mapped_column(String(50), default='FBA', comment='页脚标题') - logo: Mapped[str] = mapped_column(LONGTEXT, default='Arco', comment='Logo') - system_title: Mapped[str] = mapped_column(String(20), default='Arco', comment='系统标题') - system_comment: Mapped[str] = mapped_column( - LONGTEXT, - default='基于 FastAPI 构建的前后端分离 RBAC 权限控制系统,采用独特的伪三层架构模型设计,' - '内置 fastapi-admin 基本实现,并作为模板库免费开源', - comment='系统描述', - ) + name: Mapped[str] = mapped_column(String(20), comment='名称') + type: Mapped[str] = mapped_column(String(20), comment='类型') + key: Mapped[str] = mapped_column(String(50), comment='键名') + value: Mapped[str] = mapped_column(LONGTEXT, comment='键值') diff --git a/backend/common/enums.py b/backend/common/enums.py index e60fca30..d9799d82 100644 --- a/backend/common/enums.py +++ b/backend/common/enums.py @@ -90,6 +90,12 @@ class UserSocialType(StrEnum): linuxdo = 'LinuxDo' +class ConfigType(StrEnum): + """系统配置类型""" + + website = 'website' + + class GenModelMySQLColumnType(StrEnum): """代码生成模型列类型(MySQL)"""