@@ -22,16 +22,24 @@ go install github.com/gin-admin/gin-admin-cli/v10@latest
22
22
gin-admin-cli new -d ~ /go/src --name testapp --desc ' A test API service based on golang.' --pkg ' github.com/xxx/testapp'
23
23
```
24
24
25
- ### Generate a new struct
25
+ ### Quick generate a struct
26
+
27
+ ``` bash
28
+ gin-admin-cli gen -d ~ /go/src/testapp -m SYS --structs Dictionary --structs-comment " Dictionaries management" --structs-router-prefix
29
+ ```
30
+
31
+ ### Use config file to generate struct
26
32
27
33
> More examples can be found in the [ examples directory] ( https://github.com/gin-admin/gin-admin-cli/tree/master/examples )
28
34
29
35
Using ` Dictionary ` as an example, the configuration file is as follows ` dictionary.yaml ` :
30
36
31
37
``` yaml
32
38
- name : Dictionary
33
- comment : Dictionary management for system
39
+ comment : Dictionaries management
34
40
disable_pagination : true
41
+ fill_gorm_commit : true
42
+ fill_router_prefix : true
35
43
tpl_type : " tree"
36
44
fields :
37
45
- name : Code
@@ -118,20 +126,20 @@ USAGE:
118
126
gin-admin-cli generate [command options] [arguments...]
119
127
120
128
OPTIONS:
121
- --dir value, -d value The project directory to generate the struct
122
- --module value, -m value The module to generate the struct from (like: RBAC)
123
- --module-path value The module path to generate the struct from (default: internal/mods)
124
- --wire-path value The wire generate path to generate the struct from (default: internal/wirex)
125
- --swag-path value The swagger generate path to generate the struct from (default: internal/swagger)
126
- --config value, -c value The config file or directory to generate the struct from (JSON/YAML)
127
- --structs value, -s value The struct to generate (multiple structs can be separated by a comma)
128
- --structs-comment value Specify the struct comment
129
- --structs-output value Specify the packages to generate the struct (default: schema,dal,biz,api )
130
- --tpl-path value The template path to generate the struct from (default use tpls )
131
- --tpl-type value The template type to generate the struct from (default: default )
132
- --fe-dir value The frontend project directory to generate the UI
133
- --fe-tpl-type value The template type to generate the frontend from (default: react)
134
- --help, -h show help
129
+ --dir value, -d value The project directory to generate the struct
130
+ --module value, -m value The module to generate the struct from (like: RBAC)
131
+ --module-path value The module path to generate the struct from (default: internal/mods)
132
+ --wire-path value The wire generate path to generate the struct from (default: internal/wirex)
133
+ --swag-path value The swagger generate path to generate the struct from (default: internal/swagger)
134
+ --config value, -c value The config file or directory to generate the struct from (JSON/YAML)
135
+ --structs value The struct name to generate
136
+ --structs-comment value Specify the struct comment
137
+ --structs-router-prefix Use module name as router prefix (default: false )
138
+ --structs-output value Specify the packages to generate the struct (default: schema,dal,biz,api )
139
+ --tpl-path value The template path to generate the struct from (default use tpls )
140
+ --tpl-type value The template type to generate the struct from (default: default)
141
+ --fe-dir value The frontend project directory to generate the UI
142
+ --help, -h show help
135
143
```
136
144
137
145
### Remove command
0 commit comments