|
|
|
@ -57,9 +57,19 @@ namespace Volo.Abp.Cli.Commands
|
|
|
|
|
var uiFramework = GetUiFramework(commandLineArgs);
|
|
|
|
|
|
|
|
|
|
WebClient client = new WebClient();
|
|
|
|
|
string json = client.DownloadString(apiUrl);
|
|
|
|
|
//var sr = File.OpenText("api-definition.json");
|
|
|
|
|
//var json = sr.ReadToEnd();
|
|
|
|
|
string json = "";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
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("Api Url: " + apiUrl);
|
|
|
|
@ -107,7 +117,7 @@ namespace Volo.Abp.Cli.Commands
|
|
|
|
|
serviceFileText.AppendLine("");
|
|
|
|
|
serviceFileText.AppendLine("@Injectable({providedIn: 'root'})");
|
|
|
|
|
serviceFileText.AppendLine("export class [controllerName]Service {");
|
|
|
|
|
serviceFileText.AppendLine(" apiName = '"+ apiName + "';");
|
|
|
|
|
serviceFileText.AppendLine(" apiName = '" + apiName + "';");
|
|
|
|
|
serviceFileText.AppendLine("");
|
|
|
|
|
serviceFileText.AppendLine(" constructor(private restService: RestService) {}");
|
|
|
|
|
serviceFileText.AppendLine("");
|
|
|
|
@ -201,7 +211,8 @@ namespace Volo.Abp.Cli.Commands
|
|
|
|
|
{
|
|
|
|
|
secondTypeList.Add(type);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
firstTypeList.Add(type);
|
|
|
|
|
}
|
|
|
|
|
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}";
|
|
|
|
|
|
|
|
|
|