Repository navigation
merge queue: checking main (2e6e1d4) and #8 together - #9
Closed
mergify[bot] wants to merge 5 commits into
Closed
mergify[bot] wants to merge 5 commits into
mergify[bot] wants to merge 5 commits into
Conversation
按 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]>
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 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
defaultfor merge:No extra conditions.
Required conditions to stay in the queue:
base = main