refactor: 全局适配 ApiFamily/EndpointKind 结构化标识体系

将新的 (ApiFamily, EndpointKind) / `family:kind` 签名体系应用到整个代码库:
- API Handlers: 所有 adapter/handler 使用新的签名格式
- Services: provider, model, usage, cache, auth 等服务层适配
- Database: ProviderEndpoint 新增 api_family/endpoint_kind 字段
- Frontend: Provider 管理、Usage 表格等组件适配
- Tests: 更新所有相关测试用例
This commit is contained in:
fawney19
2026-02-01 17:28:00 +08:00
parent c246ccfc91
commit 7b66505634
219 changed files with 4732 additions and 2545 deletions

View File

@@ -36,7 +36,9 @@ class _FakeSession:
# 如果 direct match 命中,不应再走 provider_model_name 分支
if entities == (Model, GlobalModel):
raise AssertionError("provider_model_name query should not run when direct match exists")
raise AssertionError(
"provider_model_name query should not run when direct match exists"
)
raise AssertionError(f"Unexpected query entities: {entities}")
@@ -64,6 +66,7 @@ async def test_resolve_global_model_prefers_direct_match(monkeypatch) -> None:
)
db = _FakeSession(direct_match=global_model)
resolved = await ModelCacheService.resolve_global_model_by_name_or_mapping(db, global_model.name)
resolved = await ModelCacheService.resolve_global_model_by_name_or_mapping(
db, global_model.name
)
assert resolved is global_model