chore(prep): shared groundwork for the Sprint-2 parallel batch

第二批(T6~T11)协调提交:
- 迁移 0005:kb 七表(entity/relation/rule/chunk vector1024+tsv 生成列/
  asset/color/gap),HNSW+GIN 索引,FK 级联
- ORM:七个 Kb* 模型(pgvector Vector/TSVECTOR/Computed)
- 配置:检索与 embedding、华为 JWKS、短信全参数组
- 错误码:40110/40111/42910/42911/61000
- 骨架路由:kb.py + auth_sms.py(已注册);依赖:tencentcloud-sdk-python-sms
  + spike extra(onnxruntime/opencv);gitignore:models/ 与 spike 输出
This commit is contained in:
xsl
2026-08-14 17:01:43 +08:00
parent ddec3973ad
commit d5f366fa4c
11 changed files with 656 additions and 4 deletions
+11 -2
View File
@@ -12,7 +12,7 @@ from contextlib import asynccontextmanager
from fastapi import FastAPI
from apps.api.deps import build_llm_gateway
from apps.api.routers import agent, auth, events, health, quota, tasks, uploads
from apps.api.routers import agent, auth, auth_sms, events, health, kb, quota, tasks, uploads
from packages.shared.config import Settings, get_settings
from packages.shared.db import dispose_engine
from packages.shared.handlers import install_exception_handlers
@@ -69,7 +69,16 @@ def create_app(settings: Settings | None = None) -> FastAPI:
setup_tracing(app, cfg)
app.include_router(health.router)
routers = (auth.router, agent.router, quota.router, tasks.router, events.router, uploads.router)
routers = (
auth.router,
auth_sms.router,
agent.router,
quota.router,
tasks.router,
events.router,
uploads.router,
kb.router,
)
for router in routers:
app.include_router(router, prefix=cfg.api_prefix)
+12
View File
@@ -0,0 +1,12 @@
"""手机号验证码登录路由(骨架,T11 填充实现)。
POST /auth/sms/send、POST /auth/sms/verify;
实现契约见 docs/开发任务包/T11-短信登录代码先行.md。
与 auth.py(华为/dev-token/refresh)分文件以避免并行冲突。
"""
from __future__ import annotations
from fastapi import APIRouter
router = APIRouter(prefix="/auth", tags=["auth-sms"])
+10
View File
@@ -0,0 +1,10 @@
"""知识库实体路由(骨架,T6 填充实现)。
GET /kb/items 等;实现契约见 docs/开发任务包/T6-知识库实体与图谱.md。
"""
from __future__ import annotations
from fastapi import APIRouter
router = APIRouter(prefix="/kb", tags=["kb"])