All checks were successful
continuous-integration/drone/push Build is passing
- 新增 platform_apps 表和 App 模型 - 新增应用管理页面 /apps - 应用配置页面添加"生成链接"功能 - 支持一键生成带签名的访问 URL
24 lines
1.0 KiB
Python
24 lines
1.0 KiB
Python
"""应用定义模型"""
|
||
from datetime import datetime
|
||
from sqlalchemy import Column, Integer, String, Text, SmallInteger, TIMESTAMP
|
||
from ..database import Base
|
||
|
||
|
||
class App(Base):
|
||
"""应用定义表 - 定义可供租户使用的应用"""
|
||
__tablename__ = "platform_apps"
|
||
|
||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||
app_code = Column(String(50), nullable=False, unique=True) # 唯一标识,如 tools
|
||
app_name = Column(String(100), nullable=False) # 显示名称
|
||
base_url = Column(String(500)) # 基础URL,如 https://tools.test.ai.ireborn.com.cn
|
||
description = Column(Text) # 应用描述
|
||
|
||
# 应用下的工具/功能列表(JSON 数组)
|
||
# [{"code": "brainstorm", "name": "头脑风暴", "path": "/brainstorm"}, ...]
|
||
tools = Column(Text)
|
||
|
||
status = Column(SmallInteger, default=1) # 0-禁用 1-启用
|
||
created_at = Column(TIMESTAMP, default=datetime.now)
|
||
updated_at = Column(TIMESTAMP, default=datetime.now, onupdate=datetime.now)
|