Skip to content

merge queue: checking main (2e6e1d4) and #8 together - #9

Closed
mergify[bot] wants to merge 5 commits into
mainfrom
mergify/merge-queue/6f4b3ad9a0
Closed

mergify[bot] wants to merge 5 commits into
mainfrom
mergify/merge-queue/6f4b3ad9a0

Conversation

@mergify

@mergify mergify Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

🎉 This pull request has been checked successfully and will be merged soon. 🎉

Branch main (2e6e1d4) and #8 are queued together for merge.

This pull request has been created by Mergify to check the mergeability of #8.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.

Required conditions of queue rule default for merge:

No extra conditions.

Required conditions to stay in the queue:

---
checking_base_sha: 2e6e1d40a706a58841f2f78c2058c851f05fb12a
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 8
    scopes: []
scopes: []
...

Wei Liu and others added 5 commits August 13, 2026 21:34
按 porting-to-new-api-2.md 移植 CSV 渠道模型导入功能:
- model: 新增 GetModelByName / UpdateMetaFields
- dto: 新增 ImportError / ImportWarning / ImportCsvResult
- service: 移植 ImportChannelModelsCSV 主流程与 14 个纯函数
  (shouldSkipCompletionRatio 用 GetCompletionRatioInfo().Locked 适配,
  并保留 vendor 前缀名永不跳过的守卫 —— 目标端读路径对 vendor 名先查 map)
- controller: 新增 ImportChannelModelsCsv (multipart 10MB 上限 + sentinel 错误码映射)
- router: /:id/import_models_csv @ authz.ChannelWrite
- 测试: 33 个 service 测试 + 3 个 model 测试 (6 个源端 DB-harness 集成测试保留 Skip)

Co-Authored-By: Claude <[email protected]>
按 porting-to-new-api-2.md 移植 Swagger 注解体系:
- 依赖: swaggo/swag v1.16.6 + gin-swagger v1.6.1 + files v1.0.1
- 全局注解入口 controller/swagger.go (new-api 品牌, BasePath /api)
- dto.APIResponse 响应形状
- makefile swag target (--parseDependency --parseInternal --tags '!Video','!Origin')
- router/main.go 挂载 /swagger/*any
- 38 个 handler 注解注入 10 个 controller (Logout 目标端无对应函数, 跳过)
- docs/ 生成物 (35 条公开路径) + 6 个门禁测试
  (admin 路径不泄漏 / 响应无 password / self 与 CSV 导入端点存在 / 无 video-kling)

Co-Authored-By: Claude <[email protected]>
- service: 初始化 Errors/Warnings 为空切片(JSON [] 而非 null);
  parseCSV 统一 TrimSpace model_id(渠道列表与 ratio key/models 行必须同名)
- controller: CSV 导入 @success 指向 dto.APIResponse 信封 + 声明 400/413/500;
  UpdateSelf 补 body 注解; TopUp 补 topUpRequest body 注解
- router: import_models_csv 权限 ChannelWrite → ChannelSensitiveWrite
  (导入改写全局 ratio 与 models 表,全站其他改价入口均为 RootAuth)
- router/main.go: /swagger/*any 仅 DEBUG=true 时挂载(生产默认关闭)
- 测试: TestPrechecks 去掉 t.Parallel(InitRatioSettings 写全局 map);
  新增 TestParseCSV_TrimsModelID; docs 门禁测试与 model 测试改用 testify
- 重新生成 docs/

Co-Authored-By: Claude <[email protected]>
- dto: 新增 ImportCsvAPIResponse(Data 显式引用 ImportCsvResult),
  CSV 导入 @success 指向它 —— 生成的 spec 暴露结构化结果的完整 schema
  (dto.APIResponse.data 为 interface{},客户端无法发现/校验)
- controller: topUpRequest.Key 加 binding:"required"
  (运行时空 key 提前 400 + 生成 schema required: [key] 同步)
- 重新生成 docs/

Co-Authored-By: Claude <[email protected]>
@mergify mergify Bot closed this Aug 14, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/6f4b3ad9a0 branch August 14, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants