mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-25 21:57:48 +00:00
refactor: 统一详情接口权限标识从query改为detail feat(tenant): 为租户模型添加domain字段支持 fix(cron): 移除定时任务触发参数只读限制 perf(menu): 优化菜单权限标识注释说明 refactor(model): 为多个模型添加租户关联支持 style(main): 调整CSS导入顺序和格式 chore(package): 替换前端流程图库为@vue-flow系列 fix(token): 修正令牌详情接口权限标识 docs(sql): 更新菜单权限标识注释为query格式
26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from sqlalchemy import JSON, String, Integer
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.base_model import ModelMixin, TenantMixin, UserMixin
|
|
|
|
|
|
class McpModel(ModelMixin, TenantMixin, UserMixin):
|
|
"""
|
|
MCP 服务器表
|
|
MCP类型:
|
|
- 0: stdio (标准输入输出)
|
|
- 1: sse (Server-Sent Events)
|
|
"""
|
|
__tablename__: str = 'app_ai_mcp'
|
|
__table_args__: dict[str, str] = ({'comment': 'MCP 服务器表'})
|
|
__loader_options__: list[str] = ["created_by", "updated_by", "tenant"]
|
|
|
|
name: Mapped[str] = mapped_column(String(50), comment='MCP 名称')
|
|
type: Mapped[int] = mapped_column(Integer, default=0, comment='MCP 类型(0:stdio 1:sse)')
|
|
url: Mapped[str | None] = mapped_column(String(255), default=None, comment='远程 SSE 地址')
|
|
command: Mapped[str | None] = mapped_column(String(255), default=None, comment='MCP 命令')
|
|
args: Mapped[str | None] = mapped_column(String(255), default=None, comment='MCP 命令参数')
|
|
env: Mapped[dict[str, str] | None] = mapped_column(JSON(), default=None, comment='MCP 环境变量')
|