渠道: 模型名称映射(网关生效 + 渠道侧管理)

- 候选渠道携带 upstream_model, prepareUpstream 改写请求体 model 字段为上游名
- 新增渠道视角绑定 CRUD: GET/POST/PATCH/DELETE /admin/channels/:id/models
- 前端渠道页新增"模型映射": 列出绑定、内联改上游名、解除、添加
- rewriteModel 三种协议通用(model 均在顶层)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Sakurasan
2026-08-16 00:09:01 +08:00
co-authored by Claude
parent 8d9940ad5a
commit 4d4d09ba58
8 changed files with 331 additions and 33 deletions
+2 -2
View File
@@ -54,8 +54,8 @@ func TestCandidatesFiltersUnhealthy(t *testing.T) {
if len(cands) != 2 {
t.Fatalf("candidates = %d, want 2", len(cands))
}
if cands[0].Name != "a" {
t.Fatalf("first by priority should be a, got %s", cands[0].Name)
if cands[0].Channel.Name != "a" {
t.Fatalf("first by priority should be a, got %s", cands[0].Channel.Name)
}
}