[STYLE] error commit
This commit is contained in:
parent
dc6eeac008
commit
9c9da21bdb
@ -44,7 +44,7 @@ public class TsGenerateApi {
|
||||
}
|
||||
// Generate index of model files
|
||||
createModelIndex(pathPackage, tsGroup);
|
||||
|
||||
|
||||
for (final ApiGroupModel element : api.apiModels) {
|
||||
TsApiGeneration.generateApiFile(element, pathPackage, tsGroup);
|
||||
}
|
||||
@ -53,7 +53,7 @@ public class TsGenerateApi {
|
||||
createIndex(pathPackage);
|
||||
copyResourceFile("rest-tools.ts", pathPackage + File.separator + "rest-tools.ts");
|
||||
}
|
||||
|
||||
|
||||
private static void createIndex(final String pathPackage) throws IOException {
|
||||
final String out = """
|
||||
/**
|
||||
@ -62,13 +62,13 @@ public class TsGenerateApi {
|
||||
export * from \"./model\";
|
||||
export * from \"./api\";
|
||||
export * from \"./rest-tools\";
|
||||
|
||||
|
||||
""";
|
||||
final FileWriter myWriter = new FileWriter(pathPackage + File.separator + "index.ts");
|
||||
myWriter.write(out);
|
||||
myWriter.close();
|
||||
}
|
||||
|
||||
|
||||
private static void createResourceIndex(final String pathPackage, final List<ApiGroupModel> apiModels)
|
||||
throws IOException {
|
||||
final StringBuilder out = new StringBuilder("""
|
||||
@ -90,7 +90,7 @@ public class TsGenerateApi {
|
||||
myWriter.write(out.toString());
|
||||
myWriter.close();
|
||||
}
|
||||
|
||||
|
||||
private static void createModelIndex(final String pathPackage, final TsClassElementGroup tsGroup)
|
||||
throws IOException {
|
||||
final StringBuilder out = new StringBuilder("""
|
||||
@ -116,7 +116,7 @@ public class TsGenerateApi {
|
||||
myWriter.write(out.toString());
|
||||
myWriter.close();
|
||||
}
|
||||
|
||||
|
||||
private static List<TsClassElement> generateApiModel(final AnalyzeApi api) throws Exception {
|
||||
// First step is to add all specific basic elements the wrap correctly the model
|
||||
final List<TsClassElement> tsModels = new ArrayList<>();
|
||||
@ -221,9 +221,9 @@ public class TsGenerateApi {
|
||||
tsModels.add(new TsClassElement(model));
|
||||
}
|
||||
return tsModels;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void copyResourceFile(final String name, final String destinationPath) throws IOException {
|
||||
final InputStream ioStream = TsGenerateApi.class.getClassLoader().getResourceAsStream(name);
|
||||
if (ioStream == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user