diff --git a/pkg/ast/route/route.go b/pkg/ast/route/route.go index 9c653ba..2473b7b 100644 --- a/pkg/ast/route/route.go +++ b/pkg/ast/route/route.go @@ -29,12 +29,11 @@ type ActionDefinition struct { } type ParamDefinition struct { - Name string - Type string - Key string - Table string - Model string - Position Position + Name string + Type string + Key string + Model string + Position Position } type Position string @@ -252,11 +251,9 @@ func parseRouteBind(bind string) ParamDefinition { param.Position = positionFromString(parts[i+2]) case "key": param.Key = parts[i+1] - case "table": - param.Table = parts[i+1] - case "model": - param.Model = parts[i+1] - } + case "model": + param.Model = parts[i+1] + } } return param } diff --git a/templates/project/README.md.raw b/templates/project/README.md.raw index b0de2ec..1cd18ce 100644 --- a/templates/project/README.md.raw +++ b/templates/project/README.md.raw @@ -10,10 +10,10 @@ - `@Router []` - 例如:`@Router /users/:id [get]` -- `@Bind [key()] [table()] [model()]` + - `@Bind [key()] [model()]` - `paramName` 必须与方法参数名一致(大小写敏感) - `position` 取值:`path`、`query`、`body`、`header`、`cookie`、`local`、`file` - - 可选:`key()` 为覆盖默认键名;`table()`、`model()` 解析并保留,当前不参与渲染(为后续扩展预留) + - 可选:`key()` 为覆盖默认键名;`model()` 解析并保留,当前不参与渲染(为后续扩展预留) ### 参数来源与绑定生成 @@ -86,5 +86,5 @@ router.Get("/users/:id", DataFunc4( ### 错误与限制 - 无效的 `@Router` 语法会报错;无效的 `position` 会在解析阶段触发错误。 -- `file` 目前仅支持单文件头;`table()`、`model()` 尚未参与代码生成。 +- `file` 目前仅支持单文件头;`model()` 尚未参与代码生成。 - 请与实际路由段保持一致(特别是 `path` 的 `key` 与路径变量名)。