abp cli generate proxy host connection error added.

pull/3355/head
Arkat Erol 5 years ago
parent 385b66f360
commit fd77de1afe

@ -57,9 +57,19 @@ namespace Volo.Abp.Cli.Commands
var uiFramework = GetUiFramework(commandLineArgs); var uiFramework = GetUiFramework(commandLineArgs);
WebClient client = new WebClient(); WebClient client = new WebClient();
string json = client.DownloadString(apiUrl); string json = "";
//var sr = File.OpenText("api-definition.json"); try
//var json = sr.ReadToEnd(); {
json = client.DownloadString(apiUrl);
}
catch (Exception ex)
{
throw new CliUsageException(
"Cannot connect to the host {" + apiUrl + "}! Check that the host is up and running." +
Environment.NewLine + Environment.NewLine +
GetUsageInfo()
);
}
Logger.LogInformation("Downloading api definition..."); Logger.LogInformation("Downloading api definition...");
Logger.LogInformation("Api Url: " + apiUrl); Logger.LogInformation("Api Url: " + apiUrl);
@ -107,7 +117,7 @@ namespace Volo.Abp.Cli.Commands
serviceFileText.AppendLine(""); serviceFileText.AppendLine("");
serviceFileText.AppendLine("@Injectable({providedIn: 'root'})"); serviceFileText.AppendLine("@Injectable({providedIn: 'root'})");
serviceFileText.AppendLine("export class [controllerName]Service {"); serviceFileText.AppendLine("export class [controllerName]Service {");
serviceFileText.AppendLine(" apiName = '"+ apiName + "';"); serviceFileText.AppendLine(" apiName = '" + apiName + "';");
serviceFileText.AppendLine(""); serviceFileText.AppendLine("");
serviceFileText.AppendLine(" constructor(private restService: RestService) {}"); serviceFileText.AppendLine(" constructor(private restService: RestService) {}");
serviceFileText.AppendLine(""); serviceFileText.AppendLine("");
@ -201,7 +211,8 @@ namespace Volo.Abp.Cli.Commands
{ {
secondTypeList.Add(type); secondTypeList.Add(type);
} }
else { else
{
firstTypeList.Add(type); firstTypeList.Add(type);
} }
break; break;
@ -435,7 +446,7 @@ namespace Volo.Abp.Cli.Commands
} }
var typeModelName = typeName.Replace("<", "").Replace(">", "").Replace("?","").PascalToKebabCase() + ".ts"; var typeModelName = typeName.Replace("<", "").Replace(">", "").Replace("?", "").PascalToKebabCase() + ".ts";
var path = $"src/app/{rootPath}/shared/models/{typeModelName}"; var path = $"src/app/{rootPath}/shared/models/{typeModelName}";

Loading…
Cancel
Save