Files
Neo-ZQYY/apps/backend/app/schemas/admin_registry.py
Neo 6f8f12314f feat: 累积功能变更 — 聊天集成、租户管理、小程序更新、ETL 增强、迁移脚本
包含多个会话的累积代码变更:
- backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔
- admin-web: ETL 状态页、任务管理、调度配置、登录优化
- miniprogram: 看板页面、聊天集成、UI 组件、导航更新
- etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强
- tenant-admin: 项目初始化
- db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8)
- packages/shared: 枚举和工具函数更新
- tools: 数据库工具、报表生成、健康检查
- docs: PRD/架构/部署/合约文档更新

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 00:03:48 +08:00

85 lines
2.4 KiB
Python
Raw Permalink 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.
# -*- coding: utf-8 -*-
"""
管理端 — 注册体系 Pydantic Schema。
覆盖租户列表、店铺列表、简写ID 管理、店铺同步。
需求: A2.1, A2.2, A2.4, A2.5
"""
from __future__ import annotations
from datetime import datetime
from app.schemas.base import CamelModel
# ── 租户 ──────────────────────────────────────────────────
class TenantItem(CamelModel):
"""租户列表项(含连接器名称)。"""
id: int
tenant_id: int
tenant_name: str | None = None
connector_name: str
is_active: bool
# ── 店铺 ──────────────────────────────────────────────────
class SiteItem(CamelModel):
"""店铺列表项。"""
id: int
site_id: int
site_name: str | None = None
site_code: str | None = None
site_label: str | None = None
is_active: bool
# ── 简写ID 管理 ──────────────────────────────────────────
class UpdateSiteCodeRequest(CamelModel):
"""设置/修改店铺简写ID 请求。"""
new_code: str # 6 位3+3 格式,统一大写
class SiteCodeResult(CamelModel):
"""简写ID 修改结果。"""
site_id: int
old_code: str | None = None
new_code: str
history_cleaned: bool # 旧 code 是否被清理
class SiteCodeHistoryItem(CamelModel):
"""简写ID 变更历史条目。"""
id: int
site_code: str
is_current: bool
created_at: datetime
retired_at: datetime | None = None
# ── 店铺同步 ─────────────────────────────────────────────
class SiteSyncResult(CamelModel):
"""店铺同步结果。"""
inserted: int # 新增店铺数
updated: int # 更新店铺数
# ── 测试用:手动创建/删除店铺 ─────────────────────────────
class CreateSiteRequest(CamelModel):
"""手动创建店铺请求(测试功能)。"""
tenant_id: int # 所属租户biz.tenants.tenant_id上游 BIGINT
site_id: int # 上游系统店铺 IDBIGINT
site_name: str # 店铺名称
site_code: str | None = None # 可选简写ID6 位 3+3 格式)