- 新增 platform_apps 表和 App 模型 - 新增应用管理页面 /apps - 应用配置页面添加"生成链接"功能 - 支持一键生成带签名的访问 URL
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""数据模型"""
|
||||
from .tenant import Tenant, Subscription, Config
|
||||
from .tenant_app import TenantApp
|
||||
from .app import App
|
||||
from .stats import AICallEvent, TenantUsageDaily
|
||||
from .logs import PlatformLog
|
||||
|
||||
@@ -7,6 +9,8 @@ __all__ = [
|
||||
"Tenant",
|
||||
"Subscription",
|
||||
"Config",
|
||||
"TenantApp",
|
||||
"App",
|
||||
"AICallEvent",
|
||||
"TenantUsageDaily",
|
||||
"PlatformLog"
|
||||
|
||||
23
backend/app/models/app.py
Normal file
23
backend/app/models/app.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""应用定义模型"""
|
||||
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)
|
||||
Reference in New Issue
Block a user