You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Package that You wish to enhance
github.com/gogf/gf/cmd/gf/v2
Enhancement description
The gf ctrl command adds a parameter to specify the template used when generating the controller file.
In the current template, the controller method template content is:
func (c *{CtrlName}) {MethodName}(ctx context.Context, req *{Version}.{MethodName}Req) (res *{Version}.{MethodName}Res, err error) {
// You can actually write some boilerplate syntax here, such as: link tracking code
return nil, gerror.NewCode(gcode.CodeNotImplemented)
}
In actual business, there is a lot of boilerplate syntax in this method, so we hope that the users can customize the template according to their needs.
Additional
Issues-translate-bot
changed the title
希望 gf gen ctrl 支持 controller 模板定制
Hope gf gen ctrl supports controller template customization
Apr 20, 2024
Package that You wish to enhance
github.com/gogf/gf/cmd/gf/v2
Enhancement description
gf ctrl命令增加一个参数,可以指定生成controller文件时使用的模板。
目前模板中,controller方法模板内容为:
func (c *{CtrlName}) {MethodName}(ctx context.Context, req *{Version}.{MethodName}Req) (res *{Version}.{MethodName}Res, err error) {
// 这里其实可以写一些样板语法,比如:链路追踪的代码
return nil, gerror.NewCode(gcode.CodeNotImplemented)
}
实际业务中,这个方法中有大量的样板语法,所以希望可以由使用的人来根据需要定制模板
Additional
The text was updated successfully, but these errors were encountered: