diff --git a/README.md b/README.md index 486c99b..6e9380c 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ targets: column_mapper: snake # how column name map to class or struct field name table_prefix: "" # table prefix multiple_files: true # generate multiple files or one + language: golang template: | # template for code file, it has higher perior than template_path package models @@ -86,6 +87,11 @@ targets: - *TableMapper*: Mapper method to convert table name to class/struct name. - *ColumnMapper*: Mapper method to convert column name to class/struct field name. +## Golang Template Funcs + +- *Type*: return column's golang type +- *Tag*: return golang struct tag for column + ## Template Vars - *Tables*: All tables. diff --git a/README_CN.md b/README_CN.md index 7f45865..2de7856 100644 --- a/README_CN.md +++ b/README_CN.md @@ -54,6 +54,7 @@ targets: column_mapper: snake # 字段名到代码或结构体成员的映射关系 table_prefix: "" # 表前缀 multiple_files: true # 是否生成多个文件 + language: golang template: | # 生成模板,如果这里定义了,优先级比 template_path 高 package models @@ -82,6 +83,11 @@ targets: - *TableMapper*: 将表名转为结构体名的映射函数。 - *ColumnMapper*: 将字段名转为结构体成员名的函数。 +## Go 语言模版函数 + +- *Type*: 返回Go语言的类型 +- *Tag*: 返回Go语言的Tag信息 + ## 模板变量 - *Tables*: 所有表。