Browse Source

Fix docs

main
Lunny Xiao 4 years ago
parent
commit
0d6e84ae90
No known key found for this signature in database GPG Key ID: C3B7C91B632F738A
  1. 6
      README.md
  2. 6
      README_CN.md

6
README.md

@ -54,6 +54,7 @@ targets:
column_mapper: snake # how column name map to class or struct field name column_mapper: snake # how column name map to class or struct field name
table_prefix: "" # table prefix table_prefix: "" # table prefix
multiple_files: true # generate multiple files or one multiple_files: true # generate multiple files or one
language: golang
template: | # template for code file, it has higher perior than template_path template: | # template for code file, it has higher perior than template_path
package models package models
@ -86,6 +87,11 @@ targets:
- *TableMapper*: Mapper method to convert table name to class/struct name. - *TableMapper*: Mapper method to convert table name to class/struct name.
- *ColumnMapper*: Mapper method to convert column name to class/struct field 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 ## Template Vars
- *Tables*: All tables. - *Tables*: All tables.

6
README_CN.md

@ -54,6 +54,7 @@ targets:
column_mapper: snake # 字段名到代码或结构体成员的映射关系 column_mapper: snake # 字段名到代码或结构体成员的映射关系
table_prefix: "" # 表前缀 table_prefix: "" # 表前缀
multiple_files: true # 是否生成多个文件 multiple_files: true # 是否生成多个文件
language: golang
template: | # 生成模板,如果这里定义了,优先级比 template_path 高 template: | # 生成模板,如果这里定义了,优先级比 template_path 高
package models package models
@ -82,6 +83,11 @@ targets:
- *TableMapper*: 将表名转为结构体名的映射函数。 - *TableMapper*: 将表名转为结构体名的映射函数。
- *ColumnMapper*: 将字段名转为结构体成员名的函数。 - *ColumnMapper*: 将字段名转为结构体成员名的函数。
## Go 语言模版函数
- *Type*: 返回Go语言的类型
- *Tag*: 返回Go语言的Tag信息
## 模板变量 ## 模板变量
- *Tables*: 所有表。 - *Tables*: 所有表。
Loading…
Cancel
Save