Browse Source

Merge pull request #10448 from abpframework/liangshiwei/docs

Update generate proxy command document
pull/10450/head
maliming 5 years ago
committed by GitHub
parent
commit
0378feef37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 58
      docs/en/CLI.md
  2. 60
      docs/zh-Hans/CLI.md

58
docs/en/CLI.md

@ -266,43 +266,75 @@ abp get-source Volo.Blogging --local-framework-ref --abp-path D:\GitHub\abp
### generate-proxy
Generates Angular service proxies for your HTTP APIs to make easy to consume your services from the client side. Your host (server) application must be up and running before running this command.
Generates Angular, C# or JavaScript service proxies for your HTTP APIs to make easy to consume your services from the client side. Your host (server) application must be up and running before running this command.
Usage:
````bash
abp generate-proxy
abp generate-proxy -t <client-type> [options]
````
Examples:
````bash
abp generate-proxy -t ng
abp generate-proxy -t js -url https://localhost:44302/
abp generate-proxy -t csharp -url https://localhost:44302/
````
#### Options
* `--type` or `-t`: The name of client type. Available clients:
* `csharp`: C#, work in the `*.HttpApi.Client` project directory. There are some additional options for this client:
* `--folder`: Folder name to place generated CSharp code in. Default value: `ClientProxies`.
* `ng`: Angular. There are some additional options for this client:
* `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
* `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
* `js`: JavaScript. work in the `*.Web` project directory. There are some additional options for this client:
* `--output` or `-o`: JavaScript file path or folder to place generated code in.
* `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`.
* `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
* `--target` or `-t`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
* `--working-directory` or `-wd`: Execution directory. For `csharp` and `js` client types.
* `--url` or `-u`: API definition URL from. For `csharp` and `js` client types.
> See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more.
### remove-proxy
Removes previously generated proxy code from the Angular application. Your host (server) application must be up and running before running this command.
Removes previously generated proxy code from the Angular, CSharp or JavaScript application. Your host (server) application must be up and running before running this command.
This can be especially useful when you generate proxies for multiple modules before and need to remove one of them later.
Usage:
````bash
abp remove-proxy
abp remove-proxy -t <client-type> [options]
````
Examples:
````bash
abp remove-proxy -t ng
abp remove-proxy -t js -m identity -o Pages/Identity/client-proxies.js
abp remove-proxy -t csharp --folder MyProxies/InnerFolder
````
#### Options
* `--module` or `-m`: Specifies the name of the backend module you wish to remove proxies for. Default value: `app`.
* `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
* `--target` or `-t`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
* `--type` or `-t`: The name of client type. Available clients:
* `csharp`: C#, work in the `*.HttpApi.Client` project directory. There are some additional options for this client:
* `--folder`: Folder name to place generated CSharp code in. Default value: `ClientProxies`.
* `ng`: Angular. There are some additional options for this client:
* `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
* `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
* `js`: JavaScript. work in the `*.Web` project directory. There are some additional options for this client:
* `--output` or `-o`: JavaScript file path or folder to place generated code in.
* `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`.
* `--working-directory` or `-wd`: Execution directory. For `csharp` and `js` client types.
* `--url` or `-u`: API definition URL from. For `csharp` and `js` client types.
> See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more.

60
docs/zh-Hans/CLI.md

