go-zero
go-zero copied to clipboard
Questions on generating models with goctl.
请问,支持外部变量不,或者有什么方式可以在模板里头定义变量,如果当前table含有该变量的字段名时,才生成相应的代码。例如:当有version字段时,就生成版本号更新操作的代码。
I agree with you
请问,支持外部变量不,或者有什么方式可以在模板里头定义变量,如果当前table含有该变量的字段名时,才生成相应的代码。例如:当有version字段时,就生成版本号更新操作的代码。
你这个功能需要你自己修改定制goctl功能
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Excuse me, does it support external variables, or is there any way to define variables in the template, if the current table contains the field name of the variable, the corresponding code will be generated. For example, when there is a version field, the code for the version number update operation is generated.
Your function requires you to modify the custom goctl function yourself
外部变量获取比较复杂,实用性低,以目前看来暂不会支持
It is difficult to get external variables, and there has no more improvements for this change, so it would't be supported so far.