Files
000-platform/backend/app/models/tenant_app.py
Admin c1ba17f809
All checks were successful
continuous-integration/drone/push Build is passing
fix: 恢复租户应用订阅的自定义配置功能
定时任务提交(104487f)误删了 custom_configs 相关代码,现恢复:
- backend/app/models/tenant_app.py: 恢复 custom_configs 数据库字段
- backend/app/routers/tenant_apps.py: 恢复 CustomConfigItem、custom_configs 逻辑、get_token API
2026-01-29 17:47:57 +08:00

33 lines
1.2 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, 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)