fix: 恢复 gen route 的 model 参数渲染到 f2a8b98 实现

- 恢复 buildParamToken 函数的直接实现,移除复杂的 builder 模式
- 恢复 buildRenderData 函数的简单实现,提高代码可读性
- 恢复 Render 函数的基础实现,移除过度工程化的验证逻辑
- 修复路由分组路径问题:移除 buildResult 中错误的路径覆盖逻辑
- 当使用 model() 绑定时生成完整的数据库查询函数代码

此提交将 gen route 功能恢复到 commit f2a8b9876e
的实现方式,确保 model 参数渲染符合原始设计。

修复问题:
- 修复路由生成时 "open /v1/medias/routes.gen.go: no such file or directory" 错误
- 确保 model 参数正确生成完整的数据库查询代码而非简化接口
This commit is contained in:
Rogee
2025-09-22 19:01:40 +08:00
parent 4bd9f2f3eb
commit 439456b6ad
4 changed files with 109 additions and 359 deletions

View File

@@ -103,7 +103,7 @@ func commandGenRouteE(cmd *cobra.Command, args []string) error {
}
routeGroups := lo.GroupBy(routes, func(item route.RouteDefinition) string {
return filepath.Dir(item.FilePath)
return filepath.Dir(item.Path)
})
for path, routes := range routeGroups {