-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cmd/gf): add custom field type mapping support for command gf gen dao
#3498
Conversation
@gqcn 麻烦review一下 |
@gqcn Please review it |
gf gen dao
Interesting feature! |
支持,我之前有想过,之前单纯指定类型并不够灵活,应该表名加字段加类型这样更好。现在有人实现了(¯▽¯)👍 |
Yes, I have thought before that simply specifying the type is not flexible enough. It would be better to add the table name, field and type. Now someone has achieved it(¯▽¯)👍 |
你们说有没有可能和原来的TypeMapping结合到一起,不过这样的使用难度会提高不少。 |
Do you think it is possible to combine it with the original TypeMapping, but it will be much more difficult to use. |
@hailaz TypeMapping 适用于按照数据库字段类型批量映射,FieldMapping适用于表字段特定指定类型。比如,json 类型,我们为了开发方便会建一个结构体进行映射 |
@hailaz TypeMapping is suitable for batch mapping according to database field types, and FieldMapping is suitable for specific specified types of table fields. For example, for the json type, we will build a structure for mapping for the convenience of development. |
TypeMapping 碰到必须优先引入这个依赖才可以生成dao成功,如果在表创建时在引入会出现失败的情况,建议不上这一块的test |
TypeMapping must first introduce this dependency before the DAO can be generated successfully. If the introduction fails when the table is created, it is not recommended to test this part. |
cli中执行shell 的问题,PR中修复了的 |
The problem of executing shell in cli is fixed in PR |
gf gen dao
gf gen dao
gf gen dao support type mapping for specific field of table