-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Is your feature request related to a problem?
Option Yes
Describe the solution you'd like
可以通过在api的文件中增加req的注释,来生成到 controller 的函数注释。
比如
// GetUserInfoReq 获取用户信息
type GetUserInfoReq struct {
g.Meta `path:"/consumer/userInfo" method:"get"`
}
生成后的是下面这样
// GetUserInfo 获取用户信息
func (c *ControllerV1) GetUserInfo(ctx context.Context, req *v1.GetUserInfoReq) (res *v1.GetUserInfoRes, err error) {
return nil, gerror.NewCode(gcode.CodeNotImplemented)
}
Describe alternatives you've considered
- 在 genctrl_ast_parse.go 中增加注释的返回
- 在 genctrl_api_item.go 中增加注释的字段
- 在 genctrl_generate_ctrl.go 中使用注释生成到 controller 的函数上
Additional
No response