All checks were successful
continuous-integration/drone/push Build is passing
- 后端: TenantApp 模型添加 custom_configs 字段 (LONGTEXT) - 后端: tenant_apps API 支持自定义配置的增删改查 - 前端: 应用订阅编辑对话框增加自定义配置编辑区域 - 支持 key-value-备注 三字段结构 - value 使用 textarea 支持超长文本(如提示词)
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
"""租户工具配置模型"""
|
||
from datetime import datetime
|
||
from sqlalchemy import Column, Integer, String, Text, SmallInteger, TIMESTAMP
|
||
from ..database import Base
|
||
|
||
|
||
class ToolConfig(Base):
|
||
"""租户工具配置表"""
|
||
__tablename__ = "platform_tool_configs"
|
||
|
||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||
tenant_id = Column(String(50), nullable=False, comment="租户ID")
|
||
tool_code = Column(String(50), nullable=True, comment="工具代码(NULL 表示租户级共享配置)")
|
||
config_type = Column(String(30), nullable=False, comment="配置类型:datasource / jssdk / webhook / params")
|
||
config_key = Column(String(100), nullable=False, comment="配置键名")
|
||
config_value = Column(Text, comment="配置值(明文或加密)")
|
||
is_encrypted = Column(SmallInteger, default=0, comment="是否加密存储")
|
||
description = Column(String(255), comment="配置说明")
|
||
status = Column(SmallInteger, default=1)
|
||
created_at = Column(TIMESTAMP, default=datetime.now)
|
||
updated_at = Column(TIMESTAMP, default=datetime.now, onupdate=datetime.now)
|