mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 14:23:48 +00:00
本次提交主要包含以下变更: 1. 新增任务管理模块,支持定时任务的创建、更新、删除和状态管理 2. 新增字典管理模块,用于维护系统中常用的固定数据 3. 优化系统配置,移除Celery,改用APScheduler进行任务调度 4. 修复部分前端组件的样式问题,统一输入框宽度 5. 更新文档和相关图片资源,完善系统功能描述 这些变更旨在增强系统的可维护性和功能性,提供更灵活的任务调度机制和更便捷的字典数据管理方式。
49 lines
2.4 KiB
Python
49 lines
2.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, String, Integer, DateTime, ForeignKey, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.core.base_model import ModelBase
|
|
|
|
|
|
class ConfigModel(ModelBase):
|
|
"""
|
|
配置表 - 用于存储组织架构中的配置信息
|
|
"""
|
|
__tablename__ = "system_config"
|
|
__table_args__ = ({'comment': '配置表'})
|
|
|
|
# 基础字段
|
|
id = Column(Integer, primary_key=True, autoincrement=True, comment='主键ID')
|
|
|
|
title = Column(String(100), nullable=False, default="FastAPI Vue Admin", comment="网站标题")
|
|
favicon = Column(String(500), nullable=False, default="http://localhost:8000/api/v1/static/image/logo.png", comment="网站favicon")
|
|
logo = Column(String(500), nullable=False, default="http://localhost:8000/api/v1/static/image/logo.png", comment="网站logo")
|
|
background = Column(String(500), nullable=False, default="http://localhost:8000/api/v1/static/image/background.png", comment="网站背景")
|
|
copyright = Column(String(500), nullable=False, default="Copyright © 2021-2025 fastapi-vue-admin.com 版权所有", comment="版权信息")
|
|
keep_record = Column(String(500), nullable=False, default="晋ICP备18005113号-3", comment="备案信息")
|
|
help_url = Column(String(500), nullable=False, default="https://django-vue-admin.com", comment="帮助链接")
|
|
privacy_url = Column(String(500), nullable=False, default="https://gitee.com/tao__tao/fastapi_vue3_admin/blob/master/LICENSE", comment="隐私政策链接")
|
|
clause_url = Column(String(500), nullable=False, default="https://gitee.com/tao__tao/fastapi_vue3_admin/blob/master/LICENSE", comment="服务条款链接")
|
|
code_url = Column(String(500), nullable=False, default="https://gitee.com/tao__tao/fastapi_vue3_admin.git", comment="源码地址")
|
|
|
|
# 审计字段
|
|
description = Column(Text, nullable=True, comment="备注说明")
|
|
created_at = Column(DateTime, default=datetime.now, comment='创建时间')
|
|
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
|
|
creator_id = Column(
|
|
Integer,
|
|
ForeignKey("system_users.id", ondelete="SET NULL", onupdate="CASCADE"),
|
|
nullable=True,
|
|
index=True,
|
|
comment="创建人ID"
|
|
)
|
|
creator = relationship(
|
|
"UserModel",
|
|
foreign_keys=creator_id,
|
|
lazy="joined",
|
|
post_update=True,
|
|
uselist=False
|
|
)
|