Skip to content

Commit

Permalink
The docs for 'API/ZRPC/Model Code Generation' and 'API/ZRPC/Model Qui…
Browse files Browse the repository at this point in the history
…ck Code Generation' were confused
  • Loading branch information
liuxianloveqiqi authored and kesonan committed Oct 30, 2023
1 parent 5ffa7a8 commit e8b1707
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@

## zRPC 代码生成说明
`ZRPC Code Generation``ZRPC Quick Code Generation` 的区别是:
- `ZRPC Code Generation``goctl` 的相关指令参数均使用指定值,其代码生成指令内容如下:
- `ZRPC Quick Code Generation``goctl` 的相关指令参数均使用指定值,其代码生成指令内容如下:

```shell
$ goctl rpc protoc ${proto 文件路径} --style=gozero --home="~/.goctl" --go_out=${API 文件所在文件夹} --grpc-go_out=${API 文件所在文件夹} --zrpc_out=${API 文件所在文件夹}
```
- `ZRPC Quick Code Generation` 会打开弹窗让使用者填写 `--style``-- dir``--home`,`proto_path`(如果有 import 其他 proto 文件) 等信息
- `ZRPC Code Generation` 会打开弹窗让使用者填写 `--style``-- dir``--home`,`proto_path`(如果有 import 其他 proto 文件) 等信息

- 无 import 情况
![preview](./src/main/resources/static/api_code_gen_dialog.png)
- 有 import 情况,proto_path 目前只支持但文件选择,因此 **不支持 import 自不同文件夹的 proto**
Expand All @@ -100,11 +102,12 @@
**Model 代码生成默认都是带缓存的。**

`Model Code Generation``Model Quick Code Generation` 的区别是:
- `Model Code Generation``goctl` 的相关指令参数均使用指定值,其代码生成指令内容如下:
- `Model Quick Code Generation``goctl` 的相关指令参数均使用指定值,其代码生成指令内容如下:

```shell
$ goctl model mysql ddl --src=${sql 文件路径} --dir=${sql 文件所在文件夹} --style=gozero -c --home="~/.goctl"
```
- `Model Quick Code Generation` 会打开弹窗让使用者填写 `--style``-- dir``--home``--cache` 等信息
- `Model Code Generation` 会打开弹窗让使用者填写 `--style``-- dir``--home``--cache` 等信息
![preview](./src/main/resources/static/api_code_gen_dialog.png)
-
# 错误提示
Expand Down
13 changes: 8 additions & 5 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ In the target folder ` Right click -> New -> Go Zero -> Api Greet Service/Rpc Gr
## Api code generation instructions
The difference between `API Code Generation` and `API Quick Code Generation` is that
- `API Quick Code Generation` in `goctl` uses the specified values for the relevant command parameters, and its code generation instructions read as follows

```shell
$ goctl api go --api=${API file path} --style=gozero --home="~/.goctl" --dir=${API file folder}
```
Expand All @@ -78,11 +78,13 @@ The difference between `API Code Generation` and `API Quick Code Generation` is

## zRPC Code Generation Instructions
The difference between `ZRPC Code Generation` and `ZRPC Quick Code Generation` is that
- `ZRPC Code Generation` uses the specified values for the relevant command parameters of `goctl`, and its code generation instructions read as follows
- `ZRPC Quick Code Generation` uses the specified values for the relevant command parameters of `goctl`, and its code generation instructions read as follows

```shell
$ goctl rpc protoc ${proto file path} --style=gozero --home="~/.goctl" --go_out=${API file folder} --grpc-go_out=${API file folder} --zrpc_out=${API file folder }
```
- `ZRPC Quick Code Generation` will open a popup window for users to fill in `--style`, `-- dir`, `--home`, `proto_path` (if there are other proto files imported), etc.
- `ZRPC Code Generation` will open a popup window for users to fill in `--style`, `-- dir`, `--home`, `proto_path` (if there are other proto files imported), etc.

- No import case
![preview](./src/main/resources/static/api_code_gen_dialog.png)
- With import, proto_path currently only supports but file selection, so **importing proto from a different folder is not supported**.
Expand All @@ -99,11 +101,12 @@ The difference between `ZRPC Code Generation` and `ZRPC Quick Code Generation` i
**Model code generation is cached by default. **

The difference between `Model Code Generation` and `Model Quick Code Generation` is that
- `Model Code Generation` uses the specified values for the `goctl` command parameters, and the code generation commands are as follows
- `Model Quick Code Generation` uses the specified values for the `goctl` command parameters, and the code generation commands are as follows

```shell
$ goctl model mysql ddl --src=${sql file path} --dir=${sql file folder} --style=gozero -c --home="~/.goctl"
```
- `Model Quick Code Generation` will open a popup for the user to fill in `--style`, `-- dir`, `--home`, `--cache`, etc.
- `Model Code Generation` will open a popup for the user to fill in `--style`, `-- dir`, `--home`, `--cache`, etc.
![preview](./src/main/resources/static/api_code_gen_dialog.png)
-
# Error message
Expand Down

0 comments on commit e8b1707

Please sign in to comment.