doc: 更新README
This commit is contained in:
12
README.md
12
README.md
@@ -35,8 +35,9 @@ or: [Dowloading](https://github.com/xxjwxc/gormt/releases)
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
## 1. Configure default configuration items through the current directory config.yml file
|
## 1. Configure default configuration items through the current directory config.yml file
|
||||||
```
|
note: for latest version of config format, please check /data/config/MyIni.go
|
||||||
out_dir : "." # out dir
|
```yml
|
||||||
|
out_dir : "./model" # out dir
|
||||||
url_tag : json # web url tag(json,db(https://github.com/google/go-querystring))
|
url_tag : json # web url tag(json,db(https://github.com/google/go-querystring))
|
||||||
language : # language(English,中 文)
|
language : # language(English,中 文)
|
||||||
db_tag : gorm # DB tag(gorm,db)
|
db_tag : gorm # DB tag(gorm,db)
|
||||||
@@ -44,18 +45,21 @@ singular_table : true # Table name plural (big Camel-Case):gorm.SingularTable
|
|||||||
simple : false #simple output
|
simple : false #simple output
|
||||||
is_out_sql : false # Whether to output sql
|
is_out_sql : false # Whether to output sql
|
||||||
is_out_func : true # Whether to output function
|
is_out_func : true # Whether to output function
|
||||||
is_url_tag : true # Whether to mark web or not
|
|
||||||
is_foreign_key : true # Whether to mark foreign key or not
|
is_foreign_key : true # Whether to mark foreign key or not
|
||||||
is_gui : false # Whether to operate on gui
|
is_gui : false # Whether to operate on gui
|
||||||
is_table_name : false # Whether to out GetTableName function
|
is_table_name : false # Whether to out GetTableName function
|
||||||
is_null_to_point : false # database is 'DEFAULT NULL' then set element type as point
|
is_null_to_point : false # database is 'DEFAULT NULL' then set element type as point
|
||||||
|
is_web_tag: false
|
||||||
|
is_web_tag_pk_hidden: false
|
||||||
|
|
||||||
mysql_info :
|
db_info :
|
||||||
host : "127.0.0.1"
|
host : "127.0.0.1"
|
||||||
port : 3306
|
port : 3306
|
||||||
username : "root"
|
username : "root"
|
||||||
password : "qwer"
|
password : "qwer"
|
||||||
database : "oauth_db"
|
database : "oauth_db"
|
||||||
|
type: 0
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
## 2. get help
|
## 2. get help
|
||||||
|
|||||||
@@ -36,28 +36,34 @@ go get -u -v github.com/xxjwxc/gormt@master
|
|||||||
或者: [下载地址](https://github.com/xxjwxc/gormt/releases)
|
或者: [下载地址](https://github.com/xxjwxc/gormt/releases)
|
||||||
|
|
||||||
## 1. 通过当前目录 config.yml 文件配置默认配置项
|
## 1. 通过当前目录 config.yml 文件配置默认配置项
|
||||||
```
|
注意:最新的配置请参考 [MyIni.go](/data/config/MyIni.go), 或使用命令行工具默认生成的。
|
||||||
|
|
||||||
|
```yml
|
||||||
base:
|
base:
|
||||||
is_dev : false
|
is_dev: false
|
||||||
out_dir : ./model # 输出目录
|
out_dir: ./model # 输出目录
|
||||||
url_tag : json # web url tag(json,db(https://github.com/google/go-querystring))
|
url_tag: json # web url tag(json,db(https://github.com/google/go-querystring))
|
||||||
language : # 语言(English,中 文)
|
language: 中 文 # 语言(English,中 文)
|
||||||
db_tag : gorm # 数据库标签(gorm,db)
|
db_tag: gorm # 数据库标签(gorm,db)
|
||||||
singular_table : false # 单表模式:true:禁用表名复数,false:采用表明复数 参考:gorm.SingularTable
|
singular_table: true # 单表模式:true:禁用表名复数,false:采用表明复数 参考:gorm.SingularTable
|
||||||
simple : false # 简单输出(默认gorm标签不输出)
|
simple: false # 简单输出(默认gorm标签不输出)
|
||||||
is_out_sql : false # 是否输出 sql 原信息
|
is_out_sql: false # 是否输出 sql 原信息
|
||||||
is_out_func : true # 是否输出 快捷函数
|
is_out_func: true # 是否输出 快捷函数
|
||||||
is_url_tag : true # 是否打web标记
|
is_foreign_key: true # 是否导出外键关联
|
||||||
is_foreign_key : true # 是否导出外键关联
|
is_gui: false # 是否ui模式显示
|
||||||
is_gui : false # 是否ui模式显示
|
is_table_name: false # 是否直接生成表名函数
|
||||||
is_table_name : false # 是否直接生成表名函数
|
is_null_to_point: false # 数据库默认 'DEFAULT NULL' 时设置结构为指针类型
|
||||||
is_null_to_point : false # 数据库默认 'DEFAULT NULL' 时设置结构为指针类型
|
is_web_tag: false
|
||||||
mysql_info:
|
is_web_tag_pk_hidden: false
|
||||||
|
db_info:
|
||||||
host : 127.0.0.1
|
host : 127.0.0.1
|
||||||
port : 3306
|
port : 3306
|
||||||
username : root
|
username : root
|
||||||
password : qwer
|
password : qwer
|
||||||
database : oauth_db
|
database : oauth_db
|
||||||
|
type: 0
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. 可以使用命令行工具更新配置项
|
## 2. 可以使用命令行工具更新配置项
|
||||||
@@ -65,7 +71,8 @@ mysql_info:
|
|||||||
```
|
```
|
||||||
./gormt -H=127.0.0.1 -d=oauth_db -p=qwer -u=root --port=3306
|
./gormt -H=127.0.0.1 -d=oauth_db -p=qwer -u=root --port=3306
|
||||||
```
|
```
|
||||||
|
命令行工具默认会生成`config.yml`, 具体位置为gormt 可执行文件所在目录。
|
||||||
|
可以通过 `which gormt` 查找所在目录。
|
||||||
## 3. 查看帮助
|
## 3. 查看帮助
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user