Files
000-platform/backend/app/models/tool_config.py
Admin 7134947c0c
All checks were successful
continuous-integration/drone/push Build is passing
feat: 添加租户工具配置系统
- 新增 platform_tool_configs 表和 ToolConfig Model
- 新增工具配置 CRUD API (/api/tool-configs)
- 租户详情页添加工具配置管理 Tab
- 修复查看 Token 显示问题,添加专用获取接口
2026-01-27 11:30:02 +08:00

22 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""租户工具配置模型"""
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)