{
diff --git a/src/main/java/io/github/onecx/parameters/domain/di/models/ApplicationParameterDataImport.java b/src/main/java/io/github/onecx/parameters/domain/di/models/ApplicationParameterDataImport.java
deleted file mode 100644
index 4303788..0000000
--- a/src/main/java/io/github/onecx/parameters/domain/di/models/ApplicationParameterDataImport.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package io.github.onecx.parameters.domain.di.models;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class ApplicationParameterDataImport {
-
- private String description;
-
- private String name;
-
- private String value;
-}
diff --git a/src/main/java/io/github/onecx/parameters/domain/di/ApplicationParameterDataImportService.java b/src/main/java/io/github/onecx/parameters/domain/di/v1/ParameterDataImportService.java
similarity index 75%
rename from src/main/java/io/github/onecx/parameters/domain/di/ApplicationParameterDataImportService.java
rename to src/main/java/io/github/onecx/parameters/domain/di/v1/ParameterDataImportService.java
index 6d88d9a..168800b 100644
--- a/src/main/java/io/github/onecx/parameters/domain/di/ApplicationParameterDataImportService.java
+++ b/src/main/java/io/github/onecx/parameters/domain/di/v1/ParameterDataImportService.java
@@ -1,4 +1,4 @@
-package io.github.onecx.parameters.domain.di;
+package io.github.onecx.parameters.domain.di.v1;
import java.util.ArrayList;
import java.util.HashMap;
@@ -15,37 +15,43 @@
import org.tkit.quarkus.dataimport.DataImportConfig;
import org.tkit.quarkus.dataimport.DataImportService;
-import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import gen.io.github.onecx.parameters.di.v1.model.DataImportDTOV1;
+import gen.io.github.onecx.parameters.di.v1.model.DataImportParamDTOV1;
import io.github.onecx.parameters.domain.daos.ApplicationParameterDAO;
-import io.github.onecx.parameters.domain.di.models.ApplicationParameterDataImport;
import io.github.onecx.parameters.domain.models.ApplicationParameter;
/**
- * Import format
+ * Import JSON format. Openapi: ./src/main/openapi/di-v1.yaml
+ *
+ *
* {
- * "appId" : {
- * "key1": {
- * "description": "description_1",
- * "name": "name_1",
- * "value": "value_1"
- * },
- * "key2": {
- * "description": "description_2",
- * "name": "name_2",
- * "value": "value_2"
- * }
- * }
+ * "appId" : {
+ * "key1": {
+ * "description": "description_1",
+ * "name": "name_1",
+ * "value": "value_1"
+ * },
+ * "key2": {
+ * "description": "description_2",
+ * "name": "name_2",
+ * "value": "value_2"
+ * }
+ * }
* }
+ *
+ *
+ *
* operation:
* - CLEAN_INSERT - delete all data and import new set
* - UPDATE - update existing data from file or create new parameters
+ *
*/
@DataImport("parameters")
-public class ApplicationParameterDataImportService implements DataImportService {
+public class ParameterDataImportService implements DataImportService {
- private static final Logger log = LoggerFactory.getLogger(ApplicationParameterDataImportService.class);
+ private static final Logger log = LoggerFactory.getLogger(ParameterDataImportService.class);
public static final String KEY_SEPARATOR = "__";
@@ -62,7 +68,7 @@ public void importData(DataImportConfig config) {
try {
String operation = config.getMetadata().getOrDefault("operation", "NONE");
- Consumer