@ -188,43 +188,75 @@ abp add-module Volo.Blogging
### generate-proxy
您的HTTP API生成Angular服务代理,简化从客户端使用服务的成本. 在运行此命令之前,你的host必须启动正在运行.
你的HTTP API生成Angular, C# 或 JavaScript服务代理,简化从客户端使用服务的成本. 在运行此命令之前,你的host必须启动正在运行.
用法:
````bash
abp generate-proxy
abp generate-proxy -t <client-type> [options]
````
示例:
````bash
abp generate-proxy -t ng
abp generate-proxy -t js -url https://localhost:44302/
abp generate-proxy -t csharp -url https://localhost:44302/
````
#### Options
* `--type``-t`: 客户端类型的名称. 可用的客户端有:
* `csharp`: C#, 工作在 `*.HttpApi.Client` 项目目录. 此客户端有一些可选选项:
* `--folder`: 放置生成的 CSharp 代码的文件夹名称. 默认值: `ClientProxies`.
* `ng`: Angular. 此客户端有一些可选选项:
* `--api-name``-a`: 在 `/src/environments/environment.ts` 中定义的API端点名称。. 默认值: `default`.
* `--source``-s`: 指定解析根名称空间和API定义URL的Angular项目名称. 默认值: `defaultProject`
* `--target``-t`: 指定放置生成的代码的Angular项目名称. 默认值: `defaultProject`.
* `--prompt``-p`: 在命令行提示符下询问选项(未指定的选项).
* `js`: JavaScript. 工作在 `*.Web` 项目目录. 此客户端有一些可选选项:
* `--output` or `-o`: 放置生成的 JavaScript 代码的文件夹名称.
* `--module``-m`: 指定要为其生成代理的后端模块的名称. 默认值: `app`.
* `--api-name``-a`: 在 `/src/environments/environment.ts` 中定义的API端点名称。. 默认值: `default`.
* `--source``-s`: 指定解析根名称空间和API定义URL的Angular项目名称. 默认值: `defaultProject`
* `--target``-t`: 指定放置生成的代码的Angular项目名称. 默认值: `defaultProject`.
* `--prompt``-p`: 在命令行提示符下询问选项(未指定的选项).
* `--working-directory` or `-wd`: 执行目录. 用于 `csharp``js` 客户端类型.
* `--url` or `-u`: API定义的URL. 用于 `csharp``js` 客户端类型.
> 参阅 [Angular服务代理文档](UI/Angular/Service-Proxies.md) 了解更多.
### remove-proxy
从Angular应用程序中删除以前生成的代理代码. 在运行此命令之前,你的host必须启动正在运行.
从Angular, CSharp 或 JavaScript应用程序中删除以前生成的代理代码. 在运行此命令之前,你的host必须启动正在运行.
This can be especially useful when you generate proxies for multiple modules before and need to remove one of them later.
这在你之前为多个模块生成代理并且需要删除其中一个模块时特别有用.
Usage:
用法:
````bash
abp remove-proxy -t <client-type> [options]
````
示例:
````bash
abp remove-proxy
abp remove-proxy -t ng
abp remove-proxy -t js -m identity -o Pages/Identity/client-proxies.js
abp remove-proxy -t csharp --folder MyProxies/InnerFolder
````
#### Options
* `--type``-t`: 客户端类型的名称. 可用的客户端有:
* `csharp`: C#, 工作在 `*.HttpApi.Client` 项目目录. 此客户端有一些可选选项:
* `--folder`: 放置生成的 CSharp 代码的文件夹名称. 默认值: `ClientProxies`.
* `ng`: Angular. 此客户端有一些可选选项:
* `--api-name``-a`: 在 `/src/environments/environment.ts` 中定义的API端点名称。. 默认值: `default`.
* `--source``-s`: 指定解析根名称空间和API定义URL的Angular项目名称. 默认值: `defaultProject`
* `--target``-t`: 指定放置生成的代码的Angular项目名称. 默认值: `defaultProject`.
* `--prompt``-p`: 在命令行提示符下询问选项(未指定的选项).
* `js`: JavaScript. 工作在 `*.Web` 项目目录. 此客户端有一些可选选项:
* `--output` or `-o`: 放置生成的 JavaScript 代码的文件夹名称.
* `--module``-m`: 指定要为其生成代理的后端模块的名称. 默认值: `app`.
* `--api-name``-a`: 在 `/src/environments/environment.ts` 中定义的API端点名称。. 默认值: `default`.
* `--source``-s`: 指定解析根名称空间和API定义URL的Angular项目名称. 默认值: `defaultProject`
* `--target``-t`: 指定放置生成的代码的Angular项目名称. 默认值: `defaultProject`.
* `--prompt``-p`: 在命令行提示符下询问选项(未指定的选项).
* `--working-directory` or `-wd`: 执行目录. 用于 `csharp``js` 客户端类型.
* `--url` or `-u`: API定义的URL. 用于 `csharp``js` 客户端类型.
> 参阅 [Angular服务代理文档](UI/Angular/Service-Proxies.md) 了解更多.

Loading…
Cancel
Save