You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
|
2 months ago
|
"""
|
||
|
|
配置模型
|
||
|
|
"""
|
||
|
|
from datetime import datetime
|
||
|
|
from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text
|
||
|
|
from app.db.base import Base
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfig(Base):
|
||
|
|
"""SDK配置表"""
|
||
|
|
__tablename__ = "sdk_configs"
|
||
|
|
|
||
|
|
id = Column(Integer, primary_key=True, index=True)
|
||
|
|
name = Column(String(100), nullable=False)
|
||
|
|
username = Column(String(100), nullable=False)
|
||
|
|
password = Column(String(255), nullable=False)
|
||
|
|
host = Column(String(100), nullable=False)
|
||
|
|
port = Column(Integer, nullable=False, default=8080)
|
||
|
|
local_path = Column(String(255), default="./amazing_data_cache/")
|
||
|
|
is_active = Column(Boolean, default=True)
|
||
|
|
is_default = Column(Boolean, default=False)
|
||
|
|
description = Column(Text)
|
||
|
|
created_at = Column(DateTime(timezone=True), default=datetime.utcnow)
|
||
|
|
updated_at = Column(DateTime(timezone=True), default=datetime.utcnow, onupdate=datetime.utcnow)
|
||
|
|
|
||
|
|
|
||
|
|
class SystemConfig(Base):
|
||
|
|
"""系统配置表"""
|
||
|
|
__tablename__ = "system_configs"
|
||
|
|
|
||
|
|
id = Column(Integer, primary_key=True, index=True)
|
||
|
|
config_key = Column(String(100), unique=True, nullable=False)
|
||
|
|
config_value = Column(Text, nullable=False)
|
||
|
|
description = Column(Text)
|
||
|
|
created_at = Column(DateTime(timezone=True), default=datetime.utcnow)
|
||
|
|
updated_at = Column(DateTime(timezone=True), default=datetime.utcnow, onupdate=datetime.utcnow)
|