All checks were successful
continuous-integration/drone/push Build is passing
- 后端: TenantApp 模型添加 custom_configs 字段 (LONGTEXT) - 后端: tenant_apps API 支持自定义配置的增删改查 - 前端: 应用订阅编辑对话框增加自定义配置编辑区域 - 支持 key-value-备注 三字段结构 - value 使用 textarea 支持超长文本(如提示词)
33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
"""租户应用配置模型"""
|
||
from datetime import datetime
|
||
from sqlalchemy import Column, BigInteger, Integer, String, Text, SmallInteger, TIMESTAMP
|
||
from ..database import Base
|
||
|
||
|
||
class TenantApp(Base):
|
||
"""租户应用配置表"""
|
||
__tablename__ = "platform_tenant_apps"
|
||
|
||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||
tenant_id = Column(String(50), nullable=False)
|
||
app_code = Column(String(50), nullable=False, default='tools')
|
||
app_name = Column(String(100))
|
||
|
||
# 企业微信配置(关联 platform_tenant_wechat_apps)
|
||
wechat_app_id = Column(Integer) # 关联的企微应用ID
|
||
|
||
# 鉴权配置
|
||
access_token = Column(String(64)) # 访问令牌(长期有效)
|
||
allowed_origins = Column(Text) # JSON 数组
|
||
|
||
# 功能权限
|
||
allowed_tools = Column(Text) # JSON 数组
|
||
|
||
# 自定义配置(JSON 数组)
|
||
# [{"key": "industry", "value": "medical_beauty", "remark": "医美行业"}, ...]
|
||
custom_configs = Column(Text)
|
||
|
||
status = Column(SmallInteger, default=1)
|
||
created_at = Column(TIMESTAMP, default=datetime.now)
|
||
updated_at = Column(TIMESTAMP, default=datetime.now, onupdate=datetime.now)
|