Browse Source

Add api-name parameter to the generate-proxy command.

pull/5294/head
Halil İbrahim Kalkan 6 years ago
parent
commit
b37f7fab93
  1. 2
      docs/en/CLI.md
  2. 13
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs

2
docs/en/CLI.md

@ -191,6 +191,7 @@ abp generate-proxy
#### Options
* `--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).
@ -212,6 +213,7 @@ abp remove-proxy
#### 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).

13
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs

@ -24,6 +24,7 @@ namespace Volo.Abp.Cli.Commands
var defaultValue = prompt ? null : "__default";
var module = commandLineArgs.Options.GetOrNull(Options.Module.Short, Options.Module.Long) ?? defaultValue;
var apiName = commandLineArgs.Options.GetOrNull(Options.ApiName.Short, Options.ApiName.Long) ?? defaultValue;
var source = commandLineArgs.Options.GetOrNull(Options.Source.Short, Options.Source.Long) ?? defaultValue;
var target = commandLineArgs.Options.GetOrNull(Options.Target.Short, Options.Target.Long) ?? defaultValue;
@ -34,6 +35,11 @@ namespace Volo.Abp.Cli.Commands
commandBuilder.Append($" --module {module}");
}
if (apiName != null)
{
commandBuilder.Append($" --api-name {apiName}");
}
if (source != null)
{
commandBuilder.Append($" --source {source}");
@ -100,6 +106,7 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine("Options:");
sb.AppendLine("");
sb.AppendLine("-m|--module <module-name> (default: 'app') The name of the backend module you wish to generate proxies for.");
sb.AppendLine("-a|--api-name <module-name> (default: 'default') The name of the API endpoint defined in the /src/environments/environment.ts.");
sb.AppendLine("-s|--source <source-name> (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from.");
sb.AppendLine("-t|--target <target-name> (default: 'defaultProject') Angular project name to place generated code in.");
sb.AppendLine("-p|--prompt Asks the options from the command line prompt (for the missing options)");
@ -122,6 +129,12 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "module";
}
public static class ApiName
{
public const string Short = "a";
public const string Long = "api-name";
}
public static class Source
{
public const string Short = "s";

Loading…
Cancel
Save