All checks were successful
continuous-integration/drone/push Build is passing
- 新增 platform_tenant_wechat_apps 表(租户企微应用配置) - platform_apps 增加 require_jssdk 字段 - platform_tenant_apps 增加 wechat_app_id 关联字段 - 新增企微应用管理 API 和页面 - 应用管理页面增加 JS-SDK 开关 - 应用配置页面增加企微应用选择
29 lines
1.0 KiB
Python
29 lines
1.0 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 数组
|
||
|
||
status = Column(SmallInteger, default=1)
|
||
created_at = Column(TIMESTAMP, default=datetime.now)
|
||
updated_at = Column(TIMESTAMP, default=datetime.now, onupdate=datetime.now)
|