5 Commits
Author SHA1 Message Date
19904408334 923644db2b refactor: 模型错误解析改为 ErrorMessageMapping 配置驱动
- parseModelError 按模型配置的 ErrorMessageMapping(schema 树)解析错误响应
- 成功判定: code 提取为空 / code 节点配置 defaultValue 且提取值等于它 → 成功
- 未配置 mapping 不识别错误(纯配置驱动), 删硬编码 ModelErrorResp/ModelError1Resp
- DTO 加 errorMessageMapping 字段, update.sql 建 error_message_mapping JSONB 列
- 单测: parse_error_test.go 覆盖扁平/嵌套/数组/纯字符串路径/未配置/坏 JSON
2026-08-29 17:52:23 +08:00
19904408334andClaude b165ef4f3e refactor: 引用系统模型并入 Update,删除 /referenceSystemModel 端点
非超管 updateModelManage 编辑系统模型时直接插引用行(apiKey 必填、同名唯一、
不拷贝配置),前端继续走 updateModelManage 即可引用,无需换接口。

- 删 service.ReferenceSystemModel / controller.ReferenceModel / ReferenceSystemModelReq/Res
- Update:恢复引用行(refSystemModelId>0)个人字段分支(只改 apiKey/enabled/chatModel)
- 修复同名唯一性检查丢失自排除(exist.Id != req.Id),允许不改名编辑
- 非超管建引用行补 apiKey 必填校验

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-29 16:46:24 +08:00
19904408334andClaude 4afb920456 feat: model_manage 增加 ref_system_model_id 引用列与引用 DTO
- entity/dto 落地 ref_system_model_id 字段 + ReferenceSystemModelReq/Res
- DAO 新增 CountReferences / UpdateReferencesName 辅助方法
- roundtrip 单测验证 DTO→entity 映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-29 14:35:12 +08:00
19904408334andClaude 928682f121 feat: 模型计费收敛到 shop-user-trade(去 admin 租户扣费 + /calc 算费)
- 删 CheckTenantBalance/DeductBalance/GetTenantSurplus(admin-go 租户余额退出 model-gateway)
- 新增 pricing_client.go:门禁 config/get + calcModelCost 调 shop-user-trade /calc 算费
- sync/stream/async 三处 Cost 改为按用量调 /calc(媒体类型映射 text/audio/video/image)
- 删 price.go 本地 PriceConfig 换算体系与 entity/dto 的 price_config 字段

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-29 14:32:51 +08:00
19904408334 76c55fbb73 feat: 新增业务字段路径读写工具
新增 TakeBusinessFields、WriteBusinessFields、SetByPath 与 GetByPath 等工具,支持按映射路径写入请求体与解析响应,并更新相关依赖。
2026-08-18 10:11:09 +08:00