diff --git a/builder/core/pom.xml b/builder/core/pom.xml index 6171fabf..cf580383 100644 --- a/builder/core/pom.xml +++ b/builder/core/pom.xml @@ -23,6 +23,14 @@ builder-core + + com.antgroup.openspg.reasoner + reasoner-local-runner + + + com.antgroup.openspg.reasoner + reasoner-cloudext-warehouse + com.antgroup.openspg.server api-http-client @@ -35,10 +43,6 @@ com.antgroup.openspg.cloudext cloudext-impl-graph-store-tugraph - - com.antgroup.openspg.cloudext - cloudext-interface-table-store - com.antgroup.openspg.cloudext cloudext-interface-search-engine @@ -47,13 +51,6 @@ com.antgroup.openspg.cloudext cloudext-impl-search-engine-elasticsearch - - com.antgroup.kg.reasoner - local - ${kgreasoner-version} - system - ${project.basedir}/../../server/lib/spgreasoner-local-0.0.1.jar - com.antgroup.openspg.server core-schema-model diff --git a/builder/core/src/main/java/com/antgroup/openspg/builder/core/reason/ReasonProcessor.java b/builder/core/src/main/java/com/antgroup/openspg/builder/core/reason/ReasonProcessor.java index 9b51f126..0c41dd15 100644 --- a/builder/core/src/main/java/com/antgroup/openspg/builder/core/reason/ReasonProcessor.java +++ b/builder/core/src/main/java/com/antgroup/openspg/builder/core/reason/ReasonProcessor.java @@ -1,10 +1,5 @@ package com.antgroup.openspg.builder.core.reason; -import com.antgroup.kg.reasoner.catalog.impl.OpenKgCatalog; -import com.antgroup.kg.reasoner.common.graph.vertex.IVertexId; -import com.antgroup.kg.reasoner.graphstate.GraphState; -import com.antgroup.kg.reasoner.graphstate.impl.CloudExtGraphState; -import com.antgroup.kg.reasoner.lube.catalog.Catalog; import com.antgroup.openspg.builder.core.physical.process.BaseProcessor; import com.antgroup.openspg.builder.core.reason.impl.CausalConceptReasoner; import com.antgroup.openspg.builder.core.reason.impl.InductiveConceptReasoner; @@ -16,6 +11,11 @@ import com.antgroup.openspg.builder.model.record.BaseSPGRecord; import com.antgroup.openspg.core.schema.model.semantic.DynamicTaxonomySemantic; import com.antgroup.openspg.core.schema.model.semantic.LogicalCausationSemantic; import com.antgroup.openspg.core.schema.model.type.ConceptList; +import com.antgroup.openspg.reasoner.catalog.impl.OpenSPGCatalog; +import com.antgroup.openspg.reasoner.common.graph.vertex.IVertexId; +import com.antgroup.openspg.reasoner.graphstate.GraphState; +import com.antgroup.openspg.reasoner.lube.catalog.Catalog; +import com.antgroup.openspg.reasoner.warehouse.cloudext.CloudExtGraphState; import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; import com.google.common.collect.Lists; import java.util.*; @@ -85,8 +85,8 @@ public class ReasonProcessor extends BaseProcessor - - - 4.0.0 - - com.antgroup.openspg.cloudext - cloudext-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - cloudext-impl-object-store-local - - - - com.antgroup.openspg.cloudext - cloudext-interface-object-store - - - commons-io - commons-io - - - diff --git a/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClient.java b/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClient.java deleted file mode 100644 index ab665712..00000000 --- a/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClient.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.objectstore.local; - -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClient; -import com.antgroup.openspg.cloudext.interfaces.objectstore.cmd.ObjectStoreSaveCmd; -import com.antgroup.openspg.cloudext.interfaces.objectstore.model.ObjectStorePath; -import com.antgroup.openspg.server.common.model.datasource.connection.ObjectStoreConnectionInfo; -import java.io.File; -import java.io.IOException; -import lombok.Getter; -import org.apache.commons.io.FileUtils; - -public class LocalObjectStoreClient implements ObjectStoreClient { - - @Getter private final ObjectStoreConnectionInfo connInfo; - private final String localRootDir; - - public LocalObjectStoreClient(ObjectStoreConnectionInfo connInfo) { - this.connInfo = connInfo; - this.localRootDir = (String) connInfo.getNotNullParam("localDir"); - } - - @Override - public ObjectStorePath save(ObjectStoreSaveCmd cmd) { - ObjectStorePath path = cmd.getPath(); - File file = new File("./" + localRootDir + "/" + path.getRelativePath()); - try { - FileUtils.copyInputStreamToFile(cmd.getInputStream(), file); - } catch (IOException e) { - throw new RuntimeException(e); - } - - path.setAbsolutePath(file.getAbsolutePath()); - return path; - } -} diff --git a/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClientDriver.java b/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClientDriver.java deleted file mode 100644 index 89c6f46f..00000000 --- a/cloudext/impl/object-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/objectstore/local/LocalObjectStoreClientDriver.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.objectstore.local; - -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClient; -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriver; -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriverManager; -import com.antgroup.openspg.server.common.model.datasource.connection.ObjectStoreConnectionInfo; - -public class LocalObjectStoreClientDriver implements ObjectStoreClientDriver { - - static { - ObjectStoreClientDriverManager.registerDriver(new LocalObjectStoreClientDriver()); - } - - @Override - public String driverScheme() { - return "local"; - } - - @Override - public ObjectStoreClient connect(ObjectStoreConnectionInfo connInfo) { - return new LocalObjectStoreClient(connInfo); - } -} diff --git a/cloudext/impl/search-engine/elasticsearch/src/main/java/com/antgroup/openspg/cloudext/impl/searchengine/elasticsearch/util/ElasticSearchRecordUtils.java b/cloudext/impl/search-engine/elasticsearch/src/main/java/com/antgroup/openspg/cloudext/impl/searchengine/elasticsearch/util/ElasticSearchRecordUtils.java index e7fb2c72..868bbd7e 100644 --- a/cloudext/impl/search-engine/elasticsearch/src/main/java/com/antgroup/openspg/cloudext/impl/searchengine/elasticsearch/util/ElasticSearchRecordUtils.java +++ b/cloudext/impl/search-engine/elasticsearch/src/main/java/com/antgroup/openspg/cloudext/impl/searchengine/elasticsearch/util/ElasticSearchRecordUtils.java @@ -32,7 +32,7 @@ import com.antgroup.openspg.cloudext.interfaces.searchengine.model.request.query import com.antgroup.openspg.cloudext.interfaces.searchengine.model.request.query.QueryGroup; import com.antgroup.openspg.cloudext.interfaces.searchengine.model.request.query.TermQuery; import com.antgroup.openspg.common.util.StringUtils; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.dtflys.forest.http.ForestResponse; import com.google.gson.reflect.TypeToken; import java.util.ArrayList; @@ -93,7 +93,8 @@ public class ElasticSearchRecordUtils { throw new RuntimeException("mGetIdxRecords error, errorMsg=" + response.getContent()); } - EsDocs esDocs = JSON.deserialize(response.getContent(), new TypeToken() {}.getType()); + EsDocs esDocs = + SchemaJsonUtils.deserialize(response.getContent(), new TypeToken() {}.getType()); return esDocs.toIdxRecord(); } @@ -119,7 +120,7 @@ public class ElasticSearchRecordUtils { if (StringUtils.isBlank(hits)) { return Collections.emptyList(); } - EsHits esHits = JSON.deserialize(hits, new TypeToken() {}.getType()); + EsHits esHits = SchemaJsonUtils.deserialize(hits, new TypeToken() {}.getType()); return esHits.toIdxRecord(); } diff --git a/cloudext/impl/table-store/local/pom.xml b/cloudext/impl/table-store/local/pom.xml deleted file mode 100644 index 88b3a7dd..00000000 --- a/cloudext/impl/table-store/local/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.cloudext - cloudext-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - cloudext-impl-table-store-local - - - - com.antgroup.openspg.cloudext - cloudext-interface-table-store - - - com.opencsv - opencsv - - - diff --git a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableFileHandler.java b/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableFileHandler.java deleted file mode 100644 index cf47173f..00000000 --- a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableFileHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.tablestore.local; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableFileHandler; -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.TableRecord; -import com.opencsv.CSVWriter; -import java.util.Arrays; -import java.util.List; -import java.util.Queue; -import java.util.concurrent.ArrayBlockingQueue; - -public class LocalTableFileHandler implements TableFileHandler { - - private final CSVWriter csvWriter; - private final String tableName; - private static final int DEFAULT_BUFFER_SIZE = 1000; - private final Queue buffer; - - public LocalTableFileHandler(CSVWriter csvWriter, String tableName) { - this.csvWriter = csvWriter; - this.tableName = tableName; - buffer = new ArrayBlockingQueue<>(DEFAULT_BUFFER_SIZE); - } - - @Override - public String getTableName() { - return tableName; - } - - @Override - public int write(TableRecord record) { - if (record.getValues() != null && record.getValues().length > 0) { - buffer.add(Arrays.stream(record.getValues()).map(Object::toString).toArray(String[]::new)); - if (buffer.size() == DEFAULT_BUFFER_SIZE) { - flushBuffer(); - } - return 1; - } - return 0; - } - - @Override - public int batchWrite(List records) { - for (TableRecord record : records) { - write(record); - } - return records.size(); - } - - private synchronized void flushBuffer() { - while (!buffer.isEmpty()) { - csvWriter.writeNext(buffer.poll()); - } - } - - @Override - public void close() throws Exception { - if (csvWriter != null) { - flushBuffer(); - csvWriter.close(); - } - } -} diff --git a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClient.java b/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClient.java deleted file mode 100644 index 58130292..00000000 --- a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClient.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.tablestore.local; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableFileHandler; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClient; -import com.antgroup.openspg.cloudext.interfaces.tablestore.cmd.TableFileCreateCmd; -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.ColumnMeta; -import com.antgroup.openspg.common.util.tuple.Tuple2; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; -import com.opencsv.CSVWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Arrays; -import lombok.Getter; - -public class LocalTableStoreClient implements TableStoreClient { - - @Getter private final TableStoreConnectionInfo connInfo; - private final String localRootDir; - - public LocalTableStoreClient(TableStoreConnectionInfo connInfo) { - this.connInfo = connInfo; - this.localRootDir = (String) connInfo.getNotNullParam("localDir"); - new File("./" + localRootDir).mkdirs(); - } - - @Override - public TableFileHandler create(TableFileCreateCmd cmd) { - try { - Tuple2 tuple2 = buildCsvWriter(cmd); - return new LocalTableFileHandler(tuple2.first, tuple2.second); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - private Tuple2 buildCsvWriter(TableFileCreateCmd cmd) throws IOException { - String filePath = "./" + localRootDir + "/" + cmd.getName() + ".csv"; - CSVWriter csvWriter = new CSVWriter(new FileWriter(filePath)); - - String[] columns = - Arrays.stream(cmd.getColumns()).map(ColumnMeta::getName).toArray(String[]::new); - csvWriter.writeNext(columns); - return Tuple2.of(csvWriter, filePath); - } -} diff --git a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClientDriver.java b/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClientDriver.java deleted file mode 100644 index 81a9b65d..00000000 --- a/cloudext/impl/table-store/local/src/main/java/com/antgroup/openspg/cloudext/impl/tablestore/local/LocalTableStoreClientDriver.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.tablestore.local; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClient; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriver; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriverManager; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; - -public class LocalTableStoreClientDriver implements TableStoreClientDriver { - - static { - TableStoreClientDriverManager.registerDriver(new LocalTableStoreClientDriver()); - } - - @Override - public String driverScheme() { - return "local"; - } - - @Override - public TableStoreClient connect(TableStoreConnectionInfo connInfo) { - return new LocalTableStoreClient(connInfo); - } -} diff --git a/cloudext/interface/graph-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/graphstore/model/lpg/record/VertexRecord.java b/cloudext/interface/graph-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/graphstore/model/lpg/record/VertexRecord.java index 07bf3ef6..937384cb 100644 --- a/cloudext/interface/graph-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/graphstore/model/lpg/record/VertexRecord.java +++ b/cloudext/interface/graph-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/graphstore/model/lpg/record/VertexRecord.java @@ -14,8 +14,11 @@ package com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.record; import com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.schema.VertexType; +import com.antgroup.openspg.server.api.facade.ApiConstants; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -44,4 +47,17 @@ public class VertexRecord extends BaseLPGRecord { otherProperties.put(VertexType.ID, id); return otherProperties; } + + public Map> toPropertyMapWithIdAndVersion() { + Map otherProperties = toPropertyMapWithId(); + + Map> results = new HashMap<>(otherProperties.size()); + otherProperties.forEach( + (key, value) -> { + TreeMap propertyVersion = new TreeMap<>(); + propertyVersion.put(ApiConstants.DEFAULT_VERSION, value); + results.put(key, propertyVersion); + }); + return results; + } } diff --git a/cloudext/interface/object-store/pom.xml b/cloudext/interface/object-store/pom.xml deleted file mode 100644 index d9525030..00000000 --- a/cloudext/interface/object-store/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.cloudext - cloudext-parent - 0.0.1-SNAPSHOT - ../../pom.xml - - - cloudext-interface-object-store - - - - com.antgroup.openspg - common-util - - - diff --git a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClient.java b/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClient.java deleted file mode 100644 index 6f62b882..00000000 --- a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClient.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.objectstore; - -import com.antgroup.openspg.cloudext.interfaces.objectstore.cmd.ObjectStoreSaveCmd; -import com.antgroup.openspg.cloudext.interfaces.objectstore.model.ObjectStorePath; -import com.antgroup.openspg.common.util.cloudext.CloudExtClient; - -public interface ObjectStoreClient extends CloudExtClient { - - ObjectStorePath save(ObjectStoreSaveCmd cmd); -} diff --git a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriver.java b/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriver.java deleted file mode 100644 index d83db16b..00000000 --- a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriver.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.objectstore; - -import com.antgroup.openspg.common.util.cloudext.CloudExtClientDriver; -import com.antgroup.openspg.server.common.model.datasource.connection.ObjectStoreConnectionInfo; - -public interface ObjectStoreClientDriver - extends CloudExtClientDriver {} diff --git a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriverManager.java b/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriverManager.java deleted file mode 100644 index 1c996652..00000000 --- a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/ObjectStoreClientDriverManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.objectstore; - -import com.antgroup.openspg.common.util.DriverManagerUtils; -import com.antgroup.openspg.server.common.model.datasource.connection.ObjectStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.exception.CloudExtException; -import java.util.concurrent.CopyOnWriteArrayList; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class ObjectStoreClientDriverManager { - - private static final CopyOnWriteArrayList registeredDrivers = - new CopyOnWriteArrayList<>(); - - private ObjectStoreClientDriverManager() {} - - static { - DriverManagerUtils.loadDrivers("cloudext.objectstore.drivers", ObjectStoreClientDriver.class); - log.info("object-store DriverManager initialized"); - } - - public static synchronized void registerDriver(ObjectStoreClientDriver driver) { - if (driver != null) { - registeredDrivers.addIfAbsent(driver); - } else { - throw new NullPointerException(); - } - log.info("registerDriver: {}", driver); - } - - public static ObjectStoreClient getClient(ObjectStoreConnectionInfo config) { - for (ObjectStoreClientDriver driver : registeredDrivers) { - if (driver.acceptsConfig(config)) { - return driver.connect(config); - } - } - throw CloudExtException.driverNotExist(config); - } -} diff --git a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/cmd/ObjectStoreSaveCmd.java b/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/cmd/ObjectStoreSaveCmd.java deleted file mode 100644 index b41dd3d4..00000000 --- a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/cmd/ObjectStoreSaveCmd.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.objectstore.cmd; - -import com.antgroup.openspg.cloudext.interfaces.objectstore.model.ObjectStorePath; -import com.antgroup.openspg.server.common.model.base.BaseCmd; -import java.io.InputStream; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class ObjectStoreSaveCmd extends BaseCmd { - - private final ObjectStorePath path; - - private final InputStream inputStream; -} diff --git a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/model/ObjectStorePath.java b/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/model/ObjectStorePath.java deleted file mode 100644 index e2e599f4..00000000 --- a/cloudext/interface/object-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/objectstore/model/ObjectStorePath.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.objectstore.model; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import lombok.Getter; -import lombok.Setter; - -@Getter -public class ObjectStorePath extends BaseValObj { - - private final String relativePath; - - @Setter private String absolutePath; - - public ObjectStorePath(String relativePath) { - this.relativePath = relativePath; - } -} diff --git a/cloudext/interface/object-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriver b/cloudext/interface/object-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriver deleted file mode 100644 index 01c378fa..00000000 --- a/cloudext/interface/object-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriver +++ /dev/null @@ -1 +0,0 @@ -com.antgroup.openspg.cloudext.impl.objectstore.local.LocalObjectStoreClientDriver diff --git a/cloudext/interface/table-store/pom.xml b/cloudext/interface/table-store/pom.xml deleted file mode 100644 index 7246377e..00000000 --- a/cloudext/interface/table-store/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.cloudext - cloudext-parent - 0.0.1-SNAPSHOT - ../../pom.xml - - - cloudext-interface-table-store - - - - com.antgroup.openspg - common-util - - - diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableFileHandler.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableFileHandler.java deleted file mode 100644 index 2b8f9fe2..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableFileHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.TableRecord; -import java.util.List; - -public interface TableFileHandler { - - String getTableName(); - - int write(TableRecord record); - - int batchWrite(List records); - - void close() throws Exception; -} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClient.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClient.java deleted file mode 100644 index 5bd796f7..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClient.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.cmd.TableFileCreateCmd; -import com.antgroup.openspg.common.util.cloudext.CloudExtClient; - -public interface TableStoreClient extends CloudExtClient { - - TableFileHandler create(TableFileCreateCmd cmd); -} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriver.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriver.java deleted file mode 100644 index 1dfaad73..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriver.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore; - -import com.antgroup.openspg.common.util.cloudext.CloudExtClientDriver; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; - -public interface TableStoreClientDriver - extends CloudExtClientDriver {} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriverManager.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriverManager.java deleted file mode 100644 index 9d61ff82..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/TableStoreClientDriverManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore; - -import com.antgroup.openspg.common.util.DriverManagerUtils; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.exception.CloudExtException; -import java.util.concurrent.CopyOnWriteArrayList; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class TableStoreClientDriverManager { - - private static final CopyOnWriteArrayList registeredDrivers = - new CopyOnWriteArrayList<>(); - - private TableStoreClientDriverManager() {} - - static { - DriverManagerUtils.loadDrivers("cloudext.tablestore.drivers", TableStoreClientDriver.class); - log.info("table-store DriverManager initialized"); - } - - public static synchronized void registerDriver(TableStoreClientDriver driver) { - if (driver != null) { - registeredDrivers.addIfAbsent(driver); - } else { - throw new NullPointerException(); - } - log.info("registerDriver: {}", driver); - } - - public static TableStoreClient getClient(TableStoreConnectionInfo config) { - for (TableStoreClientDriver driver : registeredDrivers) { - if (driver.acceptsConfig(config)) { - return driver.connect(config); - } - } - throw CloudExtException.driverNotExist(config); - } -} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/cmd/TableFileCreateCmd.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/cmd/TableFileCreateCmd.java deleted file mode 100644 index 6eb13440..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/cmd/TableFileCreateCmd.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore.cmd; - -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.ColumnMeta; -import com.antgroup.openspg.server.common.model.base.BaseCmd; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class TableFileCreateCmd extends BaseCmd { - - private final String name; - - private final ColumnMeta[] columns; -} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/ColumnMeta.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/ColumnMeta.java deleted file mode 100644 index bd3e8a2f..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/ColumnMeta.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore.model; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class ColumnMeta extends BaseValObj { - - private final String name; -} diff --git a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/TableRecord.java b/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/TableRecord.java deleted file mode 100644 index fcea7058..00000000 --- a/cloudext/interface/table-store/src/main/java/com/antgroup/openspg/cloudext/interfaces/tablestore/model/TableRecord.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.tablestore.model; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class TableRecord extends BaseValObj { - - private final Object[] values; -} diff --git a/cloudext/interface/table-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriver b/cloudext/interface/table-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriver deleted file mode 100644 index 8c9e3f74..00000000 --- a/cloudext/interface/table-store/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriver +++ /dev/null @@ -1 +0,0 @@ -com.antgroup.openspg.cloudext.impl.tablestore.local.LocalTableStoreClientDriver diff --git a/cloudext/pom.xml b/cloudext/pom.xml index 9923c6a0..3a915e2e 100644 --- a/cloudext/pom.xml +++ b/cloudext/pom.xml @@ -36,12 +36,8 @@ interface/graph-store - interface/object-store - interface/table-store interface/search-engine impl/graph-store/tugraph - impl/object-store/local - impl/table-store/local impl/search-engine/elasticsearch diff --git a/common/util/src/main/java/com/antgroup/openspg/common/util/JsonUtils.java b/common/util/src/main/java/com/antgroup/openspg/common/util/JsonUtils.java index 19dbb4d1..7bdd8624 100644 --- a/common/util/src/main/java/com/antgroup/openspg/common/util/JsonUtils.java +++ b/common/util/src/main/java/com/antgroup/openspg/common/util/JsonUtils.java @@ -13,7 +13,7 @@ package com.antgroup.openspg.common.util; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import lombok.extern.slf4j.Slf4j; @Slf4j @@ -22,7 +22,7 @@ public class JsonUtils { public static String toJsonString(Object object) { String result = null; try { - result = JSON.serialize(object); + result = SchemaJsonUtils.serialize(object); } catch (Exception e) { log.error("toJsonString error, object={}", object, e); result = StringUtils.toString(object); diff --git a/pom.xml b/pom.xml index 3d0a2636..593d4ecf 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,16 @@ testdata ${project.version} + + com.antgroup.openspg.reasoner + reasoner-local-runner + ${project.version} + + + com.antgroup.openspg.reasoner + reasoner-cloudext-warehouse + ${project.version} + com.antgroup.openspg.server common-model @@ -109,31 +119,11 @@ cloudext-interface-search-engine ${project.version} - - com.antgroup.openspg.cloudext - cloudext-interface-object-store - ${project.version} - - - com.antgroup.openspg.cloudext - cloudext-interface-table-store - ${project.version} - com.antgroup.openspg.cloudext cloudext-impl-graph-store-tugraph ${project.version} - - com.antgroup.openspg.cloudext - cloudext-impl-object-store-local - ${project.version} - - - com.antgroup.openspg.cloudext - cloudext-impl-table-store-local - ${project.version} - com.antgroup.openspg.cloudext cloudext-impl-search-engine-elasticsearch diff --git a/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/IVertexId.java b/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/IVertexId.java index 6a599d77..51372224 100644 --- a/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/IVertexId.java +++ b/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/IVertexId.java @@ -35,6 +35,9 @@ public interface IVertexId extends Serializable, Comparable { /** get kgstate internal id */ long getInternalId(); + /** get biz id */ + String getBizId(); + /** get vertex type id */ long getTypeId(); diff --git a/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/impl/VertexId.java b/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/impl/VertexId.java index 0363631a..b8e0fe85 100644 --- a/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/impl/VertexId.java +++ b/reasoner/common/src/main/java/com/antgroup/openspg/reasoner/common/graph/vertex/impl/VertexId.java @@ -24,6 +24,7 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Base64; import java.util.Comparator; +import lombok.Getter; public class VertexId implements IVertexId { /** @@ -33,6 +34,8 @@ public class VertexId implements IVertexId { */ private final byte[] vertexIdBytes; + @Getter private String bizId; + /** create vertex id */ public VertexId(long internalId, String type) { this.vertexIdBytes = generateIdBytes(internalId, type); @@ -40,6 +43,7 @@ public class VertexId implements IVertexId { public VertexId(String bizId, String type) { this.vertexIdBytes = generateIdBytes(generateInternalId(bizId, type), type); + this.bizId = bizId; } public VertexId(byte[] bytes) { diff --git a/reasoner/pom.xml b/reasoner/pom.xml index c8023d53..49bc8177 100644 --- a/reasoner/pom.xml +++ b/reasoner/pom.xml @@ -31,10 +31,11 @@ lube-logical lube-physical warehouse/warehouse-common + warehouse/cloudext-warehouse kgdsl-parser runner/runner-common - catalog/openspg-catalog runner/local-runner + catalog/openspg-catalog @@ -89,11 +90,6 @@ reasoner-kgdsl-parser ${project.version} - - com.antgroup.openspg.reasoner - reasoner-warehouse-common - ${project.version} - com.antgroup.openspg.reasoner reasoner-runner-common @@ -109,6 +105,11 @@ reasoner-warehouse-common ${project.version} + + com.antgroup.openspg.reasoner + reasoner-cloudext-warehouse + ${project.version} + com.antgroup.openspg.reasoner reasoner-local-runner diff --git a/reasoner/runner/runner-common/src/main/java/com/antgroup/openspg/reasoner/graphstate/impl/MemGraphState.java b/reasoner/runner/runner-common/src/main/java/com/antgroup/openspg/reasoner/graphstate/impl/MemGraphState.java index b7f1dbab..8aa7396b 100644 --- a/reasoner/runner/runner-common/src/main/java/com/antgroup/openspg/reasoner/graphstate/impl/MemGraphState.java +++ b/reasoner/runner/runner-common/src/main/java/com/antgroup/openspg/reasoner/graphstate/impl/MemGraphState.java @@ -49,7 +49,7 @@ public class MemGraphState implements GraphState { * vertex map key is s, value is vertex property vertex property is Map> */ - Map vertexMap = new HashMap<>(); + protected Map vertexMap = new HashMap<>(); /** in edges map key is s, value is p_o_t */ Map>> inEdgeMap = new HashMap<>(); diff --git a/reasoner/warehouse/cloudext-warehouse/pom.xml b/reasoner/warehouse/cloudext-warehouse/pom.xml new file mode 100644 index 00000000..fd1754ea --- /dev/null +++ b/reasoner/warehouse/cloudext-warehouse/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + com.antgroup.openspg.reasoner + reasoner-parent + 0.0.1-SNAPSHOT + ../../pom.xml + + + reasoner-cloudext-warehouse + + + + com.antgroup.openspg.reasoner + reasoner-runner-common + + + com.antgroup.openspg.reasoner + reasoner-common + + + com.antgroup.openspg.cloudext + cloudext-interface-graph-store + + + com.antgroup.openspg.cloudext + cloudext-impl-graph-store-tugraph + + + diff --git a/reasoner/warehouse/cloudext-warehouse/src/main/java/com/antgroup/openspg/reasoner/warehouse/cloudext/CloudExtGraphState.java b/reasoner/warehouse/cloudext-warehouse/src/main/java/com/antgroup/openspg/reasoner/warehouse/cloudext/CloudExtGraphState.java new file mode 100644 index 00000000..826aaa90 --- /dev/null +++ b/reasoner/warehouse/cloudext-warehouse/src/main/java/com/antgroup/openspg/reasoner/warehouse/cloudext/CloudExtGraphState.java @@ -0,0 +1,171 @@ +package com.antgroup.openspg.reasoner.warehouse.cloudext; + +import com.antgroup.openspg.cloudext.interfaces.graphstore.BaseLPGGraphStoreClient; +import com.antgroup.openspg.cloudext.interfaces.graphstore.GraphStoreClientDriverManager; +import com.antgroup.openspg.cloudext.interfaces.graphstore.cmd.OneHopLPGRecordQuery; +import com.antgroup.openspg.cloudext.interfaces.graphstore.cmd.ScanLPGRecordQuery; +import com.antgroup.openspg.cloudext.interfaces.graphstore.cmd.VertexLPGRecordQuery; +import com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.record.EdgeRecord; +import com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.record.VertexRecord; +import com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.record.struct.GraphLPGRecordStruct; +import com.antgroup.openspg.cloudext.interfaces.graphstore.model.lpg.schema.EdgeTypeName; +import com.antgroup.openspg.reasoner.common.graph.edge.Direction; +import com.antgroup.openspg.reasoner.common.graph.edge.IEdge; +import com.antgroup.openspg.reasoner.common.graph.edge.impl.Edge; +import com.antgroup.openspg.reasoner.common.graph.property.IProperty; +import com.antgroup.openspg.reasoner.common.graph.property.IVersionProperty; +import com.antgroup.openspg.reasoner.common.graph.property.impl.EdgeProperty; +import com.antgroup.openspg.reasoner.common.graph.property.impl.VertexVersionProperty; +import com.antgroup.openspg.reasoner.common.graph.vertex.IVertex; +import com.antgroup.openspg.reasoner.common.graph.vertex.IVertexId; +import com.antgroup.openspg.reasoner.common.graph.vertex.impl.Vertex; +import com.antgroup.openspg.reasoner.common.graph.vertex.impl.VertexId; +import com.antgroup.openspg.reasoner.graphstate.impl.MemGraphState; +import com.antgroup.openspg.reasoner.graphstate.model.MergeTypeEnum; +import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; +import java.util.*; +import java.util.stream.Collectors; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; + +@Slf4j +public class CloudExtGraphState extends MemGraphState { + + private BaseLPGGraphStoreClient lpgGraphStoreClient; + + @Override + public void init(Map param) { + super.init(param); + + GraphStoreConnectionInfo connInfo = new GraphStoreConnectionInfo(); + connInfo.setScheme(param.getOrDefault("cloudext.graphstore.schema", "tugraph")); + connInfo.setParams(Collections.unmodifiableMap(param)); + lpgGraphStoreClient = + (BaseLPGGraphStoreClient) GraphStoreClientDriverManager.getClient(connInfo); + } + + @Override + public IVertex getVertex(IVertexId id, Long version) { + IVersionProperty iProperty = (IVersionProperty) vertexMap.get(id); + if (iProperty != null) { + return super.getVertex(id, version); + } + + GraphLPGRecordStruct recordStruct = + (GraphLPGRecordStruct) + lpgGraphStoreClient.queryRecord(new VertexLPGRecordQuery(id.getBizId(), id.getType())); + + if (recordStruct.isEmpty()) { + return null; + } + + for (VertexRecord vertexRecord : recordStruct.getVertices()) { + VertexVersionProperty property = + new VertexVersionProperty(vertexRecord.toPropertyMapWithIdAndVersion()); + return new Vertex<>( + new VertexId(vertexRecord.getId(), vertexRecord.getVertexType()), property); + } + return null; + } + + @Override + public void mergeVertexProperty( + IVertexId id, Map property, MergeTypeEnum mergeType, Long version) { + IProperty iProperty = vertexMap.get(id); + if (iProperty == null) { + IVertex vertex = getVertex(id, version); + addVertex(vertex, version); + } + super.mergeVertexProperty(id, property, mergeType, version); + } + + @Override + public void mergeEdgeProperty( + IVertexId s, + String p, + IVertexId o, + Long version, + Direction direction, + Map property, + MergeTypeEnum mergeType) { + throw new UnsupportedOperationException(); + } + + @Override + public Iterator> getVertexIterator(Set vertexTypes) { + if (CollectionUtils.isEmpty(vertexTypes)) { + return Collections.emptyIterator(); + } + + List vertexRecords = new ArrayList<>(); + for (String vertexType : vertexTypes) { + GraphLPGRecordStruct recordStruct = + (GraphLPGRecordStruct) + lpgGraphStoreClient.queryRecord(new ScanLPGRecordQuery(vertexType, null)); + vertexRecords.addAll(recordStruct.getVertices()); + } + + if (CollectionUtils.isEmpty(vertexRecords)) { + return Collections.emptyIterator(); + } + + return vertexRecords.stream() + .map( + vertexRecord -> { + VertexVersionProperty property = + new VertexVersionProperty(vertexRecord.toPropertyMapWithIdAndVersion()); + return (IVertex) + new Vertex( + new VertexId(vertexRecord.getId(), vertexRecord.getVertexType()), property); + }) + .iterator(); + } + + @Override + public List> getEdges( + IVertexId vertexId, + Long startVersion, + Long endVersion, + Set types, + Direction direction) { + List> edges = + super.getEdges(vertexId, startVersion, endVersion, types, direction); + if (CollectionUtils.isNotEmpty(edges)) { + return edges; + } + + GraphLPGRecordStruct recordStruct = + (GraphLPGRecordStruct) + lpgGraphStoreClient.queryRecord( + new OneHopLPGRecordQuery( + vertexId.getBizId(), + vertexId.getType(), + types.stream().map(EdgeTypeName::parse).collect(Collectors.toSet()), + com.antgroup.openspg.cloudext.interfaces.graphstore.model.Direction.valueOf( + direction.name()))); + + List edgeRecords = recordStruct.getEdges(); + List> results = new ArrayList<>(edgeRecords.size()); + for (EdgeRecord edgeRecord : edgeRecords) { + VertexId srcVertexId = + new VertexId(edgeRecord.getSrcId(), edgeRecord.getEdgeType().getStartVertexType()); + VertexId dstVertexId = + new VertexId(edgeRecord.getDstId(), edgeRecord.getEdgeType().getEndVertexType()); + if (Direction.IN.equals(direction)) { + // 当是IN边时,这里交换下src和dst,由于图存的方向和kgdsl需要的方向不一致 + VertexId tmp = srcVertexId; + srcVertexId = dstVertexId; + dstVertexId = tmp; + } + results.add( + new Edge<>( + srcVertexId, + dstVertexId, + new EdgeProperty(edgeRecord.toPropertyMapWithId()), + 0L, + direction, + edgeRecord.getEdgeType().toString())); + } + return results; + } +} diff --git a/server/api/facade/pom.xml b/server/api/facade/pom.xml index d3a627cd..62ac92f7 100644 --- a/server/api/facade/pom.xml +++ b/server/api/facade/pom.xml @@ -28,10 +28,6 @@ com.antgroup.openspg.server core-schema-model - - com.antgroup.openspg.server - core-reasoner-model - com.google.code.gson gson diff --git a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/JSON.java b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/SchemaJsonUtils.java similarity index 74% rename from server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/JSON.java rename to server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/SchemaJsonUtils.java index 89d8e2a7..ae3fe6ec 100644 --- a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/JSON.java +++ b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/SchemaJsonUtils.java @@ -41,25 +41,13 @@ import com.antgroup.openspg.core.schema.model.type.EntityType; import com.antgroup.openspg.core.schema.model.type.EventType; import com.antgroup.openspg.core.schema.model.type.SPGTypeEnum; import com.antgroup.openspg.core.schema.model.type.StandardType; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.JobReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.KgdslReasonerContent; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerContentTypeEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerReceiptTypeEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.SuccessReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.VertexReasonerContent; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.ToNumberPolicy; import com.google.gson.typeadapters.RuntimeTypeAdapterFactory; import java.lang.reflect.Type; -public class JSON { +public class SchemaJsonUtils { public static final String DATA_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static final String DEFAULT_TYPE_FIELD_NAME = "@type"; @@ -103,32 +91,13 @@ public class JSON { .registerSubtype( OperatorIdentifier.class, SPGIdentifierTypeEnum.OPERATOR.name()) .recognizeSubtypes()) - .registerTypeAdapterFactory( - RuntimeTypeAdapterFactory.of(BaseReasonerResult.class, DEFAULT_TYPE_FIELD_NAME) - .registerSubtype(FailureReasonerResult.class, JobInstStatusEnum.FAILURE.name()) - .registerSubtype(SuccessReasonerResult.class, JobInstStatusEnum.SUCCESS.name()) - .recognizeSubtypes()) // BaseConceptSemantic .registerTypeAdapterFactory( RuntimeTypeAdapterFactory.of(BaseConceptSemantic.class, DEFAULT_TYPE_FIELD_NAME) .registerSubtype(DynamicTaxonomySemantic.class) .registerSubtype(LogicalCausationSemantic.class) .recognizeSubtypes()) - // BaseReasonerContent - .registerTypeAdapterFactory( - RuntimeTypeAdapterFactory.of(BaseReasonerContent.class, DEFAULT_TYPE_FIELD_NAME) - .registerSubtype( - KgdslReasonerContent.class, ReasonerContentTypeEnum.KGDSL.name()) - .registerSubtype( - VertexReasonerContent.class, ReasonerContentTypeEnum.VERTEX.name()) - .recognizeSubtypes()) // BaseReasonerReceipt - .registerTypeAdapterFactory( - RuntimeTypeAdapterFactory.of(BaseReasonerReceipt.class, DEFAULT_TYPE_FIELD_NAME) - .registerSubtype( - TableReasonerReceipt.class, ReasonerReceiptTypeEnum.TABLE.name()) - .registerSubtype(JobReasonerReceipt.class, ReasonerReceiptTypeEnum.JOB.name()) - .recognizeSubtypes()) .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) .setDateFormat(DATA_FORMAT) .create(); diff --git a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerDslRunRequest.java b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerDslRunRequest.java deleted file mode 100644 index f2febdee..00000000 --- a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerDslRunRequest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.facade.dto.reasoner.request; - -import com.antgroup.openspg.server.common.model.base.BaseRequest; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import java.util.Map; - -public class ReasonerDslRunRequest extends BaseRequest { - - private Long projectId; - - private BaseReasonerContent content; - - private Map params; - - public BaseReasonerContent getContent() { - return content; - } - - public void setContent(BaseReasonerContent content) { - this.content = content; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } -} diff --git a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInfoQuery.java b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInfoQuery.java deleted file mode 100644 index bd3e7735..00000000 --- a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInfoQuery.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.facade.dto.reasoner.request; - -import com.antgroup.openspg.server.common.model.base.BaseQuery; - -public class ReasonerJobInfoQuery extends BaseQuery { - - private Long reasonerJobInfoId; - - private String externalJobInfoId; - - public Long getReasonerJobInfoId() { - return reasonerJobInfoId; - } - - public ReasonerJobInfoQuery setReasonerJobInfoId(Long reasonerJobInfoId) { - this.reasonerJobInfoId = reasonerJobInfoId; - return this; - } - - public String getExternalJobInfoId() { - return externalJobInfoId; - } - - public ReasonerJobInfoQuery setExternalJobInfoId(String externalJobInfoId) { - this.externalJobInfoId = externalJobInfoId; - return this; - } -} diff --git a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInstQuery.java b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInstQuery.java deleted file mode 100644 index 29ad61c9..00000000 --- a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobInstQuery.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.facade.dto.reasoner.request; - -import com.antgroup.openspg.server.common.model.base.BaseQuery; - -public class ReasonerJobInstQuery extends BaseQuery { - - private Long reasonerJobInstId; - - private String externalJobInstId; - - public Long getReasonerJobInstId() { - return reasonerJobInstId; - } - - public ReasonerJobInstQuery setReasonerJobInstId(Long reasonerJobInstId) { - this.reasonerJobInstId = reasonerJobInstId; - return this; - } - - public String getExternalJobInstId() { - return externalJobInstId; - } - - public ReasonerJobInstQuery setExternalJobInstId(String externalJobInstId) { - this.externalJobInstId = externalJobInstId; - return this; - } -} diff --git a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobSubmitRequest.java b/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobSubmitRequest.java deleted file mode 100644 index 4a9e5845..00000000 --- a/server/api/facade/src/main/java/com/antgroup/openspg/server/api/facade/dto/reasoner/request/ReasonerJobSubmitRequest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.facade.dto.reasoner.request; - -import com.antgroup.openspg.server.common.model.base.BaseRequest; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import java.util.Map; - -public class ReasonerJobSubmitRequest extends BaseRequest { - - private String jobName; - - private Long projectId; - - private BaseReasonerContent content; - - private String cron; - - private String idempotentId; - - private Map params; - - public BaseReasonerContent getContent() { - return content; - } - - public void setContent(BaseReasonerContent content) { - this.content = content; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getCron() { - return cron; - } - - public void setCron(String cron) { - this.cron = cron; - } - - public String getIdempotentId() { - return idempotentId; - } - - public void setIdempotentId(String idempotentId) { - this.idempotentId = idempotentId; - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } -} diff --git a/server/api/http-client/src/main/java/com/antgroup/openspg/server/api/http/client/forest/GsonConvertor.java b/server/api/http-client/src/main/java/com/antgroup/openspg/server/api/http/client/forest/GsonConvertor.java index 6d3caa5f..3b2eb5c0 100644 --- a/server/api/http-client/src/main/java/com/antgroup/openspg/server/api/http/client/forest/GsonConvertor.java +++ b/server/api/http-client/src/main/java/com/antgroup/openspg/server/api/http/client/forest/GsonConvertor.java @@ -13,7 +13,7 @@ package com.antgroup.openspg.server.api.http.client.forest; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.dtflys.forest.converter.ConvertOptions; import com.dtflys.forest.converter.json.ForestJsonConverter; import com.dtflys.forest.http.ForestRequest; @@ -40,7 +40,7 @@ public class GsonConvertor implements ForestJsonConverter { @Override public String encodeToString(Object obj) { - return JSON.serialize(obj); + return SchemaJsonUtils.serialize(obj); } @Override @@ -76,7 +76,7 @@ public class GsonConvertor implements ForestJsonConverter { if (obj instanceof CharSequence) { return convertToJavaObject(obj.toString(), LinkedHashMap.class); } - final Gson gson = JSON.gson; + final Gson gson = SchemaJsonUtils.gson; final JsonElement jsonElement = gson.toJsonTree(obj); return toMap(jsonElement.getAsJsonObject(), true); } @@ -88,7 +88,7 @@ public class GsonConvertor implements ForestJsonConverter { @Override public String getDateFormat() { - return JSON.DATA_FORMAT; + return SchemaJsonUtils.DATA_FORMAT; } @Override @@ -96,7 +96,7 @@ public class GsonConvertor implements ForestJsonConverter { if (StringUtils.isBlank(source)) { return null; } - return JSON.deserialize(source, targetType); + return SchemaJsonUtils.deserialize(source, targetType); } @Override diff --git a/server/api/http-server/pom.xml b/server/api/http-server/pom.xml index 503c7c09..335d9319 100644 --- a/server/api/http-server/pom.xml +++ b/server/api/http-server/pom.xml @@ -36,10 +36,6 @@ com.antgroup.openspg.server biz-common - - com.antgroup.openspg.server - biz-reasoner - org.springdoc springdoc-openapi-ui diff --git a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/WebMvcConfig.java b/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/WebMvcConfig.java index 410e6314..f6804a77 100644 --- a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/WebMvcConfig.java +++ b/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/WebMvcConfig.java @@ -13,7 +13,7 @@ package com.antgroup.openspg.server.api.http.server; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import java.util.Collections; import java.util.List; import org.springframework.context.annotation.Configuration; @@ -28,7 +28,7 @@ public class WebMvcConfig implements WebMvcConfigurer { @Override public void extendMessageConverters(List> converters) { GsonHttpMessageConverter gsonHttpMessageConverter = new GsonHttpMessageConverter(); - gsonHttpMessageConverter.setGson(JSON.gson); + gsonHttpMessageConverter.setGson(SchemaJsonUtils.gson); gsonHttpMessageConverter.setSupportedMediaTypes( Collections.singletonList(MediaType.APPLICATION_JSON)); converters.add(0, gsonHttpMessageConverter); diff --git a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ObjectStoreController.java b/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ObjectStoreController.java deleted file mode 100644 index b4af3aaa..00000000 --- a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ObjectStoreController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.http.server.openapi; - -import com.antgroup.openspg.server.api.facade.dto.common.request.ObjectStoreRequest; -import com.antgroup.openspg.server.api.facade.dto.common.response.ObjectStoreResponse; -import com.antgroup.openspg.server.api.http.server.HttpBizCallback; -import com.antgroup.openspg.server.api.http.server.HttpBizTemplate; -import com.antgroup.openspg.server.biz.common.ObjectStoreManager; -import java.io.IOException; -import java.io.InputStream; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; - -@Controller -@RequestMapping("/public/v1/objectStore") -public class ObjectStoreController { - - @Autowired private ObjectStoreManager objectStoreManager; - - @RequestMapping(method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public ResponseEntity upload(ObjectStoreRequest request, MultipartFile file) { - return HttpBizTemplate.execute( - new HttpBizCallback() { - @Override - public void check() {} - - @Override - public ObjectStoreResponse action() { - InputStream inputStream = null; - try { - inputStream = file.getInputStream(); - } catch (IOException e) { - throw new RuntimeException(e); - } - return objectStoreManager.objectStore(request, inputStream); - } - }); - } -} diff --git a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ReasonerController.java b/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ReasonerController.java deleted file mode 100644 index 86990113..00000000 --- a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/ReasonerController.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.http.server.openapi; - -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerDslRunRequest; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobSubmitRequest; -import com.antgroup.openspg.server.api.http.server.BaseController; -import com.antgroup.openspg.server.api.http.server.HttpBizCallback; -import com.antgroup.openspg.server.api.http.server.HttpBizTemplate; -import com.antgroup.openspg.server.biz.reasoner.ReasonerManager; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -@Controller -@RequestMapping("/public/v1/reasoner") -public class ReasonerController extends BaseController { - - @Autowired private ReasonerManager reasonerManager; - - @RequestMapping(value = "/runDsl", method = RequestMethod.POST) - public ResponseEntity runDsl(@RequestBody ReasonerDslRunRequest request) { - return HttpBizTemplate.execute( - new HttpBizCallback() { - @Override - public void check() {} - - @Override - public BaseReasonerReceipt action() { - return reasonerManager.runDsl(request); - } - }); - } - - @RequestMapping(value = "/submitJobInfo", method = RequestMethod.POST) - public ResponseEntity submitJobInfo(@RequestBody ReasonerJobSubmitRequest request) { - return HttpBizTemplate.execute( - new HttpBizCallback() { - @Override - public void check() {} - - @Override - public BaseReasonerReceipt action() { - return reasonerManager.submitJob(request); - } - }); - } - - @RequestMapping(value = "/queryJobInst", method = RequestMethod.GET) - public ResponseEntity queryJobInst(@RequestParam(required = false) Long jobInstId) { - return HttpBizTemplate.execute( - new HttpBizCallback>() { - @Override - public void check() {} - - @Override - public List action() { - ReasonerJobInstQuery query = new ReasonerJobInstQuery(); - query.setReasonerJobInstId(jobInstId); - return reasonerManager.queryJobInst(query); - } - }); - } -} diff --git a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/TableStoreController.java b/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/TableStoreController.java deleted file mode 100644 index 44e4ff57..00000000 --- a/server/api/http-server/src/main/java/com/antgroup/openspg/server/api/http/server/openapi/TableStoreController.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.api.http.server.openapi; - -import com.antgroup.openspg.server.api.http.server.BaseController; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import org.springframework.core.io.InputStreamResource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -@Controller -@RequestMapping("/public/v1/tableStore") -public class TableStoreController extends BaseController { - - @RequestMapping(path = "/download", method = RequestMethod.GET) - public ResponseEntity download(String fileName) { - File file = new File(fileName); - FileInputStream fileInputStream = null; - try { - fileInputStream = new FileInputStream(file); - } catch (FileNotFoundException e) { - return ResponseEntity.notFound().build(); - } - InputStreamResource resource = new InputStreamResource(fileInputStream); - - return ResponseEntity.ok() - .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + fileName) - .contentLength(file.length()) - .contentType(MediaType.APPLICATION_OCTET_STREAM) - .body(resource); - } -} diff --git a/server/arks/sofaboot/pom.xml b/server/arks/sofaboot/pom.xml index 8e6ff8e6..c4c545eb 100644 --- a/server/arks/sofaboot/pom.xml +++ b/server/arks/sofaboot/pom.xml @@ -27,10 +27,6 @@ com.antgroup.openspg.server api-http-server - - com.antgroup.openspg.server - biz-reasoner - com.antgroup.openspg.server biz-schema @@ -71,7 +67,6 @@ 2.5.7 true - ../../dev/release/openspg/target executable diff --git a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/ObjectStoreManager.java b/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/ObjectStoreManager.java deleted file mode 100644 index b94f4b9f..00000000 --- a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/ObjectStoreManager.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.biz.common; - -import com.antgroup.openspg.server.api.facade.dto.common.request.ObjectStoreRequest; -import com.antgroup.openspg.server.api.facade.dto.common.response.ObjectStoreResponse; -import java.io.InputStream; - -public interface ObjectStoreManager { - - ObjectStoreResponse objectStore(ObjectStoreRequest request, InputStream file); -} diff --git a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/ObjectStoreManagerImpl.java b/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/ObjectStoreManagerImpl.java deleted file mode 100644 index 48c1af7d..00000000 --- a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/ObjectStoreManagerImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.biz.common.impl; - -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClient; -import com.antgroup.openspg.cloudext.interfaces.objectstore.cmd.ObjectStoreSaveCmd; -import com.antgroup.openspg.cloudext.interfaces.objectstore.model.ObjectStorePath; -import com.antgroup.openspg.server.api.facade.dto.common.request.ObjectStoreRequest; -import com.antgroup.openspg.server.api.facade.dto.common.response.ObjectStoreResponse; -import com.antgroup.openspg.server.biz.common.ObjectStoreManager; -import com.antgroup.openspg.server.common.service.datasource.DataSourceService; -import java.io.InputStream; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ObjectStoreManagerImpl implements ObjectStoreManager { - - @Autowired private DataSourceService dataSourceService; - - @Override - public ObjectStoreResponse objectStore(ObjectStoreRequest request, InputStream file) { - ObjectStoreClient objectStoreClient = dataSourceService.buildSharedFileStoreClient(); - - ObjectStorePath filePath = - objectStoreClient.save( - new ObjectStoreSaveCmd(new ObjectStorePath(request.getName()), file)); - return new ObjectStoreResponse() - .setRelativePath(filePath.getRelativePath()) - .setAbsolutePath(filePath.getAbsolutePath()); - } -} diff --git a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/SearchEngineManagerImpl.java b/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/SearchEngineManagerImpl.java index ddf4505e..17b3510b 100644 --- a/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/SearchEngineManagerImpl.java +++ b/server/biz/common/src/main/java/com/antgroup/openspg/server/biz/common/impl/SearchEngineManagerImpl.java @@ -14,7 +14,7 @@ package com.antgroup.openspg.server.biz.common.impl; import com.antgroup.openspg.cloudext.interfaces.searchengine.SearchEngineClient; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.antgroup.openspg.server.api.facade.dto.common.request.SearchEngineIndexRequest; import com.antgroup.openspg.server.api.facade.dto.common.response.SearchEngineIndexResponse; import com.antgroup.openspg.server.biz.common.SearchEngineManager; @@ -38,6 +38,6 @@ public class SearchEngineManagerImpl implements SearchEngineManager { (SearchEngineConnectionInfo) searchEngineClient.getConnInfo(); return new SearchEngineIndexResponse() .setIndexName(convertedIndexName) - .setConnInfo(JSON.serialize(connInfo)); + .setConnInfo(SchemaJsonUtils.serialize(connInfo)); } } diff --git a/server/biz/reasoner/pom.xml b/server/biz/reasoner/pom.xml deleted file mode 100644 index a06d34b9..00000000 --- a/server/biz/reasoner/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../pom.xml - - - biz-reasoner - - - com.antgroup.openspg.server - api-http-client - - - com.antgroup.openspg.server - common-service - - - com.antgroup.openspg.server - core-reasoner-service - - - org.springframework - spring-context - - - diff --git a/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/ReasonerManager.java b/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/ReasonerManager.java deleted file mode 100644 index 8a2bbbfc..00000000 --- a/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/ReasonerManager.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.biz.reasoner; - -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerDslRunRequest; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobSubmitRequest; -import com.antgroup.openspg.server.core.reasoner.model.service.JobReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; -import java.util.List; - -public interface ReasonerManager { - - TableReasonerReceipt runDsl(ReasonerDslRunRequest request); - - JobReasonerReceipt submitJob(ReasonerJobSubmitRequest request); - - List queryJobInst(ReasonerJobInstQuery query); -} diff --git a/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/impl/ReasonerManagerImpl.java b/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/impl/ReasonerManagerImpl.java deleted file mode 100644 index b950556e..00000000 --- a/server/biz/reasoner/src/main/java/com/antgroup/openspg/server/biz/reasoner/impl/ReasonerManagerImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.biz.reasoner.impl; - -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClient; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobRunCmd; -import com.antgroup.openspg.common.util.StringUtils; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerDslRunRequest; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobSubmitRequest; -import com.antgroup.openspg.server.biz.reasoner.ReasonerManager; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.job.JobInfoStateEnum; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.common.service.config.AppEnvConfig; -import com.antgroup.openspg.server.common.service.datasource.DataSourceService; -import com.antgroup.openspg.server.core.reasoner.model.service.JobReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInfoService; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInstService; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ReasonerManagerImpl implements ReasonerManager { - - @Autowired private AppEnvConfig appEnvConfig; - - @Autowired private ReasonerJobInfoService reasonerJobInfoService; - - @Autowired private ReasonerJobInstService reasonerJobInstService; - - @Autowired private DataSourceService dataSourceService; - - @Override - public TableReasonerReceipt runDsl(ReasonerDslRunRequest request) { - ComputingClient computingClient = dataSourceService.buildSharedComputingClient(); - return computingClient.run( - new ReasonerJobRunCmd( - request.getProjectId(), - appEnvConfig.getSchemaUri(), - (GraphStoreConnectionInfo) dataSourceService.buildSharedKgStoreClient().getConnInfo(), - request.getContent())); - } - - @Override - public JobReasonerReceipt submitJob(ReasonerJobSubmitRequest request) { - ReasonerJobInfo reasonerJobInfo = - new ReasonerJobInfo( - request.getJobName(), - request.getProjectId(), - request.getContent(), - request.getCron(), - JobInfoStateEnum.ENABLE, - request.getParams()); - - // create a reasoner job - Long reasonerJobInfoId = reasonerJobInfoService.create(reasonerJobInfo); - - // if the cron expression is empty, create a reasoner job instance - Long reasonerJobInstId = null; - if (StringUtils.isBlank(request.getCron())) { - ReasonerJobInst reasonerJobInst = - new ReasonerJobInst( - reasonerJobInfoId, - reasonerJobInfo.getProjectId(), - JobInstStatusEnum.INIT, - null, - null, - null, - null, - null); - reasonerJobInstId = reasonerJobInstService.create(reasonerJobInfo, reasonerJobInst); - } - return new JobReasonerReceipt(reasonerJobInfoId, reasonerJobInstId); - } - - @Override - public List queryJobInst(ReasonerJobInstQuery query) { - return reasonerJobInstService.query(query); - } -} diff --git a/server/cloudext/impl/computing/local/pom.xml b/server/cloudext/impl/computing/local/pom.xml deleted file mode 100644 index da8cc399..00000000 --- a/server/cloudext/impl/computing/local/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../../pom.xml - - - cloudext-impl-computing-local - - - - com.antgroup.openspg.server - cloudext-interface-computing - - - com.antgroup.openspg.cloudext - cloudext-interface-table-store - - - com.antgroup.kg.reasoner - local - ${kgreasoner-version} - system - ${project.basedir}/../../../../lib/spgreasoner-local-0.0.1.jar - - - com.antgroup.openspg.server - core-reasoner-service - - - diff --git a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClient.java b/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClient.java deleted file mode 100644 index 165f4cab..00000000 --- a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClient.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.computing.local; - -import com.antgroup.openspg.cloudext.impl.computing.local.impl.LocalReasonerExecutorImpl; -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClient; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobCanSubmitQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobProcessQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobRunCmd; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobSubmitCmd; -import com.antgroup.openspg.server.common.model.datasource.connection.ComputingConnectionInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class LocalComputingClient implements ComputingClient { - - private static final String BUILDER_NUMBER_OF_THREAD = "builder.nThreads"; - - @Getter private final ComputingConnectionInfo connInfo; - private final LocalReasonerExecutor localReasonerExecutor; - - public LocalComputingClient(ComputingConnectionInfo connInfo) { - this.connInfo = connInfo; - localReasonerExecutor = - new LocalReasonerExecutorImpl( - (String) connInfo.getParamOrDefault(BUILDER_NUMBER_OF_THREAD, "*2")); - } - - @Override - public ReasonerStatusWithProgress query(ReasonerJobProcessQuery query) { - return localReasonerExecutor.query(query); - } - - @Override - public boolean canSubmit(ReasonerJobCanSubmitQuery query) { - return localReasonerExecutor.canSubmit(query); - } - - @Override - public String submit(ReasonerJobSubmitCmd cmd) { - return localReasonerExecutor.submit(cmd); - } - - @Override - public TableReasonerReceipt run(ReasonerJobRunCmd cmd) { - return localReasonerExecutor.run(cmd); - } -} diff --git a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClientDriver.java b/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClientDriver.java deleted file mode 100644 index 809d8cb4..00000000 --- a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalComputingClientDriver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.computing.local; - -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClient; -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriver; -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriverManager; -import com.antgroup.openspg.common.util.cloudext.CachedCloudExtClientDriver; -import com.antgroup.openspg.server.common.model.datasource.connection.ComputingConnectionInfo; - -public class LocalComputingClientDriver - extends CachedCloudExtClientDriver - implements ComputingClientDriver { - - static { - ComputingClientDriverManager.registerDriver(new LocalComputingClientDriver()); - } - - @Override - public String driverScheme() { - return "local"; - } - - @Override - protected ComputingClient innerConnect(ComputingConnectionInfo connInfo) { - return new LocalComputingClient(connInfo); - } -} diff --git a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalReasonerExecutor.java b/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalReasonerExecutor.java deleted file mode 100644 index 687a208a..00000000 --- a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/LocalReasonerExecutor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.computing.local; - -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobCanSubmitQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobProcessQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobRunCmd; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobSubmitCmd; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; - -public interface LocalReasonerExecutor { - - ReasonerStatusWithProgress query(ReasonerJobProcessQuery query); - - boolean canSubmit(ReasonerJobCanSubmitQuery query); - - String submit(ReasonerJobSubmitCmd cmd); - - TableReasonerReceipt run(ReasonerJobRunCmd cmd); -} diff --git a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/impl/LocalReasonerExecutorImpl.java b/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/impl/LocalReasonerExecutorImpl.java deleted file mode 100644 index a718b72f..00000000 --- a/server/cloudext/impl/computing/local/src/main/java/com/antgroup/openspg/cloudext/impl/computing/local/impl/LocalReasonerExecutorImpl.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.computing.local.impl; - -import com.antgroup.kg.reasoner.catalog.impl.KgSchemaConnectionInfo; -import com.antgroup.kg.reasoner.local.KGReasonerLocalRunner; -import com.antgroup.kg.reasoner.local.model.LocalReasonerResult; -import com.antgroup.kg.reasoner.local.model.LocalReasonerTask; -import com.antgroup.openspg.cloudext.impl.computing.local.LocalReasonerExecutor; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobCanSubmitQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobProcessQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobRunCmd; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobSubmitCmd; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableFileHandler; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClient; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriverManager; -import com.antgroup.openspg.cloudext.interfaces.tablestore.cmd.TableFileCreateCmd; -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.ColumnMeta; -import com.antgroup.openspg.cloudext.interfaces.tablestore.model.TableRecord; -import com.antgroup.openspg.common.util.StringUtils; -import com.antgroup.openspg.common.util.thread.ThreadUtils; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.core.reasoner.model.ReasonerException; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.KgdslReasonerContent; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerProgress; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.model.service.SuccessReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; -import com.antgroup.openspg.server.core.reasoner.service.util.LocalRunnerUtils; -import java.util.Arrays; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.stream.Collectors; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; - -@Slf4j -public class LocalReasonerExecutorImpl implements LocalReasonerExecutor { - - // for reasoner job - private final ThreadPoolExecutor jobDriver; - private final ThreadPoolExecutor jobWorker; - private final Map> runningReasonerJobInst; - - // for olap - private final ThreadPoolExecutor olapDriver; - private final ThreadPoolExecutor olapWorker; - - public LocalReasonerExecutorImpl(String nThreads) { - jobDriver = ThreadUtils.newDaemonFixedThreadPool(1, "localReasonerDriver"); - jobWorker = - ThreadUtils.newDaemonFixedThreadPool(ThreadUtils.nThreads(nThreads), "localReasonerWorker"); - - olapDriver = - ThreadUtils.newDaemonFixedThreadPool(ThreadUtils.nThreads("*1"), "olapReasonerDriver"); - olapWorker = - ThreadUtils.newDaemonFixedThreadPool(ThreadUtils.nThreads(nThreads), "olapReasonerWorker"); - runningReasonerJobInst = new ConcurrentHashMap<>(); - } - - @Override - public ReasonerStatusWithProgress query(ReasonerJobProcessQuery query) { - Future future = - runningReasonerJobInst.get(query.getComputingJobInstId()); - if (future == null) { - return null; - } - if (future.isDone()) { - // if finished, remove it from runningBuilderJobInst - runningReasonerJobInst.remove(query.getComputingJobInstId()); - ReasonerStatusWithProgress progress = null; - try { - progress = future.get(); - } catch (Throwable e) { - throw ReasonerException.reasonerError(e); - } - return progress; - } else { - return new ReasonerStatusWithProgress(JobInstStatusEnum.RUNNING); - } - } - - @Override - public boolean canSubmit(ReasonerJobCanSubmitQuery query) { - return runningReasonerJobInst.isEmpty(); - } - - @Override - public String submit(ReasonerJobSubmitCmd cmd) { - ReasonerJobInst jobInst = cmd.getJobInst(); - if (runningReasonerJobInst.isEmpty()) { - synchronized (runningReasonerJobInst) { - if (runningReasonerJobInst.isEmpty()) { - Future future = doSubmit(cmd); - String computingJobInstId = String.valueOf(jobInst.getJobInstId()); - runningReasonerJobInst.put(computingJobInstId, future); - return computingJobInstId; - } - } - } - return null; - } - - @Override - public TableReasonerReceipt run(ReasonerJobRunCmd cmd) { - Future future = - olapDriver.submit( - () -> { - LocalReasonerResult localReasonerResult = - doRun( - cmd.getProjectId(), - cmd.getSchemaUrl(), - cmd.getConnInfo(), - cmd.getContent(), - olapWorker); - return buildReceipt(localReasonerResult); - }); - try { - return future.get(3, TimeUnit.MINUTES); - } catch (InterruptedException | ExecutionException e) { - throw ReasonerException.reasonerError(e); - } catch (TimeoutException e) { - future.cancel(true); - throw ReasonerException.timeout(3); - } - } - - private Future doSubmit(ReasonerJobSubmitCmd cmd) { - return jobDriver.submit( - () -> { - try { - ReasonerJobInfo jobInfo = cmd.getJobInfo(); - LocalReasonerResult localReasonerResult = - doRun( - jobInfo.getProjectId(), - cmd.getSchemaUrl(), - cmd.getGraphStoreConnInfo(), - jobInfo.getContent(), - jobWorker); - JobInstStatusEnum status = null; - BaseReasonerResult result = null; - ReasonerProgress progress = new ReasonerProgress(); - if (StringUtils.isNotBlank(localReasonerResult.getErrMsg())) { - status = JobInstStatusEnum.FAILURE; - result = new FailureReasonerResult(localReasonerResult.getErrMsg()); - } else { - status = JobInstStatusEnum.SUCCESS; - result = writeResult2TableFile(cmd, localReasonerResult); - } - return new ReasonerStatusWithProgress(status, result, progress); - } catch (Throwable e) { - throw ReasonerException.reasonerError(e); - } - }); - } - - private LocalReasonerResult doRun( - Long projectId, - String schemaUrl, - GraphStoreConnectionInfo connInfo, - BaseReasonerContent content, - ThreadPoolExecutor executor) { - KGReasonerLocalRunner localRunner = new KGReasonerLocalRunner(); - LocalReasonerTask reasonerTask = new LocalReasonerTask(); - reasonerTask.setThreadPoolExecutor(executor); - reasonerTask.setCatalog( - LocalRunnerUtils.buildCatalog(projectId, new KgSchemaConnectionInfo(schemaUrl, ""))); - reasonerTask.setGraphState(LocalRunnerUtils.buildGraphState(connInfo)); - reasonerTask.setDsl(((KgdslReasonerContent) content).getKgdsl()); - return localRunner.run(reasonerTask); - } - - private SuccessReasonerResult writeResult2TableFile( - ReasonerJobSubmitCmd cmd, LocalReasonerResult result) throws Exception { - TableStoreClient tableStoreClient = - TableStoreClientDriverManager.getClient(cmd.getTableStoreConnInfo()); - - if (CollectionUtils.isEmpty(result.getColumns())) { - return new SuccessReasonerResult(null); - } - String tableName = cmd.tableName(); - TableFileHandler fileHandler = - tableStoreClient.create( - new TableFileCreateCmd( - tableName, - result.getColumns().stream().map(ColumnMeta::new).toArray(ColumnMeta[]::new))); - - fileHandler.batchWrite( - result.getRows().stream().map(TableRecord::new).collect(Collectors.toList())); - fileHandler.close(); - return new SuccessReasonerResult(fileHandler.getTableName()); - } - - private TableReasonerReceipt buildReceipt(LocalReasonerResult reasonerResult) { - if (StringUtils.isNotBlank(reasonerResult.getErrMsg())) { - throw ReasonerException.reasonerError(reasonerResult.getErrMsg()); - } - return new TableReasonerReceipt( - reasonerResult.getColumns(), - reasonerResult.getRows().stream().map(Arrays::asList).collect(Collectors.toList())); - } -} diff --git a/server/cloudext/impl/job-scheduler/local/pom.xml b/server/cloudext/impl/job-scheduler/local/pom.xml deleted file mode 100644 index 567ac994..00000000 --- a/server/cloudext/impl/job-scheduler/local/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../../pom.xml - - - cloudext-impl-job-scheduler-local - - - - com.antgroup.openspg.server - cloudext-interface-job-scheduler - - - com.antgroup.openspg.server - common-service - - - diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClient.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClient.java deleted file mode 100644 index 1bae870e..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClient.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.scheduler.JobExecuteScheduler; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.SchedulerJobInfoService; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.SchedulerJobInstService; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClient; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.SchedulerCallback; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.common.model.datasource.connection.JobSchedulerConnectionInfo; -import com.antgroup.openspg.server.common.service.spring.SpringContextHolder; -import java.util.List; -import lombok.Getter; -import lombok.Setter; - -public class LocalJobSchedulerClient implements JobSchedulerClient { - - @Getter private final JobSchedulerConnectionInfo connInfo; - @Getter private final List schedulerCallbacks; - - @Setter private SchedulerJobInfoService jobInfoService; - @Setter private SchedulerJobInstService jobInstService; - - public LocalJobSchedulerClient(JobSchedulerConnectionInfo connInfo) { - this.connInfo = connInfo; - jobInfoService = SpringContextHolder.getBean(SchedulerJobInfoService.class); - jobInstService = SpringContextHolder.getBean(SchedulerJobInstService.class); - schedulerCallbacks = SpringContextHolder.getBeans(SchedulerCallback.class); - new JobExecuteScheduler(jobInstService, schedulerCallbacks).init(); - } - - @Override - public String createJobInfo(SchedulerJobInfo jobInfo) { - return jobInfoService.create(jobInfo); - } - - @Override - public String createJobInst(SchedulerJobInst jobInst) { - return jobInstService.create(jobInst); - } - - @Override - public void close() throws Exception {} -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClientDriver.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClientDriver.java deleted file mode 100644 index 11590b51..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/LocalJobSchedulerClientDriver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClient; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriver; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriverManager; -import com.antgroup.openspg.server.common.model.datasource.connection.JobSchedulerConnectionInfo; - -public class LocalJobSchedulerClientDriver implements JobSchedulerClientDriver { - - private static final JobSchedulerClient INSTANCE = - new LocalJobSchedulerClient(new JobSchedulerConnectionInfo().setScheme("local")); - - static { - JobSchedulerClientDriverManager.registerDriver(new LocalJobSchedulerClientDriver()); - } - - @Override - public String driverScheme() { - return "local"; - } - - @Override - public JobSchedulerClient connect(JobSchedulerConnectionInfo connInfo) { - return INSTANCE; - } -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/cmd/SchedulerJobInstQuery.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/cmd/SchedulerJobInstQuery.java deleted file mode 100644 index 120ee5fb..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/cmd/SchedulerJobInstQuery.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.cmd; - -import com.antgroup.openspg.server.common.model.base.BaseQuery; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.util.Set; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; - -@Setter -@Getter -@Accessors(chain = true) -public class SchedulerJobInstQuery extends BaseQuery { - - private Set status; - - private String orderBy; -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInfoRepository.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInfoRepository.java deleted file mode 100644 index cf06b17e..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInfoRepository.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; - -public interface SchedulerJobInfoRepository { - - String save(SchedulerJobInfo jobInfo); -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInstRepository.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInstRepository.java deleted file mode 100644 index bef5f1d9..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/repo/SchedulerJobInstRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.cmd.SchedulerJobInstQuery; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.util.List; - -public interface SchedulerJobInstRepository { - - String save(SchedulerJobInst jobInst); - - List query(SchedulerJobInstQuery query); - - int updateStatus(String jobInstId, JobInstStatusEnum status); -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/BaseScheduler.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/BaseScheduler.java deleted file mode 100644 index 7b26cf68..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/BaseScheduler.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.scheduler; - -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@Getter -public abstract class BaseScheduler {} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/JobExecuteScheduler.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/JobExecuteScheduler.java deleted file mode 100644 index 430e7be6..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/scheduler/JobExecuteScheduler.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.scheduler; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.SchedulerJobInstService; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.SchedulerCallback; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.CallbackResult; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.common.util.thread.SPGThread; -import com.antgroup.openspg.common.util.thread.ThreadUtils; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; - -@Slf4j -public class JobExecuteScheduler extends BaseScheduler { - - private final SchedulerJobInstService schedulerJobInstService; - private final Map schedulerCallbacks; - - public JobExecuteScheduler( - SchedulerJobInstService schedulerJobInstService, List schedulerCallbacks) { - this.schedulerJobInstService = schedulerJobInstService; - - this.schedulerCallbacks = new HashMap<>(JobTypeEnum.values().length); - for (SchedulerCallback schedulerCallback : schedulerCallbacks) { - for (JobTypeEnum jobType : schedulerCallback.accept()) { - this.schedulerCallbacks.put(jobType.name(), schedulerCallback); - } - } - } - - public void init() { - log.info("init JobExecuteScheduler..."); - new SPGThread( - "JobExecuteScheduler", - () -> { - while (true) { - try { - doExecute(); - ThreadUtils.sleep(3000); - } catch (Throwable e) { - log.warn("JobExecuteScheduler execute fail", e); - } - } - }) - .start(); - } - - private void doExecute() { - List runningJobInsts = schedulerJobInstService.queryRunningJobInsts(); - if (CollectionUtils.isNotEmpty(runningJobInsts)) { - processJobInsts(runningJobInsts); - return; - } - - List queuedJobInsts = schedulerJobInstService.queryToRunJobInsts(); - if (CollectionUtils.isNotEmpty(queuedJobInsts)) { - processJobInsts(queuedJobInsts); - } - } - - private void processJobInsts(List jobInsts) { - for (SchedulerJobInst jobInst : jobInsts) { - log.info( - "polling jobType={} schedulerJobInstId={}", jobInst.getJobType(), jobInst.getJobInstId()); - - SchedulerCallback callback = schedulerCallbacks.get(jobInst.getJobType()); - if (callback == null) { - updateStatus(jobInst, JobInstStatusEnum.FAILURE); - continue; - } - CallbackResult result = callback.polling(jobInst); - JobInstStatusEnum newStatus = result.getStatus(); - updateStatus(jobInst, newStatus); - } - } - - private void updateStatus(SchedulerJobInst jobInst, JobInstStatusEnum newStatus) { - if (!newStatus.equals(jobInst.getStatus())) { - log.info( - "update schedulerJobInstId={} from status={} to status={}", - jobInst.getJobInstId(), - jobInst.getStatus(), - newStatus); - schedulerJobInstService.updateStatus(jobInst.getJobInstId(), newStatus); - } - } -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInfoService.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInfoService.java deleted file mode 100644 index 7d23eb38..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInfoService.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.service; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; - -public interface SchedulerJobInfoService { - - String create(SchedulerJobInfo jobInfo); -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInstService.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInstService.java deleted file mode 100644 index 04c3f3d5..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/SchedulerJobInstService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.service; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.util.List; - -public interface SchedulerJobInstService { - - String create(SchedulerJobInst jobInst); - - List queryRunningJobInsts(); - - List queryToRunJobInsts(); - - void updateStatus(String jobInstId, JobInstStatusEnum status); -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInfoServiceImpl.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInfoServiceImpl.java deleted file mode 100644 index e2115b9d..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInfoServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.impl; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo.SchedulerJobInfoRepository; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.SchedulerJobInfoService; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class SchedulerJobInfoServiceImpl implements SchedulerJobInfoService { - - @Autowired private SchedulerJobInfoRepository jobInfoRepository; - - @Override - public String create(SchedulerJobInfo jobInfo) { - return jobInfoRepository.save(jobInfo); - } -} diff --git a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInstServiceImpl.java b/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInstServiceImpl.java deleted file mode 100644 index cc54947c..00000000 --- a/server/cloudext/impl/job-scheduler/local/src/main/java/com/antgroup/openspg/cloudext/impl/jobscheduler/local/service/impl/SchedulerJobInstServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.impl; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.cmd.SchedulerJobInstQuery; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo.SchedulerJobInstRepository; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.service.SchedulerJobInstService; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.google.common.collect.Sets; -import java.util.List; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Slf4j -@Service -public class SchedulerJobInstServiceImpl implements SchedulerJobInstService { - - @Autowired private SchedulerJobInstRepository schedulerJobInstRepository; - - @Override - public String create(SchedulerJobInst jobInst) { - return schedulerJobInstRepository.save(jobInst); - } - - @Override - public List queryRunningJobInsts() { - SchedulerJobInstQuery jobInstQuery = - new SchedulerJobInstQuery() - .setStatus(Sets.newHashSet(JobInstStatusEnum.RUNNING_STATUS)) - .setOrderBy("id asc"); - return schedulerJobInstRepository.query(jobInstQuery); - } - - @Override - public List queryToRunJobInsts() { - SchedulerJobInstQuery jobInstQuery = - new SchedulerJobInstQuery() - .setStatus(Sets.newHashSet(JobInstStatusEnum.QUEUE, JobInstStatusEnum.INIT)) - .setOrderBy("id asc"); - return schedulerJobInstRepository.query(jobInstQuery); - } - - @Override - public void updateStatus(String jobInstId, JobInstStatusEnum status) { - schedulerJobInstRepository.updateStatus(jobInstId, status); - } -} diff --git a/server/cloudext/interface/computing/pom.xml b/server/cloudext/interface/computing/pom.xml deleted file mode 100644 index 799b5f23..00000000 --- a/server/cloudext/interface/computing/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - cloudext-interface-computing - - - - com.antgroup.openspg - common-util - - - com.antgroup.openspg.server - core-reasoner-model - - - diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClient.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClient.java deleted file mode 100644 index 0c7720a6..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClient.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing; - -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobCanSubmitQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobProcessQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobRunCmd; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobSubmitCmd; -import com.antgroup.openspg.common.util.cloudext.CloudExtClient; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.model.service.TableReasonerReceipt; - -public interface ComputingClient extends CloudExtClient { - - /* ----------------------- * - | Reasoner Job | - * ----------------------- */ - - ReasonerStatusWithProgress query(ReasonerJobProcessQuery query); - - boolean canSubmit(ReasonerJobCanSubmitQuery query); - - String submit(ReasonerJobSubmitCmd cmd); - - TableReasonerReceipt run(ReasonerJobRunCmd cmd); -} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriver.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriver.java deleted file mode 100644 index e591affe..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriver.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing; - -import com.antgroup.openspg.common.util.cloudext.CloudExtClientDriver; -import com.antgroup.openspg.server.common.model.datasource.connection.ComputingConnectionInfo; - -public interface ComputingClientDriver - extends CloudExtClientDriver {} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriverManager.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriverManager.java deleted file mode 100644 index dfa56ce3..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/ComputingClientDriverManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing; - -import com.antgroup.openspg.common.util.DriverManagerUtils; -import com.antgroup.openspg.server.common.model.datasource.connection.ComputingConnectionInfo; -import com.antgroup.openspg.server.common.model.exception.CloudExtException; -import java.util.concurrent.CopyOnWriteArrayList; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class ComputingClientDriverManager { - - private static final CopyOnWriteArrayList registeredDrivers = - new CopyOnWriteArrayList<>(); - - private ComputingClientDriverManager() {} - - static { - DriverManagerUtils.loadDrivers("cloudext.computing.drivers", ComputingClientDriver.class); - log.info("computing DriverManager initialized"); - } - - public static synchronized void registerDriver(ComputingClientDriver driver) { - if (driver != null) { - registeredDrivers.addIfAbsent(driver); - } else { - throw new NullPointerException(); - } - log.info("registerDriver: {}", driver); - } - - public static ComputingClient getClient(ComputingConnectionInfo config) { - for (ComputingClientDriver driver : registeredDrivers) { - if (driver.acceptsConfig(config)) { - return driver.connect(config); - } - } - throw CloudExtException.driverNotExist(config); - } -} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobCanSubmitQuery.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobCanSubmitQuery.java deleted file mode 100644 index eaab6772..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobCanSubmitQuery.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing.cmd; - -import com.antgroup.openspg.server.common.model.base.BaseQuery; - -public class ReasonerJobCanSubmitQuery extends BaseQuery {} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobProcessQuery.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobProcessQuery.java deleted file mode 100644 index 7ba73739..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobProcessQuery.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing.cmd; - -import com.antgroup.openspg.server.common.model.base.BaseQuery; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class ReasonerJobProcessQuery extends BaseQuery { - - private final String computingJobInstId; -} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobRunCmd.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobRunCmd.java deleted file mode 100644 index 113e3a53..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobRunCmd.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing.cmd; - -import com.antgroup.openspg.server.common.model.base.BaseCmd; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class ReasonerJobRunCmd extends BaseCmd { - - private final Long projectId; - - private final String schemaUrl; - - private final GraphStoreConnectionInfo connInfo; - - private final BaseReasonerContent content; -} diff --git a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobSubmitCmd.java b/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobSubmitCmd.java deleted file mode 100644 index eb89cdea..00000000 --- a/server/cloudext/interface/computing/src/main/java/com/antgroup/openspg/cloudext/interfaces/computing/cmd/ReasonerJobSubmitCmd.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.computing.cmd; - -import com.antgroup.openspg.server.common.model.base.BaseCmd; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import java.util.Map; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class ReasonerJobSubmitCmd extends BaseCmd { - - private final ReasonerJobInst jobInst; - - private final ReasonerJobInfo jobInfo; - - private final GraphStoreConnectionInfo graphStoreConnInfo; - - private final TableStoreConnectionInfo tableStoreConnInfo; - - private final String schemaUrl; - - private final Map params; - - public String tableName() { - return String.format("spgreasoner_%s_%s_result", jobInfo.getJobName(), jobInst.getJobInstId()); - } -} diff --git a/server/cloudext/interface/computing/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriver b/server/cloudext/interface/computing/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriver deleted file mode 100644 index 98a48d4a..00000000 --- a/server/cloudext/interface/computing/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriver +++ /dev/null @@ -1 +0,0 @@ -com.antgroup.openspg.cloudext.impl.computing.local.LocalComputingClientDriver diff --git a/server/cloudext/interface/job-scheduler/pom.xml b/server/cloudext/interface/job-scheduler/pom.xml deleted file mode 100644 index b08bd31a..00000000 --- a/server/cloudext/interface/job-scheduler/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - cloudext-interface-job-scheduler - - - - com.antgroup.openspg - common-util - - - diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClient.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClient.java deleted file mode 100644 index e6ef0b07..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClient.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.common.util.cloudext.CloudExtClient; - -public interface JobSchedulerClient extends CloudExtClient { - - String createJobInfo(SchedulerJobInfo jobInfo); - - String createJobInst(SchedulerJobInst jobInst); - - void close() throws Exception; -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriver.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriver.java deleted file mode 100644 index 00e48c8c..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriver.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler; - -import com.antgroup.openspg.common.util.cloudext.CloudExtClientDriver; -import com.antgroup.openspg.server.common.model.datasource.connection.JobSchedulerConnectionInfo; - -public interface JobSchedulerClientDriver - extends CloudExtClientDriver {} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriverManager.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriverManager.java deleted file mode 100644 index b6c13f9e..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/JobSchedulerClientDriverManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler; - -import com.antgroup.openspg.common.util.DriverManagerUtils; -import com.antgroup.openspg.server.common.model.datasource.connection.JobSchedulerConnectionInfo; -import com.antgroup.openspg.server.common.model.exception.CloudExtException; -import java.util.concurrent.CopyOnWriteArrayList; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class JobSchedulerClientDriverManager { - - private static final CopyOnWriteArrayList registeredDrivers = - new CopyOnWriteArrayList<>(); - - private JobSchedulerClientDriverManager() {} - - static { - DriverManagerUtils.loadDrivers("cloudext.jobscheduler.drivers", JobSchedulerClientDriver.class); - log.info("job-scheduler DriverManager initialized"); - } - - public static synchronized void registerDriver(JobSchedulerClientDriver driver) { - if (driver != null) { - registeredDrivers.addIfAbsent(driver); - } else { - throw new NullPointerException(); - } - log.info("registerDriver: {}", driver); - } - - public static JobSchedulerClient getClient(JobSchedulerConnectionInfo config) { - for (JobSchedulerClientDriver driver : registeredDrivers) { - if (driver.acceptsConfig(config)) { - return driver.connect(config); - } - } - throw CloudExtException.driverNotExist(config); - } -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/SchedulerCallback.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/SchedulerCallback.java deleted file mode 100644 index 5431535c..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/SchedulerCallback.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.CallbackResult; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import java.util.Set; - -public interface SchedulerCallback { - - Set accept(); - - CallbackResult polling(SchedulerJobInst jobInst); -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/CallbackResult.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/CallbackResult.java deleted file mode 100644 index 1f9ce46a..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/CallbackResult.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler.model; - -import com.antgroup.openspg.server.common.model.job.BaseJobRunResult; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.io.Serializable; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class CallbackResult implements Serializable { - - private final JobInstStatusEnum status; - - private final BaseJobRunResult result; -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/JobTypeEnum.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/JobTypeEnum.java deleted file mode 100644 index d00c594c..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/JobTypeEnum.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler.model; - -public enum JobTypeEnum { - BUILDING, - REASONING, - ; -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInfo.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInfo.java deleted file mode 100644 index 30e7b5e8..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler.model; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import com.antgroup.openspg.server.common.model.job.JobInfoStateEnum; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -@Getter -@AllArgsConstructor -public class SchedulerJobInfo extends BaseValObj { - - @Setter private String jobId; - - private final String jobName; - - private final String jobType; - - private final String cron; - - private final JobInfoStateEnum status; - - private final String idempotentId; -} diff --git a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInst.java b/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInst.java deleted file mode 100644 index a74c207b..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/java/com/antgroup/openspg/cloudext/interfaces/jobscheduler/model/SchedulerJobInst.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.cloudext.interfaces.jobscheduler.model; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class SchedulerJobInst extends BaseValObj { - - private final String jobInstId; - - private final String jobId; - - private final String jobType; - - private final JobInstStatusEnum status; - - private final String host; - - private final String idempotentId; -} diff --git a/server/cloudext/interface/job-scheduler/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriver b/server/cloudext/interface/job-scheduler/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriver deleted file mode 100644 index c2bc6592..00000000 --- a/server/cloudext/interface/job-scheduler/src/main/resources/META-INF/services/com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriver +++ /dev/null @@ -1 +0,0 @@ -com.antgroup.openspg.cloudext.impl.jobscheduler.local.LocalJobSchedulerClientDriver diff --git a/server/common/service/pom.xml b/server/common/service/pom.xml index 79f86148..2c7642f1 100644 --- a/server/common/service/pom.xml +++ b/server/common/service/pom.xml @@ -36,26 +36,10 @@ com.antgroup.openspg.cloudext cloudext-interface-graph-store - - com.antgroup.openspg.cloudext - cloudext-interface-object-store - com.antgroup.openspg.cloudext cloudext-interface-search-engine - - com.antgroup.openspg.server - cloudext-interface-job-scheduler - - - com.antgroup.openspg.server - cloudext-interface-computing - - - com.antgroup.openspg.cloudext - cloudext-interface-table-store - org.springframework spring-beans diff --git a/server/common/service/src/main/java/com/antgroup/openspg/server/common/service/datasource/DataSourceService.java b/server/common/service/src/main/java/com/antgroup/openspg/server/common/service/datasource/DataSourceService.java index 8dacf93f..af724002 100644 --- a/server/common/service/src/main/java/com/antgroup/openspg/server/common/service/datasource/DataSourceService.java +++ b/server/common/service/src/main/java/com/antgroup/openspg/server/common/service/datasource/DataSourceService.java @@ -13,18 +13,10 @@ package com.antgroup.openspg.server.common.service.datasource; -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClient; -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClientDriverManager; import com.antgroup.openspg.cloudext.interfaces.graphstore.GraphStoreClient; import com.antgroup.openspg.cloudext.interfaces.graphstore.GraphStoreClientDriverManager; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClient; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClientDriverManager; -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClient; -import com.antgroup.openspg.cloudext.interfaces.objectstore.ObjectStoreClientDriverManager; import com.antgroup.openspg.cloudext.interfaces.searchengine.SearchEngineClient; import com.antgroup.openspg.cloudext.interfaces.searchengine.SearchEngineClientDriverManager; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClient; -import com.antgroup.openspg.cloudext.interfaces.tablestore.TableStoreClientDriverManager; import com.antgroup.openspg.server.common.model.datasource.DataSource; import com.antgroup.openspg.server.common.model.datasource.DataSourceUsageTypeEnum; import com.antgroup.openspg.server.common.model.datasource.connection.*; @@ -44,43 +36,9 @@ public interface DataSourceService { (GraphStoreConnectionInfo) graphStore.getConnectionInfo()); } - default ObjectStoreClient buildSharedOperatorStoreClient() { - DataSource objectStore = - getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.OPERATOR_STORE); - return ObjectStoreClientDriverManager.getClient( - (ObjectStoreConnectionInfo) objectStore.getConnectionInfo()); - } - - default ObjectStoreClient buildSharedFileStoreClient() { - DataSource objectStore = - getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.FILE_STORE); - return ObjectStoreClientDriverManager.getClient( - (ObjectStoreConnectionInfo) objectStore.getConnectionInfo()); - } - default SearchEngineClient buildSharedSearchEngineClient() { DataSource searchEngine = getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.SEARCH); return SearchEngineClientDriverManager.getClient( (SearchEngineConnectionInfo) searchEngine.getConnectionInfo()); } - - default JobSchedulerClient buildSharedJobSchedulerClient() { - DataSource scheduler = - getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.JOB_SCHEDULER); - return JobSchedulerClientDriverManager.getClient( - (JobSchedulerConnectionInfo) scheduler.getConnectionInfo()); - } - - default ComputingClient buildSharedComputingClient() { - DataSource computing = getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.COMPUTING); - return ComputingClientDriverManager.getClient( - (ComputingConnectionInfo) computing.getConnectionInfo()); - } - - default TableStoreClient buildSharedTableStoreClient() { - DataSource computing = - getFirstDataSource(SHARED_PROJECT_ID, DataSourceUsageTypeEnum.TABLE_STORE); - return TableStoreClientDriverManager.getClient( - (TableStoreConnectionInfo) computing.getConnectionInfo()); - } } diff --git a/server/core/reasoner/model/pom.xml b/server/core/reasoner/model/pom.xml deleted file mode 100644 index 5d74ea75..00000000 --- a/server/core/reasoner/model/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - core-reasoner-model - - - com.antgroup.openspg.server - common-model - - - diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/ReasonerException.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/ReasonerException.java deleted file mode 100644 index c47e7e25..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/ReasonerException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model; - -import com.antgroup.openspg.server.common.model.exception.OpenSPGException; - -public class ReasonerException extends OpenSPGException { - - private ReasonerException(Throwable cause, String messagePattern, Object... args) { - super(cause, true, true, messagePattern, args); - } - - private ReasonerException(String messagePattern, Object... args) { - this(null, messagePattern, args); - } - - public static ReasonerException reasonerError(Throwable e) { - return new ReasonerException(e, e.getMessage()); - } - - public static ReasonerException reasonerError(String errorMsg) { - return new ReasonerException(errorMsg); - } - - public static ReasonerException timeout(int minutes) { - return new ReasonerException( - "reasoner cannot finish in {} minutes, please submit reasoner job", minutes); - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerContent.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerContent.java deleted file mode 100644 index a4913117..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerContent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseToString; - -/** - * The base class of reasoning content, subclasses can inherit this base class to enrich the - * information under different reasoning content types - */ -public abstract class BaseReasonerContent extends BaseToString { - - /** reasoning content types */ - private final ReasonerContentTypeEnum paramType; - - public BaseReasonerContent(ReasonerContentTypeEnum paramType) { - this.paramType = paramType; - } - - public ReasonerContentTypeEnum getParamType() { - return paramType; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerReceipt.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerReceipt.java deleted file mode 100644 index 0a0cbb07..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerReceipt.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseToString; - -/** - * Base class for reasoning receipts. - * - *

Contains the reasoning mode and the reasoning receipt type for the current reasoning instance - */ -public abstract class BaseReasonerReceipt extends BaseToString { - - /** the reasoning receipt type */ - private final ReasonerReceiptTypeEnum receiptType; - - public BaseReasonerReceipt(ReasonerReceiptTypeEnum receiptType) { - this.receiptType = receiptType; - } - - public ReasonerReceiptTypeEnum getReceiptType() { - return receiptType; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerResult.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerResult.java deleted file mode 100644 index 61ca5ea4..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/BaseReasonerResult.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.job.BaseJobRunResult; - -public class BaseReasonerResult extends BaseJobRunResult {} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/FailureReasonerResult.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/FailureReasonerResult.java deleted file mode 100644 index 58466107..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/FailureReasonerResult.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -public class FailureReasonerResult extends BaseReasonerResult { - - private final String errorMsg; - - public FailureReasonerResult(String errorMsg) { - this.errorMsg = errorMsg; - } - - public String getErrorMsg() { - return errorMsg; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/JobReasonerReceipt.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/JobReasonerReceipt.java deleted file mode 100644 index b4dc1a96..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/JobReasonerReceipt.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -public class JobReasonerReceipt extends BaseReasonerReceipt { - - private final Long reasonerJobInfoId; - - private final Long reasonerJobInstId; - - public JobReasonerReceipt(Long reasonerJobInfoId, Long reasonerJobInstId) { - super(ReasonerReceiptTypeEnum.JOB); - this.reasonerJobInfoId = reasonerJobInfoId; - this.reasonerJobInstId = reasonerJobInstId; - } - - public Long getReasonerJobInfoId() { - return reasonerJobInfoId; - } - - public Long getReasonerJobInstId() { - return reasonerJobInstId; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/KgdslReasonerContent.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/KgdslReasonerContent.java deleted file mode 100644 index 4697f77d..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/KgdslReasonerContent.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.core.reasoner.model.struct.StartingVertex; -import java.util.Collections; -import java.util.List; - -/** - * Reasoning based on KGDSL. This class contains a KGDSL script and possible starting vertices. When - * there is a starting vertex, the task starts from that starting point for reasoning. If there is - * no starting vertex, the task will trigger reasoning from a batch of vertices of the same type. - */ -public class KgdslReasonerContent extends BaseReasonerContent { - - /** A short reasoning script */ - private final String kgdsl; - - /** - * starting vertices for reasoning, may be empty. - * - *

If it is empty, it usually consumes more resources, it is recommended to run in cluster - * mode. - */ - private final List startingVertices; - - public KgdslReasonerContent(String kgdsl, List startingVertices) { - super(ReasonerContentTypeEnum.KGDSL); - this.kgdsl = kgdsl; - this.startingVertices = startingVertices; - } - - public String getKgdsl() { - return kgdsl; - } - - public List getStartingVertices() { - if (startingVertices == null) { - return Collections.emptyList(); - } - return startingVertices; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerContentTypeEnum.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerContentTypeEnum.java deleted file mode 100644 index 4cf50ada..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerContentTypeEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -/** - * This class defines the input content types of knowledge reasoning tasks. - * - *

In actual scenarios, knowledge reasoning can be based on vertices or edges (when there are - * attributes expressed by logical rules). In addition, the most direct reasoning method is to - * reason based on a piece of Kgdsl - */ -public enum ReasonerContentTypeEnum { - /** - * Vertex-based query or reasoning. The user passes in the id of a vertex. If some attributes of - * the vertex are defined by logical rules, the logical rules will be calculated first and then - * returned; If all the attributes of the vertex are defined by non-logical rules, the vertex’s - * attributes can be returned directly. - */ - VERTEX, - - /** - * KGDSL-based reasoning. The user passes in a piece of KGDSL, and the knowledge reasoning engine - * will run this piece of KGDSL based on the factual data to get the reasoning result. If this - * KGDSL refers to other KGDSL definitions, it will execute the dependent KGDSL first, and then - * run the current KGDSL like a Java method call; - */ - KGDSL, - ; -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInfo.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInfo.java deleted file mode 100644 index fc795678..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInfo.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseModel; -import com.antgroup.openspg.server.common.model.job.JobInfoStateEnum; -import java.util.HashMap; -import java.util.Map; - -public class ReasonerJobInfo extends BaseModel { - - private Long jobId; - - private final String jobName; - - private final Long projectId; - - private final BaseReasonerContent content; - - private final String cron; - - private final JobInfoStateEnum status; - - private String externalJobInfoId; - - private final Map params; - - public ReasonerJobInfo( - String jobName, - Long projectId, - BaseReasonerContent content, - String cron, - JobInfoStateEnum status, - Map params) { - this.jobName = jobName; - this.projectId = projectId; - this.content = content; - this.cron = cron; - this.status = status; - this.params = params == null ? new HashMap<>(5) : params; - } - - public Long getJobId() { - return jobId; - } - - public ReasonerJobInfo setJobId(Long jobId) { - this.jobId = jobId; - return this; - } - - public String getJobName() { - return jobName; - } - - public Long getProjectId() { - return projectId; - } - - public BaseReasonerContent getContent() { - return content; - } - - public String getCron() { - return cron; - } - - public JobInfoStateEnum getStatus() { - return status; - } - - public String getExternalJobInfoId() { - return externalJobInfoId; - } - - public ReasonerJobInfo setExternalJobInfoId(String externalJobInfoId) { - this.externalJobInfoId = externalJobInfoId; - return this; - } - - public Map getParams() { - return params; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInst.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInst.java deleted file mode 100644 index ea546607..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerJobInst.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseModel; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import java.util.Date; - -public class ReasonerJobInst extends BaseModel { - - private final Long jobId; - private final Long projectId; - private final Date startTime; - private final Date endTime; - private final String logInfo; - private ReasonerProgress progress; - private BaseReasonerResult result; - private Long jobInstId; - private JobInstStatusEnum status; - private String externalJobInstId; - - public ReasonerJobInst( - Long jobId, - Long projectId, - JobInstStatusEnum status, - BaseReasonerResult result, - Date startTime, - Date endTime, - ReasonerProgress progress, - String logInfo) { - this.jobId = jobId; - this.projectId = projectId; - this.status = status; - this.startTime = startTime; - this.endTime = endTime; - this.result = result; - this.progress = progress; - this.logInfo = logInfo; - } - - public boolean isFinished() { - return status.isFinished(); - } - - public boolean isRunning() { - return status.isRunning(); - } - - public Long getJobInstId() { - return jobInstId; - } - - public ReasonerJobInst setJobInstId(Long jobInstId) { - this.jobInstId = jobInstId; - return this; - } - - public Long getJobId() { - return jobId; - } - - public Long getProjectId() { - return projectId; - } - - public JobInstStatusEnum getStatus() { - return status; - } - - public void setProgress(ReasonerStatusWithProgress progress) { - this.status = progress.getStatus(); - this.result = progress.getResult(); - this.progress = progress.getProgress(); - } - - public Date getStartTime() { - return startTime; - } - - public Date getEndTime() { - return endTime; - } - - public BaseReasonerResult getResult() { - return result; - } - - public ReasonerProgress getProgress() { - return progress; - } - - public String getLogInfo() { - return logInfo; - } - - public String getExternalJobInstId() { - return externalJobInstId; - } - - public ReasonerJobInst setExternalJobInstId(String externalJobInstId) { - this.externalJobInstId = externalJobInstId; - return this; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerProgress.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerProgress.java deleted file mode 100644 index d151dd22..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerProgress.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; - -public class ReasonerProgress extends BaseValObj {} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerReceiptTypeEnum.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerReceiptTypeEnum.java deleted file mode 100644 index c39384cb..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerReceiptTypeEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -/** - * The type of receipt returned by the knowledge reasoning engine. - * - *

Different reasoning modes produce different reasoning receipts. When reasoning locally, the - * reasoning receipt is the reasoning result, which is usually expressed in the form of a table; in - * remote cluster reasoning, the reasoning receipt may be a UUID, used for front-end continuous - * polling to obtain reasoning results - */ -public enum ReasonerReceiptTypeEnum { - /** - * When the reasoning engine finally executes a segment of KGDSL, the result is carried in a table - * data structure; - */ - TABLE, - - /** - * However, when a reasoning task is sent to a remote cluster, the reasoning result returned by - * the inference service to the front-end may temporarily be a UUID, and the front-end will then - * obtain the real reasoning result from the reasoning service with the UUID, that is, a table - */ - JOB, - ; -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerStatusWithProgress.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerStatusWithProgress.java deleted file mode 100644 index 4673d4ad..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/ReasonerStatusWithProgress.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.common.model.base.BaseValObj; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; - -public class ReasonerStatusWithProgress extends BaseValObj { - - private final JobInstStatusEnum status; - - private final BaseReasonerResult result; - - private final ReasonerProgress progress; - - public ReasonerStatusWithProgress(JobInstStatusEnum status) { - this(status, null, null); - } - - public ReasonerStatusWithProgress( - JobInstStatusEnum status, BaseReasonerResult result, ReasonerProgress progress) { - this.status = status; - this.result = result; - this.progress = progress; - } - - public JobInstStatusEnum getStatus() { - return status; - } - - public BaseReasonerResult getResult() { - return result; - } - - public ReasonerProgress getProgress() { - return progress; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/SuccessReasonerResult.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/SuccessReasonerResult.java deleted file mode 100644 index 72843665..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/SuccessReasonerResult.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -public class SuccessReasonerResult extends BaseReasonerResult { - - private final String tableName; - - public SuccessReasonerResult(String resultTableName) { - this.tableName = resultTableName; - } - - public String getTableName() { - return tableName; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/TableReasonerReceipt.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/TableReasonerReceipt.java deleted file mode 100644 index 97ec378d..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/TableReasonerReceipt.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import java.util.List; - -public class TableReasonerReceipt extends BaseReasonerReceipt { - - // todo TableLpgRecordStruct - private final List columns; - - private final List> cells; - - public TableReasonerReceipt(List columns, List> cells) { - super(ReasonerReceiptTypeEnum.TABLE); - this.columns = columns; - this.cells = cells; - } - - public List getColumns() { - return columns; - } - - public List> getCells() { - return cells; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/VertexReasonerContent.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/VertexReasonerContent.java deleted file mode 100644 index 789ef2cf..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/service/VertexReasonerContent.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.service; - -import com.antgroup.openspg.server.core.reasoner.model.struct.StartingVertex; -import java.util.List; - -/** - * Query or reason about the vertices passed in. - * - *

When the attribute of a vertex is defined by non-logical rules, we call this attribute fact - * data, when the attribute of a vertex is defined by logical rules, we call this attribute data - * defined by derived rules. - * - *

When a vertex is passed in, we will perform reasoning calculations on the attributes defined - * by its logical rules, and query the attributes defined by its non-logical rules, and finally - * return them together - */ -public class VertexReasonerContent extends BaseReasonerContent { - - /** the vertices to reason about */ - private final List startingVertices; - - public VertexReasonerContent(List startingVertices) { - super(ReasonerContentTypeEnum.VERTEX); - this.startingVertices = startingVertices; - } - - public List getStartingVertices() { - return startingVertices; - } -} diff --git a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/struct/StartingVertex.java b/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/struct/StartingVertex.java deleted file mode 100644 index e8b59d0b..00000000 --- a/server/core/reasoner/model/src/main/java/com/antgroup/openspg/server/core/reasoner/model/struct/StartingVertex.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.model.struct; - -import com.antgroup.openspg.server.common.model.base.BaseToString; -import java.util.Set; - -public class StartingVertex extends BaseToString { - - private String typeName; - - private Set bizIds; - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public Set getBizIds() { - return bizIds; - } - - public void setBizIds(Set bizIds) { - this.bizIds = bizIds; - } -} diff --git a/server/core/reasoner/service/pom.xml b/server/core/reasoner/service/pom.xml deleted file mode 100644 index 3b86f0bb..00000000 --- a/server/core/reasoner/service/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - 4.0.0 - - com.antgroup.openspg.server - server-parent - 0.0.1-SNAPSHOT - ../../../pom.xml - - - core-reasoner-service - - - com.antgroup.openspg.server - common-service - - - com.antgroup.openspg.server - api-http-client - - - com.antgroup.openspg.server - core-reasoner-model - - - com.antgroup.openspg.server - cloudext-interface-job-scheduler - - - com.antgroup.kg.reasoner - local - ${kgreasoner-version} - system - ${project.basedir}/../../../lib/spgreasoner-local-0.0.1.jar - - - org.scala-lang - scala-compiler - - - org.scala-lang - scala-reflect - - - org.scala-lang - scala-library - - - org.springframework - spring-context - - - diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInfoService.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInfoService.java deleted file mode 100644 index 734af51a..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInfoService.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service; - -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInfoQuery; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import java.util.List; - -public interface ReasonerJobInfoService { - - Long create(ReasonerJobInfo reasonerJobInfo); - - ReasonerJobInfo queryById(Long jobId); - - List query(ReasonerJobInfoQuery query); -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInstService.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInstService.java deleted file mode 100644 index 686a7981..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/ReasonerJobInstService.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import java.util.List; - -public interface ReasonerJobInstService { - - Long create(ReasonerJobInfo reasonerJobInfo, ReasonerJobInst reasonerJobInst); - - List query(ReasonerJobInstQuery query); - - /* ----------------------- * - | For Scheduler | - * ----------------------- */ - - /** - * Triggered by the scheduling system to poll the status of the reasoner job, the main process - * includes: - * - *

1. If the job is in the final state, return directly; 2. If the job is running, query the - * computing pool to determine whether the task is completed; 3. If the job is in waiting state, - * try to submit the task; - * - * @param jobInst scheduling job instance - * @return reasoner job instance - */ - ReasonerJobInst pollingReasonerJob(SchedulerJobInst jobInst); - - ReasonerJobInst queryByExternalJobInstId(String externalJobInstId); - - int updateToFailure(Long jobInstId, FailureReasonerResult result); -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInfoServiceImpl.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInfoServiceImpl.java deleted file mode 100644 index cdd237ee..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInfoServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.impl; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClient; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInfoQuery; -import com.antgroup.openspg.server.common.service.datasource.DataSourceService; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInfoService; -import com.antgroup.openspg.server.core.reasoner.service.repo.ReasonerJobInfoRepository; -import java.util.List; -import org.apache.commons.collections4.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ReasonerJobInfoServiceImpl implements ReasonerJobInfoService { - - @Autowired private DataSourceService dataSourceService; - - @Autowired private ReasonerJobInfoRepository reasonerJobInfoRepository; - - @Override - public Long create(ReasonerJobInfo reasonerJobInfo) { - JobSchedulerClient jobSchedulerClient = dataSourceService.buildSharedJobSchedulerClient(); - Long reasonerJobInfoId = reasonerJobInfoRepository.save(reasonerJobInfo); - - SchedulerJobInfo schedulerJobInfo = - new SchedulerJobInfo( - null, - reasonerJobInfo.getJobName(), - JobTypeEnum.REASONING.name(), - reasonerJobInfo.getCron(), - reasonerJobInfo.getStatus(), - String.valueOf(reasonerJobInfoId)); - String schedulerJobInfoId = jobSchedulerClient.createJobInfo(schedulerJobInfo); - - reasonerJobInfo.setExternalJobInfoId(schedulerJobInfoId); - reasonerJobInfoRepository.updateExternalJobId(reasonerJobInfoId, schedulerJobInfoId); - return reasonerJobInfoId; - } - - @Override - public ReasonerJobInfo queryById(Long jobId) { - List reasonerJobInfos = - query(new ReasonerJobInfoQuery().setReasonerJobInfoId(jobId)); - if (CollectionUtils.isNotEmpty(reasonerJobInfos)) { - return reasonerJobInfos.get(0); - } - return null; - } - - @Override - public List query(ReasonerJobInfoQuery query) { - return reasonerJobInfoRepository.query(query); - } -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInstServiceImpl.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInstServiceImpl.java deleted file mode 100644 index 9cc8b4a2..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerJobInstServiceImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.impl; - -import com.antgroup.openspg.cloudext.interfaces.computing.ComputingClient; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobCanSubmitQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobProcessQuery; -import com.antgroup.openspg.cloudext.interfaces.computing.cmd.ReasonerJobSubmitCmd; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.JobSchedulerClient; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.datasource.connection.TableStoreConnectionInfo; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.common.service.config.AppEnvConfig; -import com.antgroup.openspg.server.common.service.datasource.DataSourceService; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInfoService; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInstService; -import com.antgroup.openspg.server.core.reasoner.service.repo.ReasonerJobInstRepository; -import java.util.HashMap; -import java.util.List; -import org.apache.commons.collections4.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ReasonerJobInstServiceImpl implements ReasonerJobInstService { - - @Autowired private AppEnvConfig appEnvConfig; - - @Autowired private ReasonerJobInstRepository reasonerJobInstRepository; - - @Autowired private DataSourceService dataSourceService; - - @Autowired private ReasonerJobInfoService reasonerJobInfoService; - - @Override - public Long create(ReasonerJobInfo reasonerJobInfo, ReasonerJobInst reasonerJobInst) { - JobSchedulerClient jobSchedulerClient = dataSourceService.buildSharedJobSchedulerClient(); - Long buildingJobInstId = reasonerJobInstRepository.save(reasonerJobInst); - - SchedulerJobInst schedulerJobInst = - new SchedulerJobInst( - null, - reasonerJobInfo.getExternalJobInfoId(), - JobTypeEnum.REASONING.name(), - reasonerJobInst.getStatus(), - null, - String.valueOf(buildingJobInstId)); - String schedulerJobInstId = jobSchedulerClient.createJobInst(schedulerJobInst); - - reasonerJobInst.setExternalJobInstId(schedulerJobInstId); - reasonerJobInstRepository.updateExternalJobId(buildingJobInstId, schedulerJobInstId); - return buildingJobInstId; - } - - @Override - public List query(ReasonerJobInstQuery query) { - return reasonerJobInstRepository.query(query); - } - - @Override - public ReasonerJobInst pollingReasonerJob(SchedulerJobInst jobInst) { - ComputingClient computingClient = dataSourceService.buildSharedComputingClient(); - - ReasonerJobInst reasonerJobInst = queryByExternalJobInstId(jobInst.getJobInstId()); - if (reasonerJobInst.isFinished()) { - return reasonerJobInst; - } else if (reasonerJobInst.isRunning()) { - ReasonerStatusWithProgress progress = - computingClient.query( - new ReasonerJobProcessQuery(String.valueOf(reasonerJobInst.getJobInstId()))); - if (progress == null) { - // if status is null, rerun it - progress = new ReasonerStatusWithProgress(JobInstStatusEnum.QUEUE); - reasonerJobInst.setProgress(progress); - reasonerJobInstRepository.updateStatus(reasonerJobInst.getJobInstId(), progress); - return reasonerJobInst; - } else if (progress.getStatus().isRunning()) { - reasonerJobInstRepository.updateStatus(reasonerJobInst.getJobInstId(), progress); - return reasonerJobInst; - } else if (progress.getStatus().isFinished()) { - reasonerJobInst.setProgress(progress); - reasonerJobInstRepository.updateStatus(reasonerJobInst.getJobInstId(), progress); - return reasonerJobInst; - } - } - - // The task is not in finished or running status, try to submit the task - if (!computingClient.canSubmit(new ReasonerJobCanSubmitQuery())) { - return reasonerJobInst; - } - - ReasonerJobInfo reasonerJobInfo = reasonerJobInfoService.queryById(reasonerJobInst.getJobId()); - String submit = - computingClient.submit( - new ReasonerJobSubmitCmd( - reasonerJobInst, - reasonerJobInfo, - (GraphStoreConnectionInfo) - dataSourceService.buildSharedKgStoreClient().getConnInfo(), - (TableStoreConnectionInfo) - dataSourceService.buildSharedTableStoreClient().getConnInfo(), - appEnvConfig.getSchemaUri(), - new HashMap<>(5))); - if (submit != null) { - // The task is submitted successfully and the task is set to running status. - ReasonerStatusWithProgress progress = - new ReasonerStatusWithProgress(JobInstStatusEnum.RUNNING, null, null); - reasonerJobInstRepository.updateStatus(reasonerJobInst.getJobInstId(), progress); - return reasonerJobInst; - } - return reasonerJobInst; - } - - @Override - public ReasonerJobInst queryByExternalJobInstId(String externalJobInstId) { - ReasonerJobInstQuery query = new ReasonerJobInstQuery().setExternalJobInstId(externalJobInstId); - List jobInsts = reasonerJobInstRepository.query(query); - return CollectionUtils.isNotEmpty(jobInsts) ? jobInsts.get(0) : null; - } - - @Override - public int updateToFailure(Long jobInstId, FailureReasonerResult result) { - return reasonerJobInstRepository.updateToFailure(jobInstId, result); - } -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerSchedulerCallback.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerSchedulerCallback.java deleted file mode 100644 index 385b4d38..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/impl/ReasonerSchedulerCallback.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.impl; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.SchedulerCallback; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.CallbackResult; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.service.ReasonerJobInstService; -import com.google.common.collect.Sets; -import java.util.Set; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Slf4j -@Service -public class ReasonerSchedulerCallback implements SchedulerCallback { - - @Autowired private ReasonerJobInstService reasonerJobInstService; - - @Override - public Set accept() { - return Sets.newHashSet(JobTypeEnum.REASONING); - } - - @Override - public CallbackResult polling(SchedulerJobInst jobInst) { - ReasonerJobInst reasonerJobInst = null; - try { - reasonerJobInst = reasonerJobInstService.pollingReasonerJob(jobInst); - } catch (Throwable e) { - log.warn("polling schedulerJobInstId={} for reasoner error", jobInst.getJobInstId(), e); - reasonerJobInst = reasonerJobInstService.queryByExternalJobInstId(jobInst.getJobInstId()); - FailureReasonerResult result = new FailureReasonerResult(e.getMessage()); - if (reasonerJobInst != null) { - reasonerJobInstService.updateToFailure(reasonerJobInst.getJobInstId(), result); - } - return new CallbackResult(JobInstStatusEnum.FAILURE, result); - } - return new CallbackResult(reasonerJobInst.getStatus(), reasonerJobInst.getResult()); - } -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInfoRepository.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInfoRepository.java deleted file mode 100644 index 83bdb527..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInfoRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.repo; - -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInfoQuery; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import java.util.List; - -public interface ReasonerJobInfoRepository { - - Long save(ReasonerJobInfo jobInfo); - - int updateExternalJobId(Long reasonerJobInfoId, String externalJobInfoId); - - List query(ReasonerJobInfoQuery query); -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInstRepository.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInstRepository.java deleted file mode 100644 index 058c0ef2..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/repo/ReasonerJobInstRepository.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.repo; - -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import java.util.List; - -public interface ReasonerJobInstRepository { - - Long save(ReasonerJobInst jobInst); - - int updateExternalJobId(Long reasonerJobInstId, String externalJobInstId); - - List query(ReasonerJobInstQuery query); - - int updateStatus(Long jobInstId, ReasonerStatusWithProgress process); - - int updateToFailure(Long jobInstId, FailureReasonerResult result); -} diff --git a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/util/LocalRunnerUtils.java b/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/util/LocalRunnerUtils.java deleted file mode 100644 index 6ce6b47b..00000000 --- a/server/core/reasoner/service/src/main/java/com/antgroup/openspg/server/core/reasoner/service/util/LocalRunnerUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.core.reasoner.service.util; - -import com.antgroup.kg.reasoner.catalog.impl.KgSchemaConnectionInfo; -import com.antgroup.kg.reasoner.catalog.impl.OpenKgCatalog; -import com.antgroup.kg.reasoner.common.graph.vertex.IVertexId; -import com.antgroup.kg.reasoner.graphstate.GraphState; -import com.antgroup.kg.reasoner.graphstate.impl.CloudExtGraphState; -import com.antgroup.kg.reasoner.lube.catalog.Catalog; -import com.antgroup.openspg.server.common.model.datasource.connection.GraphStoreConnectionInfo; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings({"unchecked", "rawtypes"}) -public class LocalRunnerUtils { - - public static Catalog buildCatalog(Long projectId, KgSchemaConnectionInfo connInfo) { - Catalog catalog = new OpenKgCatalog(projectId, connInfo, null); - catalog.init(); - return catalog; - } - - public static GraphState buildGraphState(GraphStoreConnectionInfo connInfo) { - CloudExtGraphState cloudExtGraphState = new CloudExtGraphState(); - - Map params = new HashMap<>(); - params.put("cloudext.graphstore.schema", connInfo.getScheme()); - params.putAll(connInfo.getParams()); - cloudExtGraphState.init((Map) Collections.unmodifiableMap(params)); - return cloudExtGraphState; - } -} diff --git a/server/core/schema/service/pom.xml b/server/core/schema/service/pom.xml index ab64766a..69948358 100644 --- a/server/core/schema/service/pom.xml +++ b/server/core/schema/service/pom.xml @@ -24,6 +24,10 @@ core-schema-service + + com.antgroup.openspg.reasoner + reasoner-local-runner + com.antgroup.openspg.server core-schema-model @@ -36,33 +40,10 @@ com.antgroup.openspg.cloudext cloudext-impl-graph-store-tugraph - - com.antgroup.openspg.cloudext - cloudext-impl-object-store-local - - - com.antgroup.openspg.cloudext - cloudext-impl-table-store-local - com.antgroup.openspg.cloudext cloudext-impl-search-engine-elasticsearch - - com.antgroup.openspg.server - cloudext-impl-job-scheduler-local - - - com.antgroup.openspg.server - cloudext-impl-computing-local - - - com.antgroup.kg.reasoner - local - ${kgreasoner-version} - system - ${project.basedir}/../../../lib/spgreasoner-local-0.0.1.jar - org.scala-lang scala-library diff --git a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/PropertyChecker.java b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/PropertyChecker.java index fcd6ed90..613aa790 100644 --- a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/PropertyChecker.java +++ b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/PropertyChecker.java @@ -13,13 +13,6 @@ package com.antgroup.openspg.server.core.schema.service.alter.check; -import com.antgroup.kg.reasoner.catalog.impl.OpenKgCatalog; -import com.antgroup.kg.reasoner.lube.block.Block; -import com.antgroup.kg.reasoner.lube.catalog.Catalog; -import com.antgroup.kg.reasoner.lube.logical.planning.LogicalPlannerContext; -import com.antgroup.kg.reasoner.lube.logical.validate.Validator; -import com.antgroup.kg.reasoner.lube.parser.ParserInterface; -import com.antgroup.kg.reasoner.parser.KgDslParser; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.DslSyntaxError; import com.antgroup.openspg.core.schema.model.SchemaConstants; @@ -28,6 +21,13 @@ import com.antgroup.openspg.core.schema.model.identifier.SPGTypeIdentifier; import com.antgroup.openspg.core.schema.model.predicate.Property; import com.antgroup.openspg.core.schema.model.type.*; import com.antgroup.openspg.core.schema.model.type.BasicType.TextBasicType; +import com.antgroup.openspg.reasoner.catalog.impl.OpenSPGCatalog; +import com.antgroup.openspg.reasoner.lube.block.Block; +import com.antgroup.openspg.reasoner.lube.catalog.Catalog; +import com.antgroup.openspg.reasoner.lube.logical.planning.LogicalPlannerContext; +import com.antgroup.openspg.reasoner.lube.logical.validate.Validator; +import com.antgroup.openspg.reasoner.lube.parser.ParserInterface; +import com.antgroup.openspg.reasoner.parser.KgDslParser; import com.antgroup.openspg.server.core.schema.service.type.model.BuiltInPropertyEnum; import java.util.*; import java.util.regex.Pattern; @@ -165,7 +165,7 @@ public class PropertyChecker { protected Catalog buildCatalog(SchemaCheckContext context) { List spgTypes = context.getMergedSchema(); ProjectSchema projectSchema = new ProjectSchema(spgTypes); - Catalog catalog = new OpenKgCatalog(context.getProjectId(), null, projectSchema); + Catalog catalog = new OpenSPGCatalog(context.getProjectId(), null, projectSchema); catalog.init(); return catalog; } diff --git a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/RelationChecker.java b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/RelationChecker.java index bebdda57..9b397620 100644 --- a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/RelationChecker.java +++ b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/alter/check/RelationChecker.java @@ -13,11 +13,11 @@ package com.antgroup.openspg.server.core.schema.service.alter.check; -import com.antgroup.kg.reasoner.lube.catalog.Catalog; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.identifier.SPGTypeIdentifier; import com.antgroup.openspg.core.schema.model.predicate.Relation; import com.antgroup.openspg.core.schema.model.type.BaseAdvancedType; +import com.antgroup.openspg.reasoner.lube.catalog.Catalog; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/semantic/impl/LogicalRuleServiceImpl.java b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/semantic/impl/LogicalRuleServiceImpl.java index 487e5c1e..e1bc886a 100644 --- a/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/semantic/impl/LogicalRuleServiceImpl.java +++ b/server/core/schema/service/src/main/java/com/antgroup/openspg/server/core/schema/service/semantic/impl/LogicalRuleServiceImpl.java @@ -13,12 +13,12 @@ package com.antgroup.openspg.server.core.schema.service.semantic.impl; -import com.antgroup.kg.reasoner.lube.parser.ParserInterface; -import com.antgroup.kg.reasoner.parser.KgDslParser; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.DslSyntaxError; import com.antgroup.openspg.core.schema.model.semantic.LogicalRule; import com.antgroup.openspg.core.schema.model.semantic.RuleCode; +import com.antgroup.openspg.reasoner.lube.parser.ParserInterface; +import com.antgroup.openspg.reasoner.parser.KgDslParser; import com.antgroup.openspg.server.core.schema.service.semantic.LogicalRuleService; import com.antgroup.openspg.server.core.schema.service.semantic.model.DslCheckResult; import com.antgroup.openspg.server.core.schema.service.semantic.repository.LogicalRuleRepository; diff --git a/server/infra/dao/pom.xml b/server/infra/dao/pom.xml index 0645d8b5..466791a8 100644 --- a/server/infra/dao/pom.xml +++ b/server/infra/dao/pom.xml @@ -36,14 +36,6 @@ com.antgroup.openspg.server common-service - - com.antgroup.openspg.server - core-reasoner-service - - - com.antgroup.openspg.server - cloudext-impl-job-scheduler-local - org.springframework spring-context diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDO.java deleted file mode 100644 index a8e672e2..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDO.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class JobInfoDO { - private Long id; - - private Date gmtCreate; - - private Date gmtModified; - - private String name; - - private String type; - - private String cron; - - private String status; - - private String idempotentId; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getCron() { - return cron; - } - - public void setCron(String cron) { - this.cron = cron == null ? null : cron.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getIdempotentId() { - return idempotentId; - } - - public void setIdempotentId(String idempotentId) { - this.idempotentId = idempotentId == null ? null : idempotentId.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDOExample.java deleted file mode 100644 index d0f0ca59..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInfoDOExample.java +++ /dev/null @@ -1,744 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class JobInfoDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public JobInfoDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andCronIsNull() { - addCriterion("cron is null"); - return (Criteria) this; - } - - public Criteria andCronIsNotNull() { - addCriterion("cron is not null"); - return (Criteria) this; - } - - public Criteria andCronEqualTo(String value) { - addCriterion("cron =", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotEqualTo(String value) { - addCriterion("cron <>", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronGreaterThan(String value) { - addCriterion("cron >", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronGreaterThanOrEqualTo(String value) { - addCriterion("cron >=", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLessThan(String value) { - addCriterion("cron <", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLessThanOrEqualTo(String value) { - addCriterion("cron <=", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLike(String value) { - addCriterion("cron like", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotLike(String value) { - addCriterion("cron not like", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronIn(List values) { - addCriterion("cron in", values, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotIn(List values) { - addCriterion("cron not in", values, "cron"); - return (Criteria) this; - } - - public Criteria andCronBetween(String value1, String value2) { - addCriterion("cron between", value1, value2, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotBetween(String value1, String value2) { - addCriterion("cron not between", value1, value2, "cron"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIsNull() { - addCriterion("idempotent_id is null"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIsNotNull() { - addCriterion("idempotent_id is not null"); - return (Criteria) this; - } - - public Criteria andIdempotentIdEqualTo(String value) { - addCriterion("idempotent_id =", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotEqualTo(String value) { - addCriterion("idempotent_id <>", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdGreaterThan(String value) { - addCriterion("idempotent_id >", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdGreaterThanOrEqualTo(String value) { - addCriterion("idempotent_id >=", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLessThan(String value) { - addCriterion("idempotent_id <", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLessThanOrEqualTo(String value) { - addCriterion("idempotent_id <=", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLike(String value) { - addCriterion("idempotent_id like", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotLike(String value) { - addCriterion("idempotent_id not like", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIn(List values) { - addCriterion("idempotent_id in", values, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotIn(List values) { - addCriterion("idempotent_id not in", values, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdBetween(String value1, String value2) { - addCriterion("idempotent_id between", value1, value2, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotBetween(String value1, String value2) { - addCriterion("idempotent_id not between", value1, value2, "idempotentId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDO.java deleted file mode 100644 index 5ec81b15..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDO.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class JobInstDO { - private Long id; - - private Date gmtCreate; - - private Date gmtModified; - - private Long jobId; - - private String type; - - private String status; - - private String host; - - private String traceId; - - private String idempotentId; - - private String result; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public Long getJobId() { - return jobId; - } - - public void setJobId(Long jobId) { - this.jobId = jobId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host == null ? null : host.trim(); - } - - public String getTraceId() { - return traceId; - } - - public void setTraceId(String traceId) { - this.traceId = traceId == null ? null : traceId.trim(); - } - - public String getIdempotentId() { - return idempotentId; - } - - public void setIdempotentId(String idempotentId) { - this.idempotentId = idempotentId == null ? null : idempotentId.trim(); - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result == null ? null : result.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDOExample.java deleted file mode 100644 index f6806aab..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/JobInstDOExample.java +++ /dev/null @@ -1,804 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class JobInstDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public JobInstDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andJobIdIsNull() { - addCriterion("job_id is null"); - return (Criteria) this; - } - - public Criteria andJobIdIsNotNull() { - addCriterion("job_id is not null"); - return (Criteria) this; - } - - public Criteria andJobIdEqualTo(Long value) { - addCriterion("job_id =", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotEqualTo(Long value) { - addCriterion("job_id <>", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdGreaterThan(Long value) { - addCriterion("job_id >", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdGreaterThanOrEqualTo(Long value) { - addCriterion("job_id >=", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdLessThan(Long value) { - addCriterion("job_id <", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdLessThanOrEqualTo(Long value) { - addCriterion("job_id <=", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdIn(List values) { - addCriterion("job_id in", values, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotIn(List values) { - addCriterion("job_id not in", values, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdBetween(Long value1, Long value2) { - addCriterion("job_id between", value1, value2, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotBetween(Long value1, Long value2) { - addCriterion("job_id not between", value1, value2, "jobId"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andHostIsNull() { - addCriterion("host is null"); - return (Criteria) this; - } - - public Criteria andHostIsNotNull() { - addCriterion("host is not null"); - return (Criteria) this; - } - - public Criteria andHostEqualTo(String value) { - addCriterion("host =", value, "host"); - return (Criteria) this; - } - - public Criteria andHostNotEqualTo(String value) { - addCriterion("host <>", value, "host"); - return (Criteria) this; - } - - public Criteria andHostGreaterThan(String value) { - addCriterion("host >", value, "host"); - return (Criteria) this; - } - - public Criteria andHostGreaterThanOrEqualTo(String value) { - addCriterion("host >=", value, "host"); - return (Criteria) this; - } - - public Criteria andHostLessThan(String value) { - addCriterion("host <", value, "host"); - return (Criteria) this; - } - - public Criteria andHostLessThanOrEqualTo(String value) { - addCriterion("host <=", value, "host"); - return (Criteria) this; - } - - public Criteria andHostLike(String value) { - addCriterion("host like", value, "host"); - return (Criteria) this; - } - - public Criteria andHostNotLike(String value) { - addCriterion("host not like", value, "host"); - return (Criteria) this; - } - - public Criteria andHostIn(List values) { - addCriterion("host in", values, "host"); - return (Criteria) this; - } - - public Criteria andHostNotIn(List values) { - addCriterion("host not in", values, "host"); - return (Criteria) this; - } - - public Criteria andHostBetween(String value1, String value2) { - addCriterion("host between", value1, value2, "host"); - return (Criteria) this; - } - - public Criteria andHostNotBetween(String value1, String value2) { - addCriterion("host not between", value1, value2, "host"); - return (Criteria) this; - } - - public Criteria andTraceIdIsNull() { - addCriterion("trace_id is null"); - return (Criteria) this; - } - - public Criteria andTraceIdIsNotNull() { - addCriterion("trace_id is not null"); - return (Criteria) this; - } - - public Criteria andTraceIdEqualTo(String value) { - addCriterion("trace_id =", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdNotEqualTo(String value) { - addCriterion("trace_id <>", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdGreaterThan(String value) { - addCriterion("trace_id >", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdGreaterThanOrEqualTo(String value) { - addCriterion("trace_id >=", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdLessThan(String value) { - addCriterion("trace_id <", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdLessThanOrEqualTo(String value) { - addCriterion("trace_id <=", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdLike(String value) { - addCriterion("trace_id like", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdNotLike(String value) { - addCriterion("trace_id not like", value, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdIn(List values) { - addCriterion("trace_id in", values, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdNotIn(List values) { - addCriterion("trace_id not in", values, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdBetween(String value1, String value2) { - addCriterion("trace_id between", value1, value2, "traceId"); - return (Criteria) this; - } - - public Criteria andTraceIdNotBetween(String value1, String value2) { - addCriterion("trace_id not between", value1, value2, "traceId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIsNull() { - addCriterion("idempotent_id is null"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIsNotNull() { - addCriterion("idempotent_id is not null"); - return (Criteria) this; - } - - public Criteria andIdempotentIdEqualTo(String value) { - addCriterion("idempotent_id =", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotEqualTo(String value) { - addCriterion("idempotent_id <>", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdGreaterThan(String value) { - addCriterion("idempotent_id >", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdGreaterThanOrEqualTo(String value) { - addCriterion("idempotent_id >=", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLessThan(String value) { - addCriterion("idempotent_id <", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLessThanOrEqualTo(String value) { - addCriterion("idempotent_id <=", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdLike(String value) { - addCriterion("idempotent_id like", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotLike(String value) { - addCriterion("idempotent_id not like", value, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdIn(List values) { - addCriterion("idempotent_id in", values, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotIn(List values) { - addCriterion("idempotent_id not in", values, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdBetween(String value1, String value2) { - addCriterion("idempotent_id between", value1, value2, "idempotentId"); - return (Criteria) this; - } - - public Criteria andIdempotentIdNotBetween(String value1, String value2) { - addCriterion("idempotent_id not between", value1, value2, "idempotentId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDO.java deleted file mode 100644 index 806c73d7..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDO.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class OperatorOverviewDO { - private Long id; - - private String name; - - private String type; - - private Date gmtCreate; - - private Date gmtModified; - - private String description; - - private String lang; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getLang() { - return lang; - } - - public void setLang(String lang) { - this.lang = lang == null ? null : lang.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDOExample.java deleted file mode 100644 index df359e4e..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorOverviewDOExample.java +++ /dev/null @@ -1,674 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class OperatorOverviewDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public OperatorOverviewDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andLangIsNull() { - addCriterion("lang is null"); - return (Criteria) this; - } - - public Criteria andLangIsNotNull() { - addCriterion("lang is not null"); - return (Criteria) this; - } - - public Criteria andLangEqualTo(String value) { - addCriterion("lang =", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangNotEqualTo(String value) { - addCriterion("lang <>", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangGreaterThan(String value) { - addCriterion("lang >", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangGreaterThanOrEqualTo(String value) { - addCriterion("lang >=", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangLessThan(String value) { - addCriterion("lang <", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangLessThanOrEqualTo(String value) { - addCriterion("lang <=", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangLike(String value) { - addCriterion("lang like", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangNotLike(String value) { - addCriterion("lang not like", value, "lang"); - return (Criteria) this; - } - - public Criteria andLangIn(List values) { - addCriterion("lang in", values, "lang"); - return (Criteria) this; - } - - public Criteria andLangNotIn(List values) { - addCriterion("lang not in", values, "lang"); - return (Criteria) this; - } - - public Criteria andLangBetween(String value1, String value2) { - addCriterion("lang between", value1, value2, "lang"); - return (Criteria) this; - } - - public Criteria andLangNotBetween(String value1, String value2) { - addCriterion("lang not between", value1, value2, "lang"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDO.java deleted file mode 100644 index 1fbd6db1..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDO.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class OperatorVersionDO { - private Long id; - - private Long overviewId; - - private String mainClass; - - private String jarAddress; - - private Date gmtCreate; - - private Date gmtModified; - - private Integer version; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getOverviewId() { - return overviewId; - } - - public void setOverviewId(Long overviewId) { - this.overviewId = overviewId; - } - - public String getMainClass() { - return mainClass; - } - - public void setMainClass(String mainClass) { - this.mainClass = mainClass == null ? null : mainClass.trim(); - } - - public String getJarAddress() { - return jarAddress; - } - - public void setJarAddress(String jarAddress) { - this.jarAddress = jarAddress == null ? null : jarAddress.trim(); - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOExample.java deleted file mode 100644 index 88147ea6..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOExample.java +++ /dev/null @@ -1,654 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class OperatorVersionDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public OperatorVersionDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andOverviewIdIsNull() { - addCriterion("overview_id is null"); - return (Criteria) this; - } - - public Criteria andOverviewIdIsNotNull() { - addCriterion("overview_id is not null"); - return (Criteria) this; - } - - public Criteria andOverviewIdEqualTo(Long value) { - addCriterion("overview_id =", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdNotEqualTo(Long value) { - addCriterion("overview_id <>", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdGreaterThan(Long value) { - addCriterion("overview_id >", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdGreaterThanOrEqualTo(Long value) { - addCriterion("overview_id >=", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdLessThan(Long value) { - addCriterion("overview_id <", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdLessThanOrEqualTo(Long value) { - addCriterion("overview_id <=", value, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdIn(List values) { - addCriterion("overview_id in", values, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdNotIn(List values) { - addCriterion("overview_id not in", values, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdBetween(Long value1, Long value2) { - addCriterion("overview_id between", value1, value2, "overviewId"); - return (Criteria) this; - } - - public Criteria andOverviewIdNotBetween(Long value1, Long value2) { - addCriterion("overview_id not between", value1, value2, "overviewId"); - return (Criteria) this; - } - - public Criteria andMainClassIsNull() { - addCriterion("main_class is null"); - return (Criteria) this; - } - - public Criteria andMainClassIsNotNull() { - addCriterion("main_class is not null"); - return (Criteria) this; - } - - public Criteria andMainClassEqualTo(String value) { - addCriterion("main_class =", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassNotEqualTo(String value) { - addCriterion("main_class <>", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassGreaterThan(String value) { - addCriterion("main_class >", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassGreaterThanOrEqualTo(String value) { - addCriterion("main_class >=", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassLessThan(String value) { - addCriterion("main_class <", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassLessThanOrEqualTo(String value) { - addCriterion("main_class <=", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassLike(String value) { - addCriterion("main_class like", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassNotLike(String value) { - addCriterion("main_class not like", value, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassIn(List values) { - addCriterion("main_class in", values, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassNotIn(List values) { - addCriterion("main_class not in", values, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassBetween(String value1, String value2) { - addCriterion("main_class between", value1, value2, "mainClass"); - return (Criteria) this; - } - - public Criteria andMainClassNotBetween(String value1, String value2) { - addCriterion("main_class not between", value1, value2, "mainClass"); - return (Criteria) this; - } - - public Criteria andJarAddressIsNull() { - addCriterion("jar_address is null"); - return (Criteria) this; - } - - public Criteria andJarAddressIsNotNull() { - addCriterion("jar_address is not null"); - return (Criteria) this; - } - - public Criteria andJarAddressEqualTo(String value) { - addCriterion("jar_address =", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressNotEqualTo(String value) { - addCriterion("jar_address <>", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressGreaterThan(String value) { - addCriterion("jar_address >", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressGreaterThanOrEqualTo(String value) { - addCriterion("jar_address >=", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressLessThan(String value) { - addCriterion("jar_address <", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressLessThanOrEqualTo(String value) { - addCriterion("jar_address <=", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressLike(String value) { - addCriterion("jar_address like", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressNotLike(String value) { - addCriterion("jar_address not like", value, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressIn(List values) { - addCriterion("jar_address in", values, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressNotIn(List values) { - addCriterion("jar_address not in", values, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressBetween(String value1, String value2) { - addCriterion("jar_address between", value1, value2, "jarAddress"); - return (Criteria) this; - } - - public Criteria andJarAddressNotBetween(String value1, String value2) { - addCriterion("jar_address not between", value1, value2, "jarAddress"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andVersionIsNull() { - addCriterion("version is null"); - return (Criteria) this; - } - - public Criteria andVersionIsNotNull() { - addCriterion("version is not null"); - return (Criteria) this; - } - - public Criteria andVersionEqualTo(Integer value) { - addCriterion("version =", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotEqualTo(Integer value) { - addCriterion("version <>", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThan(Integer value) { - addCriterion("version >", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThanOrEqualTo(Integer value) { - addCriterion("version >=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThan(Integer value) { - addCriterion("version <", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThanOrEqualTo(Integer value) { - addCriterion("version <=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionIn(List values) { - addCriterion("version in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotIn(List values) { - addCriterion("version not in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionBetween(Integer value1, Integer value2) { - addCriterion("version between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotBetween(Integer value1, Integer value2) { - addCriterion("version not between", value1, value2, "version"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOWithBLOBs.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOWithBLOBs.java deleted file mode 100644 index c3d282ff..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/OperatorVersionDOWithBLOBs.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -public class OperatorVersionDOWithBLOBs extends OperatorVersionDO { - private String operatorConfig; - - private String config; - - public String getOperatorConfig() { - return operatorConfig; - } - - public void setOperatorConfig(String operatorConfig) { - this.operatorConfig = operatorConfig == null ? null : operatorConfig.trim(); - } - - public String getConfig() { - return config; - } - - public void setConfig(String config) { - this.config = config == null ? null : config.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDO.java deleted file mode 100644 index 00af3ea5..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDO.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class SPGJobInfoDO { - private Long id; - - private Date gmtCreate; - - private Date gmtModified; - - private String name; - - private String type; - - private Long projectId; - - private String cron; - - private String status; - - private String extInfo; - - private String externalJobInfoId; - - private String content; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getCron() { - return cron; - } - - public void setCron(String cron) { - this.cron = cron == null ? null : cron.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getExtInfo() { - return extInfo; - } - - public void setExtInfo(String extInfo) { - this.extInfo = extInfo == null ? null : extInfo.trim(); - } - - public String getExternalJobInfoId() { - return externalJobInfoId; - } - - public void setExternalJobInfoId(String externalJobInfoId) { - this.externalJobInfoId = externalJobInfoId == null ? null : externalJobInfoId.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDOExample.java deleted file mode 100644 index 990623cd..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInfoDOExample.java +++ /dev/null @@ -1,874 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class SPGJobInfoDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public SPGJobInfoDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNull() { - addCriterion("project_id is null"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNotNull() { - addCriterion("project_id is not null"); - return (Criteria) this; - } - - public Criteria andProjectIdEqualTo(Long value) { - addCriterion("project_id =", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotEqualTo(Long value) { - addCriterion("project_id <>", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThan(Long value) { - addCriterion("project_id >", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThanOrEqualTo(Long value) { - addCriterion("project_id >=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThan(Long value) { - addCriterion("project_id <", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThanOrEqualTo(Long value) { - addCriterion("project_id <=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdIn(List values) { - addCriterion("project_id in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotIn(List values) { - addCriterion("project_id not in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdBetween(Long value1, Long value2) { - addCriterion("project_id between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotBetween(Long value1, Long value2) { - addCriterion("project_id not between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andCronIsNull() { - addCriterion("cron is null"); - return (Criteria) this; - } - - public Criteria andCronIsNotNull() { - addCriterion("cron is not null"); - return (Criteria) this; - } - - public Criteria andCronEqualTo(String value) { - addCriterion("cron =", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotEqualTo(String value) { - addCriterion("cron <>", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronGreaterThan(String value) { - addCriterion("cron >", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronGreaterThanOrEqualTo(String value) { - addCriterion("cron >=", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLessThan(String value) { - addCriterion("cron <", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLessThanOrEqualTo(String value) { - addCriterion("cron <=", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronLike(String value) { - addCriterion("cron like", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotLike(String value) { - addCriterion("cron not like", value, "cron"); - return (Criteria) this; - } - - public Criteria andCronIn(List values) { - addCriterion("cron in", values, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotIn(List values) { - addCriterion("cron not in", values, "cron"); - return (Criteria) this; - } - - public Criteria andCronBetween(String value1, String value2) { - addCriterion("cron between", value1, value2, "cron"); - return (Criteria) this; - } - - public Criteria andCronNotBetween(String value1, String value2) { - addCriterion("cron not between", value1, value2, "cron"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andExtInfoIsNull() { - addCriterion("ext_info is null"); - return (Criteria) this; - } - - public Criteria andExtInfoIsNotNull() { - addCriterion("ext_info is not null"); - return (Criteria) this; - } - - public Criteria andExtInfoEqualTo(String value) { - addCriterion("ext_info =", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoNotEqualTo(String value) { - addCriterion("ext_info <>", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoGreaterThan(String value) { - addCriterion("ext_info >", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoGreaterThanOrEqualTo(String value) { - addCriterion("ext_info >=", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoLessThan(String value) { - addCriterion("ext_info <", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoLessThanOrEqualTo(String value) { - addCriterion("ext_info <=", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoLike(String value) { - addCriterion("ext_info like", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoNotLike(String value) { - addCriterion("ext_info not like", value, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoIn(List values) { - addCriterion("ext_info in", values, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoNotIn(List values) { - addCriterion("ext_info not in", values, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoBetween(String value1, String value2) { - addCriterion("ext_info between", value1, value2, "extInfo"); - return (Criteria) this; - } - - public Criteria andExtInfoNotBetween(String value1, String value2) { - addCriterion("ext_info not between", value1, value2, "extInfo"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdIsNull() { - addCriterion("external_job_info_id is null"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdIsNotNull() { - addCriterion("external_job_info_id is not null"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdEqualTo(String value) { - addCriterion("external_job_info_id =", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdNotEqualTo(String value) { - addCriterion("external_job_info_id <>", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdGreaterThan(String value) { - addCriterion("external_job_info_id >", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdGreaterThanOrEqualTo(String value) { - addCriterion("external_job_info_id >=", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdLessThan(String value) { - addCriterion("external_job_info_id <", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdLessThanOrEqualTo(String value) { - addCriterion("external_job_info_id <=", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdLike(String value) { - addCriterion("external_job_info_id like", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdNotLike(String value) { - addCriterion("external_job_info_id not like", value, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdIn(List values) { - addCriterion("external_job_info_id in", values, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdNotIn(List values) { - addCriterion("external_job_info_id not in", values, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdBetween(String value1, String value2) { - addCriterion("external_job_info_id between", value1, value2, "externalJobInfoId"); - return (Criteria) this; - } - - public Criteria andExternalJobInfoIdNotBetween(String value1, String value2) { - addCriterion("external_job_info_id not between", value1, value2, "externalJobInfoId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDO.java deleted file mode 100644 index 99df73b4..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDO.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.Date; - -public class SPGJobInstDO { - private Long id; - - private Date gmtCreate; - - private Date gmtModified; - - private Long jobId; - - private String type; - - private Long projectId; - - private String status; - - private Date startTime; - - private Date endTime; - - private String externalJobInstId; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModified() { - return gmtModified; - } - - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; - } - - public Long getJobId() { - return jobId; - } - - public void setJobId(Long jobId) { - this.jobId = jobId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public Date getStartTime() { - return startTime; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public String getExternalJobInstId() { - return externalJobInstId; - } - - public void setExternalJobInstId(String externalJobInstId) { - this.externalJobInstId = externalJobInstId == null ? null : externalJobInstId.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOExample.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOExample.java deleted file mode 100644 index d5dfcf86..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOExample.java +++ /dev/null @@ -1,844 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class SPGJobInstDOExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public SPGJobInstDOExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNull() { - addCriterion("gmt_create is null"); - return (Criteria) this; - } - - public Criteria andGmtCreateIsNotNull() { - addCriterion("gmt_create is not null"); - return (Criteria) this; - } - - public Criteria andGmtCreateEqualTo(Date value) { - addCriterion("gmt_create =", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotEqualTo(Date value) { - addCriterion("gmt_create <>", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThan(Date value) { - addCriterion("gmt_create >", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_create >=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThan(Date value) { - addCriterion("gmt_create <", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateLessThanOrEqualTo(Date value) { - addCriterion("gmt_create <=", value, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateIn(List values) { - addCriterion("gmt_create in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotIn(List values) { - addCriterion("gmt_create not in", values, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateBetween(Date value1, Date value2) { - addCriterion("gmt_create between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtCreateNotBetween(Date value1, Date value2) { - addCriterion("gmt_create not between", value1, value2, "gmtCreate"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNull() { - addCriterion("gmt_modified is null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIsNotNull() { - addCriterion("gmt_modified is not null"); - return (Criteria) this; - } - - public Criteria andGmtModifiedEqualTo(Date value) { - addCriterion("gmt_modified =", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotEqualTo(Date value) { - addCriterion("gmt_modified <>", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThan(Date value) { - addCriterion("gmt_modified >", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) { - addCriterion("gmt_modified >=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThan(Date value) { - addCriterion("gmt_modified <", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedLessThanOrEqualTo(Date value) { - addCriterion("gmt_modified <=", value, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedIn(List values) { - addCriterion("gmt_modified in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotIn(List values) { - addCriterion("gmt_modified not in", values, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedBetween(Date value1, Date value2) { - addCriterion("gmt_modified between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andGmtModifiedNotBetween(Date value1, Date value2) { - addCriterion("gmt_modified not between", value1, value2, "gmtModified"); - return (Criteria) this; - } - - public Criteria andJobIdIsNull() { - addCriterion("job_id is null"); - return (Criteria) this; - } - - public Criteria andJobIdIsNotNull() { - addCriterion("job_id is not null"); - return (Criteria) this; - } - - public Criteria andJobIdEqualTo(Long value) { - addCriterion("job_id =", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotEqualTo(Long value) { - addCriterion("job_id <>", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdGreaterThan(Long value) { - addCriterion("job_id >", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdGreaterThanOrEqualTo(Long value) { - addCriterion("job_id >=", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdLessThan(Long value) { - addCriterion("job_id <", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdLessThanOrEqualTo(Long value) { - addCriterion("job_id <=", value, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdIn(List values) { - addCriterion("job_id in", values, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotIn(List values) { - addCriterion("job_id not in", values, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdBetween(Long value1, Long value2) { - addCriterion("job_id between", value1, value2, "jobId"); - return (Criteria) this; - } - - public Criteria andJobIdNotBetween(Long value1, Long value2) { - addCriterion("job_id not between", value1, value2, "jobId"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNull() { - addCriterion("project_id is null"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNotNull() { - addCriterion("project_id is not null"); - return (Criteria) this; - } - - public Criteria andProjectIdEqualTo(Long value) { - addCriterion("project_id =", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotEqualTo(Long value) { - addCriterion("project_id <>", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThan(Long value) { - addCriterion("project_id >", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThanOrEqualTo(Long value) { - addCriterion("project_id >=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThan(Long value) { - addCriterion("project_id <", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThanOrEqualTo(Long value) { - addCriterion("project_id <=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdIn(List values) { - addCriterion("project_id in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotIn(List values) { - addCriterion("project_id not in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdBetween(Long value1, Long value2) { - addCriterion("project_id between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotBetween(Long value1, Long value2) { - addCriterion("project_id not between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNull() { - addCriterion("start_time is null"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNotNull() { - addCriterion("start_time is not null"); - return (Criteria) this; - } - - public Criteria andStartTimeEqualTo(Date value) { - addCriterion("start_time =", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotEqualTo(Date value) { - addCriterion("start_time <>", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThan(Date value) { - addCriterion("start_time >", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { - addCriterion("start_time >=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThan(Date value) { - addCriterion("start_time <", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThanOrEqualTo(Date value) { - addCriterion("start_time <=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeIn(List values) { - addCriterion("start_time in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotIn(List values) { - addCriterion("start_time not in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeBetween(Date value1, Date value2) { - addCriterion("start_time between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotBetween(Date value1, Date value2) { - addCriterion("start_time not between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNull() { - addCriterion("end_time is null"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNotNull() { - addCriterion("end_time is not null"); - return (Criteria) this; - } - - public Criteria andEndTimeEqualTo(Date value) { - addCriterion("end_time =", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotEqualTo(Date value) { - addCriterion("end_time <>", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThan(Date value) { - addCriterion("end_time >", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("end_time >=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThan(Date value) { - addCriterion("end_time <", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThanOrEqualTo(Date value) { - addCriterion("end_time <=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIn(List values) { - addCriterion("end_time in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotIn(List values) { - addCriterion("end_time not in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeBetween(Date value1, Date value2) { - addCriterion("end_time between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotBetween(Date value1, Date value2) { - addCriterion("end_time not between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdIsNull() { - addCriterion("external_job_inst_id is null"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdIsNotNull() { - addCriterion("external_job_inst_id is not null"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdEqualTo(String value) { - addCriterion("external_job_inst_id =", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdNotEqualTo(String value) { - addCriterion("external_job_inst_id <>", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdGreaterThan(String value) { - addCriterion("external_job_inst_id >", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdGreaterThanOrEqualTo(String value) { - addCriterion("external_job_inst_id >=", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdLessThan(String value) { - addCriterion("external_job_inst_id <", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdLessThanOrEqualTo(String value) { - addCriterion("external_job_inst_id <=", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdLike(String value) { - addCriterion("external_job_inst_id like", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdNotLike(String value) { - addCriterion("external_job_inst_id not like", value, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdIn(List values) { - addCriterion("external_job_inst_id in", values, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdNotIn(List values) { - addCriterion("external_job_inst_id not in", values, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdBetween(String value1, String value2) { - addCriterion("external_job_inst_id between", value1, value2, "externalJobInstId"); - return (Criteria) this; - } - - public Criteria andExternalJobInstIdNotBetween(String value1, String value2) { - addCriterion("external_job_inst_id not between", value1, value2, "externalJobInstId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOWithBLOBs.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOWithBLOBs.java deleted file mode 100644 index 3a311fde..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/dataobject/SPGJobInstDOWithBLOBs.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.dataobject; - -public class SPGJobInstDOWithBLOBs extends SPGJobInstDO { - private String result; - - private String progress; - - private String logInfo; - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result == null ? null : result.trim(); - } - - public String getProgress() { - return progress; - } - - public void setProgress(String progress) { - this.progress = progress == null ? null : progress.trim(); - } - - public String getLogInfo() { - return logInfo; - } - - public void setLogInfo(String logInfo) { - this.logInfo = logInfo == null ? null : logInfo.trim(); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInfoDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInfoDOMapper.java deleted file mode 100644 index 0a6d7956..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInfoDOMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.JobInfoDO; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInfoDOExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface JobInfoDOMapper { - long countByExample(JobInfoDOExample example); - - int deleteByExample(JobInfoDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(JobInfoDO record); - - int insertSelective(JobInfoDO record); - - List selectByExample(JobInfoDOExample example); - - JobInfoDO selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") JobInfoDO record, @Param("example") JobInfoDOExample example); - - int updateByExample( - @Param("record") JobInfoDO record, @Param("example") JobInfoDOExample example); - - int updateByPrimaryKeySelective(JobInfoDO record); - - int updateByPrimaryKey(JobInfoDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInstDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInstDOMapper.java deleted file mode 100644 index 972e3581..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/JobInstDOMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.JobInstDO; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInstDOExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface JobInstDOMapper { - long countByExample(JobInstDOExample example); - - int deleteByExample(JobInstDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(JobInstDO record); - - int insertSelective(JobInstDO record); - - List selectByExampleWithBLOBs(JobInstDOExample example); - - List selectByExample(JobInstDOExample example); - - JobInstDO selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") JobInstDO record, @Param("example") JobInstDOExample example); - - int updateByExampleWithBLOBs( - @Param("record") JobInstDO record, @Param("example") JobInstDOExample example); - - int updateByExample( - @Param("record") JobInstDO record, @Param("example") JobInstDOExample example); - - int updateByPrimaryKeySelective(JobInstDO record); - - int updateByPrimaryKeyWithBLOBs(JobInstDO record); - - int updateByPrimaryKey(JobInstDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorOverviewDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorOverviewDOMapper.java deleted file mode 100644 index 644127d5..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorOverviewDOMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.OperatorOverviewDO; -import com.antgroup.openspg.server.infra.dao.dataobject.OperatorOverviewDOExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface OperatorOverviewDOMapper { - long countByExample(OperatorOverviewDOExample example); - - int deleteByExample(OperatorOverviewDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(OperatorOverviewDO record); - - int insertSelective(OperatorOverviewDO record); - - List selectByExample(OperatorOverviewDOExample example); - - OperatorOverviewDO selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") OperatorOverviewDO record, - @Param("example") OperatorOverviewDOExample example); - - int updateByExample( - @Param("record") OperatorOverviewDO record, - @Param("example") OperatorOverviewDOExample example); - - int updateByPrimaryKeySelective(OperatorOverviewDO record); - - int updateByPrimaryKey(OperatorOverviewDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorVersionDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorVersionDOMapper.java deleted file mode 100644 index a23ead0c..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/OperatorVersionDOMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.OperatorVersionDO; -import com.antgroup.openspg.server.infra.dao.dataobject.OperatorVersionDOExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface OperatorVersionDOMapper { - long countByExample(OperatorVersionDOExample example); - - int deleteByExample(OperatorVersionDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(OperatorVersionDO record); - - int insertSelective(OperatorVersionDO record); - - List selectByExample(OperatorVersionDOExample example); - - OperatorVersionDO selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") OperatorVersionDO record, - @Param("example") OperatorVersionDOExample example); - - int updateByExample( - @Param("record") OperatorVersionDO record, - @Param("example") OperatorVersionDOExample example); - - int updateByPrimaryKeySelective(OperatorVersionDO record); - - int updateByPrimaryKey(OperatorVersionDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInfoDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInfoDOMapper.java deleted file mode 100644 index 61213e99..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInfoDOMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInfoDO; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInfoDOExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface SPGJobInfoDOMapper { - long countByExample(SPGJobInfoDOExample example); - - int deleteByExample(SPGJobInfoDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(SPGJobInfoDO record); - - int insertSelective(SPGJobInfoDO record); - - List selectByExampleWithBLOBs(SPGJobInfoDOExample example); - - List selectByExample(SPGJobInfoDOExample example); - - SPGJobInfoDO selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") SPGJobInfoDO record, @Param("example") SPGJobInfoDOExample example); - - int updateByExampleWithBLOBs( - @Param("record") SPGJobInfoDO record, @Param("example") SPGJobInfoDOExample example); - - int updateByExample( - @Param("record") SPGJobInfoDO record, @Param("example") SPGJobInfoDOExample example); - - int updateByPrimaryKeySelective(SPGJobInfoDO record); - - int updateByPrimaryKeyWithBLOBs(SPGJobInfoDO record); - - int updateByPrimaryKey(SPGJobInfoDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInstDOMapper.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInstDOMapper.java deleted file mode 100644 index b9351593..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/mapper/SPGJobInstDOMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.mapper; - -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDO; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDOExample; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDOWithBLOBs; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface SPGJobInstDOMapper { - long countByExample(SPGJobInstDOExample example); - - int deleteByExample(SPGJobInstDOExample example); - - int deleteByPrimaryKey(Long id); - - int insert(SPGJobInstDOWithBLOBs record); - - int insertSelective(SPGJobInstDOWithBLOBs record); - - List selectByExampleWithBLOBs(SPGJobInstDOExample example); - - List selectByExample(SPGJobInstDOExample example); - - SPGJobInstDOWithBLOBs selectByPrimaryKey(Long id); - - int updateByExampleSelective( - @Param("record") SPGJobInstDOWithBLOBs record, @Param("example") SPGJobInstDOExample example); - - int updateByExampleWithBLOBs( - @Param("record") SPGJobInstDOWithBLOBs record, @Param("example") SPGJobInstDOExample example); - - int updateByExample( - @Param("record") SPGJobInstDO record, @Param("example") SPGJobInstDOExample example); - - int updateByPrimaryKeySelective(SPGJobInstDOWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(SPGJobInstDOWithBLOBs record); - - int updateByPrimaryKey(SPGJobInstDO record); -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInfoRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInfoRepositoryImpl.java deleted file mode 100644 index b6d03a16..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInfoRepositoryImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.scheduler; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo.SchedulerJobInfoRepository; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInfoDO; -import com.antgroup.openspg.server.infra.dao.mapper.JobInfoDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.scheduler.convertor.SchedulerJobInfoConvertor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -@Repository -public class SchedulerJobInfoRepositoryImpl implements SchedulerJobInfoRepository { - - @Autowired private JobInfoDOMapper jobInfoDOMapper; - - @Override - public String save(SchedulerJobInfo jobInfo) { - JobInfoDO jobInfoDO = SchedulerJobInfoConvertor.toDO(jobInfo); - jobInfoDOMapper.insert(jobInfoDO); - return String.valueOf(jobInfoDO.getId()); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInstRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInstRepositoryImpl.java deleted file mode 100644 index cb85972d..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/SchedulerJobInstRepositoryImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.scheduler; - -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.cmd.SchedulerJobInstQuery; -import com.antgroup.openspg.cloudext.impl.jobscheduler.local.repo.SchedulerJobInstRepository; -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.common.util.CollectionsUtils; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInstDO; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInstDOExample; -import com.antgroup.openspg.server.infra.dao.mapper.JobInstDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.scheduler.convertor.SchedulerJobInstConvertor; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -@Repository -public class SchedulerJobInstRepositoryImpl implements SchedulerJobInstRepository { - - @Autowired private JobInstDOMapper jobInstInfoDOMapper; - - @Override - public String save(SchedulerJobInst jobInst) { - JobInstDO jobInstDO = SchedulerJobInstConvertor.toDO(jobInst); - jobInstInfoDOMapper.insert(jobInstDO); - return String.valueOf(jobInstDO.getId()); - } - - @Override - public List query(SchedulerJobInstQuery query) { - JobInstDOExample example = new JobInstDOExample(); - JobInstDOExample.Criteria criteria = example.createCriteria(); - - if (query.getStatus() != null) { - criteria.andStatusIn(CollectionsUtils.listMap(query.getStatus(), Enum::name)); - } - if (query.getOrderBy() != null) { - example.setOrderByClause(query.getOrderBy()); - } - - List jobInstDOS = jobInstInfoDOMapper.selectByExample(example); - return CollectionsUtils.listMap(jobInstDOS, SchedulerJobInstConvertor::toModel); - } - - @Override - public int updateStatus(String jobInstId, JobInstStatusEnum status) { - JobInstDOExample example = new JobInstDOExample(); - example.createCriteria().andIdEqualTo(Long.valueOf(jobInstId)); - - JobInstDO jobInstDO = new JobInstDO(); - jobInstDO.setStatus(status.name()); - return jobInstInfoDOMapper.updateByExampleSelective(jobInstDO, example); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInfoConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInfoConvertor.java deleted file mode 100644 index 21e21cb0..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInfoConvertor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.scheduler.convertor; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInfo; -import com.antgroup.openspg.server.common.model.job.JobInfoStateEnum; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInfoDO; - -public class SchedulerJobInfoConvertor { - - public static JobInfoDO toDO(SchedulerJobInfo jobInfo) { - JobInfoDO jobInfoDO = new JobInfoDO(); - - if (jobInfo.getJobId() != null) { - jobInfoDO.setId(Long.valueOf(jobInfo.getJobId())); - } - jobInfoDO.setName(jobInfo.getJobName()); - jobInfoDO.setType(jobInfo.getJobType()); - jobInfoDO.setCron(jobInfo.getCron()); - jobInfoDO.setStatus(jobInfo.getStatus().name()); - jobInfoDO.setIdempotentId(jobInfo.getIdempotentId()); - return jobInfoDO; - } - - public static SchedulerJobInfo toModel(JobInfoDO jobInfoDO) { - if (jobInfoDO == null) { - return null; - } - return new SchedulerJobInfo( - String.valueOf(jobInfoDO.getId()), - jobInfoDO.getName(), - jobInfoDO.getType(), - jobInfoDO.getCron(), - JobInfoStateEnum.valueOf(jobInfoDO.getStatus()), - jobInfoDO.getIdempotentId()); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInstConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInstConvertor.java deleted file mode 100644 index e129a18b..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/scheduler/convertor/SchedulerJobInstConvertor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.scheduler.convertor; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.SchedulerJobInst; -import com.antgroup.openspg.common.util.StringUtils; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.infra.dao.dataobject.JobInstDO; - -public class SchedulerJobInstConvertor { - - public static JobInstDO toDO(SchedulerJobInst jobInst) { - JobInstDO jobInstDO = new JobInstDO(); - - if (StringUtils.isNotBlank(jobInst.getJobInstId())) { - jobInstDO.setId(Long.valueOf(jobInst.getJobInstId())); - } - jobInstDO.setJobId(Long.valueOf(jobInst.getJobId())); - jobInstDO.setType(jobInst.getJobType()); - jobInstDO.setStatus(jobInst.getStatus().name()); - jobInstDO.setIdempotentId(jobInst.getIdempotentId()); - return jobInstDO; - } - - public static SchedulerJobInst toModel(JobInstDO jobInstDO) { - if (jobInstDO == null) { - return null; - } - return new SchedulerJobInst( - String.valueOf(jobInstDO.getId()), - String.valueOf(jobInstDO.getJobId()), - jobInstDO.getType(), - JobInstStatusEnum.valueOf(jobInstDO.getStatus()), - jobInstDO.getHost(), - jobInstDO.getIdempotentId()); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ConstraintRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ConstraintRepositoryImpl.java similarity index 94% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ConstraintRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ConstraintRepositoryImpl.java index 9b956792..5ebde3b2 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ConstraintRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ConstraintRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.constraint.Constraint; @@ -20,7 +20,7 @@ import com.antgroup.openspg.server.core.schema.service.predicate.repository.Cons import com.antgroup.openspg.server.infra.dao.dataobject.ConstraintDO; import com.antgroup.openspg.server.infra.dao.dataobject.ConstraintDOExample; import com.antgroup.openspg.server.infra.dao.mapper.ConstraintDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.ConstraintDOConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.ConstraintDOConvertor; import java.util.Collections; import java.util.Date; import java.util.List; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/LogicalRuleRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/LogicalRuleRepositoryImpl.java similarity index 95% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/LogicalRuleRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/LogicalRuleRepositoryImpl.java index 2a387bdd..d73b7b46 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/LogicalRuleRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/LogicalRuleRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.semantic.LogicalRule; @@ -21,7 +21,7 @@ import com.antgroup.openspg.server.core.schema.service.semantic.repository.Logic import com.antgroup.openspg.server.infra.dao.dataobject.LogicRuleDO; import com.antgroup.openspg.server.infra.dao.dataobject.LogicRuleDOExample; import com.antgroup.openspg.server.infra.dao.mapper.LogicRuleDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.LogicalRuleConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.LogicalRuleConvertor; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/OntologyParentRelRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/OntologyParentRelRepositoryImpl.java similarity index 93% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/OntologyParentRelRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/OntologyParentRelRepositoryImpl.java index 6a08518c..7f767ab5 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/OntologyParentRelRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/OntologyParentRelRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; @@ -24,8 +24,8 @@ import com.antgroup.openspg.server.infra.dao.dataobject.OntologyParentRelDO; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyParentRelDOExample; import com.antgroup.openspg.server.infra.dao.mapper.OntologyDOMapper; import com.antgroup.openspg.server.infra.dao.mapper.OntologyParentRelDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.OntologyParentRelConvertor; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.OntologyParentRelConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ProjectOntologyRelRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ProjectOntologyRelRepositoryImpl.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ProjectOntologyRelRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ProjectOntologyRelRepositoryImpl.java index e14a299d..528123b4 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/ProjectOntologyRelRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/ProjectOntologyRelRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; @@ -22,9 +22,9 @@ import com.antgroup.openspg.server.core.schema.service.type.repository.ProjectOn import com.antgroup.openspg.server.infra.dao.dataobject.ProjectOntologyRelDO; import com.antgroup.openspg.server.infra.dao.dataobject.ProjectOntologyRelDOExample; import com.antgroup.openspg.server.infra.dao.mapper.ProjectOntologyRelDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.ProjectOntologyRelConvertor; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ProjectEntityTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.YesOrNoEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.ProjectOntologyRelConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ProjectEntityTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.YesOrNoEnum; import com.google.common.collect.Lists; import java.util.List; import org.apache.commons.collections4.CollectionUtils; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/PropertyRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/PropertyRepositoryImpl.java similarity index 95% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/PropertyRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/PropertyRepositoryImpl.java index 3591026a..e7cd88ff 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/PropertyRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/PropertyRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; @@ -24,9 +24,9 @@ import com.antgroup.openspg.server.core.schema.service.type.repository.SPGTypeRe import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDO; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDOExample; import com.antgroup.openspg.server.infra.dao.mapper.OntologyPropertyDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.SimplePropertyConvertor; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.MapTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.PropertyCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.SimplePropertyConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.MapTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.PropertyCategoryEnum; import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.Collections; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SPGTypeRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SPGTypeRepositoryImpl.java similarity index 95% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SPGTypeRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SPGTypeRepositoryImpl.java index 4f185631..d4dffb96 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SPGTypeRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SPGTypeRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; import com.antgroup.openspg.core.schema.model.semantic.SPGOntologyEnum; @@ -25,9 +25,9 @@ import com.antgroup.openspg.server.core.schema.service.type.repository.SPGTypeRe import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDOExample; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDOWithBLOBs; import com.antgroup.openspg.server.infra.dao.mapper.OntologyDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.OntologyConvertor; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.EntityCategoryEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.OntologyConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.EntityCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; import java.util.Collections; import java.util.Date; import java.util.List; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SemanticRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SemanticRepositoryImpl.java similarity index 97% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SemanticRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SemanticRepositoryImpl.java index 78463d8b..a40d6fac 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SemanticRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SemanticRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.common.util.StringUtils; @@ -24,7 +24,7 @@ import com.antgroup.openspg.server.core.schema.service.semantic.repository.Seman import com.antgroup.openspg.server.infra.dao.dataobject.SemanticDO; import com.antgroup.openspg.server.infra.dao.dataobject.SemanticDOExample; import com.antgroup.openspg.server.infra.dao.mapper.SemanticDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.SimpleSemanticConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.SimpleSemanticConvertor; import java.util.Date; import java.util.List; import org.apache.commons.collections4.CollectionUtils; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SubPropertyRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SubPropertyRepositoryImpl.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SubPropertyRepositoryImpl.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SubPropertyRepositoryImpl.java index de30bb00..deb2b31c 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/SubPropertyRepositoryImpl.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/SubPropertyRepositoryImpl.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema; +package com.antgroup.openspg.server.infra.dao.repository.schema; import com.antgroup.openspg.common.util.CollectionsUtils; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; @@ -21,9 +21,9 @@ import com.antgroup.openspg.server.core.schema.service.predicate.repository.SubP import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDO; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDOExample; import com.antgroup.openspg.server.infra.dao.mapper.OntologyPropertyDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor.SimpleSubPropertyConvertor; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.MapTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.PropertyCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.convertor.SimpleSubPropertyConvertor; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.MapTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.PropertyCategoryEnum; import java.util.Collections; import java.util.List; import org.apache.commons.collections4.CollectionUtils; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/Constants.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/Constants.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/Constants.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/Constants.java index 719873bc..cbf4d765 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/Constants.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/Constants.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; public class Constants { diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/ConstraintItemConfigDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/ConstraintItemConfigDO.java similarity index 90% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/ConstraintItemConfigDO.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/ConstraintItemConfigDO.java index 20ae1214..7acc5d27 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/ConstraintItemConfigDO.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/ConstraintItemConfigDO.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; import lombok.Data; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/MultiVersionConfigDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/MultiVersionConfigDO.java similarity index 92% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/MultiVersionConfigDO.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/MultiVersionConfigDO.java index 1b05f2a4..442526b0 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/MultiVersionConfigDO.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/MultiVersionConfigDO.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OntologyEntityName.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OntologyEntityName.java similarity index 97% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OntologyEntityName.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OntologyEntityName.java index 26ada493..da833b72 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OntologyEntityName.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OntologyEntityName.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; import lombok.Getter; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OperatorConfigDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OperatorConfigDO.java similarity index 95% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OperatorConfigDO.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OperatorConfigDO.java index 2615044b..1c25ba6b 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/OperatorConfigDO.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/OperatorConfigDO.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; import lombok.Data; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/StandardConfigDO.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/StandardConfigDO.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/StandardConfigDO.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/StandardConfigDO.java index 15f99f50..76dff3dc 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/config/StandardConfigDO.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/config/StandardConfigDO.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.config; +package com.antgroup.openspg.server.infra.dao.repository.schema.config; import com.antgroup.openspg.server.common.model.base.BaseToString; import lombok.AllArgsConstructor; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintDOConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintDOConvertor.java similarity index 96% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintDOConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintDOConvertor.java index 135c5d0d..5efa6cc1 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintDOConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintDOConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.alibaba.fastjson.JSON; import com.antgroup.openspg.core.schema.model.constraint.BaseConstraintItem; @@ -24,8 +24,8 @@ import com.antgroup.openspg.core.schema.model.constraint.RangeConstraint; import com.antgroup.openspg.core.schema.model.constraint.RegularConstraint; import com.antgroup.openspg.core.schema.model.constraint.UniqueConstraint; import com.antgroup.openspg.server.infra.dao.dataobject.ConstraintDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ConstraintRangeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.YesOrNoEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ConstraintRangeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.YesOrNoEnum; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintItemConfigDOConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintItemConfigDOConvertor.java similarity index 94% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintItemConfigDOConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintItemConfigDOConvertor.java index 9bc31d74..e406d2e1 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ConstraintItemConfigDOConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ConstraintItemConfigDOConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.core.schema.model.constraint.BaseConstraintItem; import com.antgroup.openspg.core.schema.model.constraint.EnumConstraint; @@ -20,8 +20,8 @@ import com.antgroup.openspg.core.schema.model.constraint.NotNullConstraint; import com.antgroup.openspg.core.schema.model.constraint.RangeConstraint; import com.antgroup.openspg.core.schema.model.constraint.RegularConstraint; import com.antgroup.openspg.core.schema.model.constraint.UniqueConstraint; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.config.ConstraintItemConfigDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ConstraintEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.config.ConstraintItemConfigDO; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ConstraintEnum; import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.Collections; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ExtConfigConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ExtConfigConvertor.java similarity index 90% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ExtConfigConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ExtConfigConvertor.java index a404b15c..ba19218d 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ExtConfigConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ExtConfigConvertor.java @@ -11,11 +11,11 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.core.schema.model.SchemaConstants; import com.antgroup.openspg.core.schema.model.SchemaExtInfo; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.antgroup.openspg.server.core.schema.service.predicate.model.SimpleProperty; import com.antgroup.openspg.server.core.schema.service.type.model.SimpleSPGType; import java.util.stream.Collectors; @@ -50,7 +50,7 @@ public class ExtConfigConvertor { default: break; } - return JSON.serialize(extInfo); + return SchemaJsonUtils.serialize(extInfo); } public static String getExtConfig(SimpleProperty simplePredicate) { @@ -71,7 +71,7 @@ public class ExtConfigConvertor { extInfo.put(SchemaConstants.PROPERTY_GROUP_KEY, simplePredicate.getPropertyGroup().name()); } extInfo.put(SchemaConstants.VALUE_TYPE_KEY, simplePredicate.getObjectTypeEnum().name()); - return JSON.serialize(extInfo); + return SchemaJsonUtils.serialize(extInfo); } public static T get(SchemaExtInfo schemaExtInfo, String key, Class clazz) { @@ -81,6 +81,6 @@ public class ExtConfigConvertor { if (!schemaExtInfo.containsKey(key)) { return null; } - return JSON.deserialize(schemaExtInfo.get(key).toString(), clazz); + return SchemaJsonUtils.deserialize(schemaExtInfo.get(key).toString(), clazz); } } diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/LogicalRuleConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/LogicalRuleConvertor.java similarity index 96% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/LogicalRuleConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/LogicalRuleConvertor.java index bca5da62..5b838508 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/LogicalRuleConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/LogicalRuleConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.core.schema.model.semantic.LogicalRule; import com.antgroup.openspg.core.schema.model.semantic.RuleCode; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyConvertor.java similarity index 89% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyConvertor.java index 1088fdaf..7948825f 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.BasicInfo; @@ -27,18 +27,18 @@ import com.antgroup.openspg.core.schema.model.type.MultiVersionConfig; import com.antgroup.openspg.core.schema.model.type.ParentTypeInfo; import com.antgroup.openspg.core.schema.model.type.SPGTypeEnum; import com.antgroup.openspg.core.schema.model.type.VisibleScopeEnum; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.antgroup.openspg.server.core.schema.service.type.model.OperatorConfig; import com.antgroup.openspg.server.core.schema.service.type.model.ProjectOntologyRel; import com.antgroup.openspg.server.core.schema.service.type.model.SimpleSPGType; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDO; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDOWithBLOBs; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.config.ConstraintItemConfigDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.config.OntologyEntityName; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.EntityCategoryEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.LayerEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.TrueOrFalseEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.config.ConstraintItemConfigDO; +import com.antgroup.openspg.server.infra.dao.repository.schema.config.OntologyEntityName; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.EntityCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.LayerEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.TrueOrFalseEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; import com.google.gson.reflect.TypeToken; import java.util.ArrayList; import java.util.Date; @@ -74,7 +74,7 @@ public class OntologyConvertor { ontologyDO.setVersion(1); ontologyDO.setVersionStatus(AlterStatusEnum.ONLINE.name()); ontologyDO.setTransformerId(0L); - ontologyDO.setOperatorConfig(JSON.serialize(advancedType.getOperatorConfigs())); + ontologyDO.setOperatorConfig(SchemaJsonUtils.serialize(advancedType.getOperatorConfigs())); ontologyDO.setConfig(ExtConfigConvertor.getExtConfig(advancedType)); return ontologyDO; } @@ -95,7 +95,7 @@ public class OntologyConvertor { : TrueOrFalseEnum.FALSE.name()); ontologyDO.setScope(advancedType.getVisibleScope().name()); ontologyDO.setVersion(1); - ontologyDO.setOperatorConfig(JSON.serialize(advancedType.getOperatorConfigs())); + ontologyDO.setOperatorConfig(SchemaJsonUtils.serialize(advancedType.getOperatorConfigs())); ontologyDO.setConfig(ExtConfigConvertor.getExtConfig(advancedType)); return ontologyDO; } @@ -139,9 +139,10 @@ public class OntologyConvertor { ontologyDO.getDescription()); SPGTypeEnum spgTypeEnum = EntityCategoryEnum.toSpgType(ontologyDO.getEntityCategory()); VisibleScopeEnum visibleScopeEnum = VisibleScopeEnum.toEnum(ontologyDO.getScope()); - SchemaExtInfo extConfig = JSON.deserialize(ontologyDO.getConfig(), SchemaExtInfo.class); + SchemaExtInfo extConfig = + SchemaJsonUtils.deserialize(ontologyDO.getConfig(), SchemaExtInfo.class); List operatorConfigs = - JSON.deserialize( + SchemaJsonUtils.deserialize( ontologyDO.getOperatorConfig(), new TypeToken>() {}.getType()); Long projectId = projectOntologyRel == null ? null : projectOntologyRel.getProjectId(); @@ -166,8 +167,8 @@ public class OntologyConvertor { Object constraint = extConfig.get(SchemaConstants.STANDARD_CONSTRAINT_KEY); if (constraint instanceof List) { List constraintItemConfigDOS = - JSON.deserialize( - JSON.serialize(constraint), + SchemaJsonUtils.deserialize( + SchemaJsonUtils.serialize(constraint), new TypeToken>() {}.getType()); constraintItems = ConstraintItemConfigDOConvertor.toConstraintItem(constraintItemConfigDOS); diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyParentRelConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyParentRelConvertor.java similarity index 88% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyParentRelConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyParentRelConvertor.java index 0956c4f5..84425f21 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/OntologyParentRelConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/OntologyParentRelConvertor.java @@ -11,17 +11,17 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.core.schema.model.identifier.SPGTypeIdentifier; import com.antgroup.openspg.core.schema.model.type.ParentTypeInfo; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDO; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyDOWithBLOBs; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyParentRelDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.config.Constants; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.config.OntologyEntityName; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.YesOrNoEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.config.Constants; +import com.antgroup.openspg.server.infra.dao.repository.schema.config.OntologyEntityName; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.YesOrNoEnum; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ProjectOntologyRelConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ProjectOntologyRelConvertor.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ProjectOntologyRelConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ProjectOntologyRelConvertor.java index e20db87a..c9b31000 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/ProjectOntologyRelConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/ProjectOntologyRelConvertor.java @@ -11,14 +11,14 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.core.schema.model.alter.AlterStatusEnum; import com.antgroup.openspg.core.schema.model.type.RefSourceEnum; import com.antgroup.openspg.server.core.schema.service.type.model.ProjectOntologyRel; import com.antgroup.openspg.server.infra.dao.dataobject.ProjectOntologyRelDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ProjectEntityTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.YesOrNoEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ProjectEntityTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.YesOrNoEnum; import java.util.Date; public class ProjectOntologyRelConvertor { diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimplePropertyConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimplePropertyConvertor.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimplePropertyConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimplePropertyConvertor.java index 38e6529a..8afda2f6 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimplePropertyConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimplePropertyConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.BasicInfo; @@ -27,12 +27,12 @@ import com.antgroup.openspg.core.schema.model.semantic.RuleCode; import com.antgroup.openspg.core.schema.model.semantic.SPGOntologyEnum; import com.antgroup.openspg.core.schema.model.type.MultiVersionConfig; import com.antgroup.openspg.core.schema.model.type.SPGTypeEnum; -import com.antgroup.openspg.server.api.facade.JSON; +import com.antgroup.openspg.server.api.facade.SchemaJsonUtils; import com.antgroup.openspg.server.core.schema.service.predicate.model.SimpleProperty; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.MapTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.PropertyCategoryEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.MapTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.PropertyCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; import java.util.Date; public class SimplePropertyConvertor { @@ -80,7 +80,7 @@ public class SimplePropertyConvertor { propertyRangeDO.setMultiverConfig( simpleProperty.getMultiVersionConfig() == null ? null - : JSON.serialize(simpleProperty.getMultiVersionConfig())); + : SchemaJsonUtils.serialize(simpleProperty.getMultiVersionConfig())); propertyRangeDO.setStorePropertyName(basicInfo.getName().getName()); propertyRangeDO.setPropertySource(null); propertyRangeDO.setTransformerId(0L); @@ -108,7 +108,7 @@ public class SimplePropertyConvertor { propertyRangeDO.setMultiverConfig( simpleProperty.getMultiVersionConfig() == null ? null - : JSON.serialize(simpleProperty.getMultiVersionConfig())); + : SchemaJsonUtils.serialize(simpleProperty.getMultiVersionConfig())); propertyRangeDO.setPropertyConfig(ExtConfigConvertor.getExtConfig(simpleProperty)); return propertyRangeDO; } @@ -120,13 +120,13 @@ public class SimplePropertyConvertor { propertyRangeDO.getPropertyNameZh(), propertyRangeDO.getPropertyDesc()); SchemaExtInfo schemaExtInfo = - JSON.deserialize(propertyRangeDO.getPropertyConfig(), SchemaExtInfo.class); + SchemaJsonUtils.deserialize(propertyRangeDO.getPropertyConfig(), SchemaExtInfo.class); if (schemaExtInfo == null) { schemaExtInfo = new SchemaExtInfo(); } MultiVersionConfig multiVersionConfig = - JSON.deserialize(propertyRangeDO.getMultiverConfig(), MultiVersionConfig.class); + SchemaJsonUtils.deserialize(propertyRangeDO.getMultiverConfig(), MultiVersionConfig.class); MountedConceptConfig mountedConceptConfig = ExtConfigConvertor.get( schemaExtInfo, SchemaConstants.MOUNT_CONCEPT_CONFIG_KEY, MountedConceptConfig.class); diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSemanticConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSemanticConvertor.java similarity index 97% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSemanticConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSemanticConvertor.java index 987f10f6..7641408f 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSemanticConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSemanticConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.antgroup.openspg.common.util.StringUtils; import com.antgroup.openspg.core.schema.model.identifier.PredicateIdentifier; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSubPropertyConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSubPropertyConvertor.java similarity index 94% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSubPropertyConvertor.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSubPropertyConvertor.java index 6d538d77..0fecfab5 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/convertor/SimpleSubPropertyConvertor.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/convertor/SimpleSubPropertyConvertor.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.convertor; +package com.antgroup.openspg.server.infra.dao.repository.schema.convertor; import com.alibaba.fastjson.JSON; import com.antgroup.openspg.core.schema.model.BasicInfo; @@ -23,9 +23,9 @@ import com.antgroup.openspg.core.schema.model.predicate.EncryptTypeEnum; import com.antgroup.openspg.core.schema.model.type.MultiVersionConfig; import com.antgroup.openspg.server.core.schema.service.predicate.model.SimpleSubProperty; import com.antgroup.openspg.server.infra.dao.dataobject.OntologyPropertyDO; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.MapTypeEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.PropertyCategoryEnum; -import com.antgroup.openspg.server.infra.dao.repository.spgschema.enums.ValidStatusEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.MapTypeEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.PropertyCategoryEnum; +import com.antgroup.openspg.server.infra.dao.repository.schema.enums.ValidStatusEnum; import java.util.Date; public class SimpleSubPropertyConvertor { diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintEnum.java similarity index 96% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintEnum.java index d15c06ec..b416d801 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum ConstraintEnum { diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintRangeEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintRangeEnum.java similarity index 97% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintRangeEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintRangeEnum.java index c0168076..77fb2f4d 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ConstraintRangeEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ConstraintRangeEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; import com.antgroup.openspg.core.schema.model.constraint.RangeConstraint; import org.apache.commons.lang3.StringUtils; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/EntityCategoryEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/EntityCategoryEnum.java similarity index 96% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/EntityCategoryEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/EntityCategoryEnum.java index fc9003ac..20735ee3 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/EntityCategoryEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/EntityCategoryEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; import com.antgroup.openspg.core.schema.model.type.SPGTypeEnum; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/LayerEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/LayerEnum.java similarity index 87% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/LayerEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/LayerEnum.java index 01475135..a3bcb0c9 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/LayerEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/LayerEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum LayerEnum { CORE, diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/MapTypeEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/MapTypeEnum.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/MapTypeEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/MapTypeEnum.java index 7a47158d..5290dc23 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/MapTypeEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/MapTypeEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum MapTypeEnum { EDGE, diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ProjectEntityTypeEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ProjectEntityTypeEnum.java similarity index 94% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ProjectEntityTypeEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ProjectEntityTypeEnum.java index dd1ba6d6..e2d39aa2 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ProjectEntityTypeEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ProjectEntityTypeEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; import com.antgroup.openspg.core.schema.model.semantic.SPGOntologyEnum; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/PropertyCategoryEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/PropertyCategoryEnum.java similarity index 92% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/PropertyCategoryEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/PropertyCategoryEnum.java index be1257ce..880be198 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/PropertyCategoryEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/PropertyCategoryEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum PropertyCategoryEnum { /** Basic type. */ diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/RelationDirectEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/RelationDirectEnum.java similarity index 91% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/RelationDirectEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/RelationDirectEnum.java index de15d09e..15a70548 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/RelationDirectEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/RelationDirectEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum RelationDirectEnum { DOUBLE, diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/TrueOrFalseEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/TrueOrFalseEnum.java similarity index 93% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/TrueOrFalseEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/TrueOrFalseEnum.java index 39f8a7df..c1c3a5b9 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/TrueOrFalseEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/TrueOrFalseEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; /** True or false enum. */ public enum TrueOrFalseEnum { diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ValidStatusEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ValidStatusEnum.java similarity index 90% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ValidStatusEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ValidStatusEnum.java index ee7a7228..0e8ede24 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/ValidStatusEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/ValidStatusEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; public enum ValidStatusEnum { VALID("1"), diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/YesOrNoEnum.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/YesOrNoEnum.java similarity index 93% rename from server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/YesOrNoEnum.java rename to server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/YesOrNoEnum.java index 24df9581..261f4deb 100644 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgschema/enums/YesOrNoEnum.java +++ b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/schema/enums/YesOrNoEnum.java @@ -11,7 +11,7 @@ * or implied. */ -package com.antgroup.openspg.server.infra.dao.repository.spgschema.enums; +package com.antgroup.openspg.server.infra.dao.repository.schema.enums; import com.google.common.collect.Lists; import java.util.List; diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInfoRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInfoRepositoryImpl.java deleted file mode 100644 index a5feef9b..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInfoRepositoryImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.spgreasoner; - -import com.antgroup.openspg.common.util.CollectionsUtils; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInfoQuery; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.core.reasoner.service.repo.ReasonerJobInfoRepository; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInfoDO; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInfoDOExample; -import com.antgroup.openspg.server.infra.dao.mapper.SPGJobInfoDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgreasoner.convertor.ReasonerJobInfoConvertor; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -@Repository -public class ReasonerJobInfoRepositoryImpl implements ReasonerJobInfoRepository { - - @Autowired private SPGJobInfoDOMapper spgJobInfoDOMapper; - - @Override - public Long save(ReasonerJobInfo jobInfo) { - SPGJobInfoDO jobInfoDO = ReasonerJobInfoConvertor.toDO(jobInfo); - spgJobInfoDOMapper.insert(jobInfoDO); - return jobInfoDO.getId(); - } - - @Override - public int updateExternalJobId(Long reasonerJobInfoId, String externalJobInfoId) { - SPGJobInfoDOExample example = new SPGJobInfoDOExample(); - example.createCriteria().andIdEqualTo(reasonerJobInfoId); - - SPGJobInfoDO jobInfoDO = new SPGJobInfoDO(); - jobInfoDO.setExternalJobInfoId(externalJobInfoId); - return spgJobInfoDOMapper.updateByExampleSelective(jobInfoDO, example); - } - - @Override - public List query(ReasonerJobInfoQuery query) { - SPGJobInfoDOExample example = new SPGJobInfoDOExample(); - SPGJobInfoDOExample.Criteria criteria = example.createCriteria(); - if (query.getReasonerJobInfoId() != null) { - criteria.andIdEqualTo(query.getReasonerJobInfoId()); - } - if (query.getExternalJobInfoId() != null) { - criteria.andExternalJobInfoIdEqualTo(query.getExternalJobInfoId()); - } - example.setOrderByClause("id desc"); - List spgJobInfoDOS = spgJobInfoDOMapper.selectByExampleWithBLOBs(example); - return CollectionsUtils.listMap(spgJobInfoDOS, ReasonerJobInfoConvertor::toModel); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInstRepositoryImpl.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInstRepositoryImpl.java deleted file mode 100644 index 271b4bf5..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/ReasonerJobInstRepositoryImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.spgreasoner; - -import com.antgroup.openspg.common.util.CollectionsUtils; -import com.antgroup.openspg.server.api.facade.JSON; -import com.antgroup.openspg.server.api.facade.dto.reasoner.request.ReasonerJobInstQuery; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.FailureReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerStatusWithProgress; -import com.antgroup.openspg.server.core.reasoner.service.repo.ReasonerJobInstRepository; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDOExample; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDOWithBLOBs; -import com.antgroup.openspg.server.infra.dao.mapper.SPGJobInstDOMapper; -import com.antgroup.openspg.server.infra.dao.repository.spgreasoner.convertor.ReasonerJobInstConvertor; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -@Repository -public class ReasonerJobInstRepositoryImpl implements ReasonerJobInstRepository { - - @Autowired private SPGJobInstDOMapper spgJobInstDOMapper; - - @Override - public Long save(ReasonerJobInst jobInst) { - SPGJobInstDOWithBLOBs jobInstDO = ReasonerJobInstConvertor.toDO(jobInst); - spgJobInstDOMapper.insert(jobInstDO); - return jobInstDO.getId(); - } - - @Override - public int updateExternalJobId(Long reasonerJobInstId, String externalJobInstId) { - SPGJobInstDOExample example = new SPGJobInstDOExample(); - example.createCriteria().andIdEqualTo(reasonerJobInstId); - - SPGJobInstDOWithBLOBs jobInstDO = new SPGJobInstDOWithBLOBs(); - jobInstDO.setExternalJobInstId(externalJobInstId); - return spgJobInstDOMapper.updateByExampleSelective(jobInstDO, example); - } - - @Override - public List query(ReasonerJobInstQuery query) { - SPGJobInstDOExample example = new SPGJobInstDOExample(); - SPGJobInstDOExample.Criteria criteria = example.createCriteria(); - if (query.getReasonerJobInstId() != null) { - criteria.andIdEqualTo(query.getReasonerJobInstId()); - } - if (query.getExternalJobInstId() != null) { - criteria.andExternalJobInstIdEqualTo(query.getExternalJobInstId()); - } - - List spgJobInstDOS = - spgJobInstDOMapper.selectByExampleWithBLOBs(example); - return CollectionsUtils.listMap(spgJobInstDOS, ReasonerJobInstConvertor::toModel); - } - - @Override - public int updateStatus(Long jobInstId, ReasonerStatusWithProgress process) { - SPGJobInstDOExample example = new SPGJobInstDOExample(); - example.createCriteria().andIdEqualTo(jobInstId); - - SPGJobInstDOWithBLOBs jobInstDO = new SPGJobInstDOWithBLOBs(); - jobInstDO.setStatus(process.getStatus().name()); - jobInstDO.setResult(JSON.serialize(process.getResult())); - jobInstDO.setProgress(JSON.serialize(process.getProgress())); - return spgJobInstDOMapper.updateByExampleSelective(jobInstDO, example); - } - - @Override - public int updateToFailure(Long jobInstId, FailureReasonerResult result) { - SPGJobInstDOExample example = new SPGJobInstDOExample(); - example.createCriteria().andIdEqualTo(jobInstId); - - SPGJobInstDOWithBLOBs jobInstDO = new SPGJobInstDOWithBLOBs(); - jobInstDO.setStatus(JobInstStatusEnum.FAILURE.name()); - jobInstDO.setResult(JSON.serialize(result)); - return spgJobInstDOMapper.updateByExampleSelective(jobInstDO, example); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInfoConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInfoConvertor.java deleted file mode 100644 index 92c558eb..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInfoConvertor.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.spgreasoner.convertor; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.server.api.facade.JSON; -import com.antgroup.openspg.server.common.model.job.JobInfoStateEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerContent; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInfo; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInfoDO; -import com.google.gson.reflect.TypeToken; -import java.util.Map; - -public class ReasonerJobInfoConvertor { - - public static SPGJobInfoDO toDO(ReasonerJobInfo reasonerJobInfo) { - SPGJobInfoDO jobInfoDO = new SPGJobInfoDO(); - jobInfoDO.setId(reasonerJobInfo.getJobId()); - jobInfoDO.setName(reasonerJobInfo.getJobName()); - jobInfoDO.setType(JobTypeEnum.REASONING.name()); - jobInfoDO.setProjectId(reasonerJobInfo.getProjectId()); - jobInfoDO.setCron(reasonerJobInfo.getCron()); - jobInfoDO.setStatus(reasonerJobInfo.getStatus().name()); - jobInfoDO.setExtInfo(JSON.serialize(reasonerJobInfo.getParams())); - jobInfoDO.setContent(JSON.serialize(reasonerJobInfo.getContent())); - jobInfoDO.setExternalJobInfoId(reasonerJobInfo.getExternalJobInfoId()); - return jobInfoDO; - } - - public static ReasonerJobInfo toModel(SPGJobInfoDO jobInfoDO) { - if (jobInfoDO == null) { - return null; - } - if (!JobTypeEnum.REASONING.name().equals(jobInfoDO.getType())) { - return null; - } - - return new ReasonerJobInfo( - jobInfoDO.getName(), - jobInfoDO.getProjectId(), - JSON.deserialize(jobInfoDO.getContent(), BaseReasonerContent.class), - jobInfoDO.getCron(), - JobInfoStateEnum.valueOf(jobInfoDO.getStatus()), - JSON.deserialize( - jobInfoDO.getExtInfo(), new TypeToken>() {}.getType())) - .setJobId(jobInfoDO.getId()); - } -} diff --git a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInstConvertor.java b/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInstConvertor.java deleted file mode 100644 index 81653f94..00000000 --- a/server/infra/dao/src/main/java/com/antgroup/openspg/server/infra/dao/repository/spgreasoner/convertor/ReasonerJobInstConvertor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2023 Ant Group CO., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. - */ - -package com.antgroup.openspg.server.infra.dao.repository.spgreasoner.convertor; - -import com.antgroup.openspg.cloudext.interfaces.jobscheduler.model.JobTypeEnum; -import com.antgroup.openspg.server.api.facade.JSON; -import com.antgroup.openspg.server.common.model.job.JobInstStatusEnum; -import com.antgroup.openspg.server.core.reasoner.model.service.BaseReasonerResult; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerJobInst; -import com.antgroup.openspg.server.core.reasoner.model.service.ReasonerProgress; -import com.antgroup.openspg.server.infra.dao.dataobject.SPGJobInstDOWithBLOBs; - -public class ReasonerJobInstConvertor { - - public static ReasonerJobInst toModel(SPGJobInstDOWithBLOBs jobInstDO) { - if (jobInstDO == null) { - return null; - } - if (!JobTypeEnum.REASONING.name().equals(jobInstDO.getType())) { - return null; - } - return new ReasonerJobInst( - jobInstDO.getJobId(), - jobInstDO.getProjectId(), - JobInstStatusEnum.valueOf(jobInstDO.getStatus()), - JSON.deserialize(jobInstDO.getResult(), BaseReasonerResult.class), - jobInstDO.getStartTime(), - jobInstDO.getEndTime(), - JSON.deserialize(jobInstDO.getProgress(), ReasonerProgress.class), - jobInstDO.getLogInfo()) - .setJobInstId(jobInstDO.getId()) - .setExternalJobInstId(jobInstDO.getExternalJobInstId()); - } - - public static SPGJobInstDOWithBLOBs toDO(ReasonerJobInst jobInst) { - SPGJobInstDOWithBLOBs jobInstDO = new SPGJobInstDOWithBLOBs(); - - jobInstDO.setId(jobInst.getJobInstId()); - jobInstDO.setJobId(jobInst.getJobId()); - jobInstDO.setType(JobTypeEnum.REASONING.name()); - jobInstDO.setProjectId(jobInst.getProjectId()); - jobInstDO.setStatus(jobInst.getStatus().name()); - jobInstDO.setStartTime(jobInst.getStartTime()); - jobInstDO.setEndTime(jobInst.getEndTime()); - jobInstDO.setProgress(JSON.serialize(jobInst.getProgress())); - jobInstDO.setExternalJobInstId(jobInst.getExternalJobInstId()); - jobInstDO.setResult(JSON.serialize(jobInst.getResult())); - jobInstDO.setLogInfo(jobInst.getLogInfo()); - jobInstDO.setExternalJobInstId(jobInst.getExternalJobInstId()); - return jobInstDO; - } -} diff --git a/server/infra/dao/src/main/resources/mapper/JobInfoDOMapper.xml b/server/infra/dao/src/main/resources/mapper/JobInfoDOMapper.xml deleted file mode 100644 index 9c72e9e8..00000000 --- a/server/infra/dao/src/main/resources/mapper/JobInfoDOMapper.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, gmt_create, gmt_modified, name, type, cron, status, idempotent_id - - - - - delete from kg_schedule_job_info - where id = #{id,jdbcType=BIGINT} - - - delete from kg_schedule_job_info - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_schedule_job_info (gmt_create, gmt_modified, name, - type, cron, status, - idempotent_id) - values (#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{cron,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{idempotentId,jdbcType=VARCHAR}) - - - - SELECT LAST_INSERT_ID() - - insert into kg_schedule_job_info - - - gmt_create, - - - gmt_modified, - - - name, - - - type, - - - cron, - - - status, - - - idempotent_id, - - - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{cron,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{idempotentId,jdbcType=VARCHAR}, - - - - - - update kg_schedule_job_info - - - id = #{record.id,jdbcType=BIGINT}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - cron = #{record.cron,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=VARCHAR}, - - - idempotent_id = #{record.idempotentId,jdbcType=VARCHAR}, - - - - - - - - update kg_schedule_job_info - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - cron = #{record.cron,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - idempotent_id = #{record.idempotentId,jdbcType=VARCHAR} - - - - - - update kg_schedule_job_info - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - cron = #{cron,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - idempotent_id = #{idempotentId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_schedule_job_info - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - cron = #{cron,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - idempotent_id = #{idempotentId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mapper/JobInstDOMapper.xml b/server/infra/dao/src/main/resources/mapper/JobInstDOMapper.xml deleted file mode 100644 index 1c148d05..00000000 --- a/server/infra/dao/src/main/resources/mapper/JobInstDOMapper.xml +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, gmt_create, gmt_modified, job_id, type, status, host, trace_id, idempotent_id - - - result - - - - - - delete from kg_schedule_job_inst - where id = #{id,jdbcType=BIGINT} - - - delete from kg_schedule_job_inst - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_schedule_job_inst (gmt_create, gmt_modified, job_id, - type, status, host, - trace_id, idempotent_id, result - ) - values (#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{jobId,jdbcType=BIGINT}, - #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, - #{traceId,jdbcType=VARCHAR}, #{idempotentId,jdbcType=VARCHAR}, #{result,jdbcType=LONGVARCHAR} - ) - - - - SELECT LAST_INSERT_ID() - - insert into kg_schedule_job_inst - - - gmt_create, - - - gmt_modified, - - - job_id, - - - type, - - - status, - - - host, - - - trace_id, - - - idempotent_id, - - - result, - - - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{jobId,jdbcType=BIGINT}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{host,jdbcType=VARCHAR}, - - - #{traceId,jdbcType=VARCHAR}, - - - #{idempotentId,jdbcType=VARCHAR}, - - - #{result,jdbcType=LONGVARCHAR}, - - - - - - update kg_schedule_job_inst - - - id = #{record.id,jdbcType=BIGINT}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - job_id = #{record.jobId,jdbcType=BIGINT}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=VARCHAR}, - - - host = #{record.host,jdbcType=VARCHAR}, - - - trace_id = #{record.traceId,jdbcType=VARCHAR}, - - - idempotent_id = #{record.idempotentId,jdbcType=VARCHAR}, - - - result = #{record.result,jdbcType=LONGVARCHAR}, - - - - - - - - update kg_schedule_job_inst - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - job_id = #{record.jobId,jdbcType=BIGINT}, - type = #{record.type,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - host = #{record.host,jdbcType=VARCHAR}, - trace_id = #{record.traceId,jdbcType=VARCHAR}, - idempotent_id = #{record.idempotentId,jdbcType=VARCHAR}, - result = #{record.result,jdbcType=LONGVARCHAR} - - - - - - update kg_schedule_job_inst - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - job_id = #{record.jobId,jdbcType=BIGINT}, - type = #{record.type,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - host = #{record.host,jdbcType=VARCHAR}, - trace_id = #{record.traceId,jdbcType=VARCHAR}, - idempotent_id = #{record.idempotentId,jdbcType=VARCHAR} - - - - - - update kg_schedule_job_inst - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - job_id = #{jobId,jdbcType=BIGINT}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - host = #{host,jdbcType=VARCHAR}, - - - trace_id = #{traceId,jdbcType=VARCHAR}, - - - idempotent_id = #{idempotentId,jdbcType=VARCHAR}, - - - result = #{result,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_schedule_job_inst - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - job_id = #{jobId,jdbcType=BIGINT}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - host = #{host,jdbcType=VARCHAR}, - trace_id = #{traceId,jdbcType=VARCHAR}, - idempotent_id = #{idempotentId,jdbcType=VARCHAR}, - result = #{result,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} - - - update kg_schedule_job_inst - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - job_id = #{jobId,jdbcType=BIGINT}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - host = #{host,jdbcType=VARCHAR}, - trace_id = #{traceId,jdbcType=VARCHAR}, - idempotent_id = #{idempotentId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mapper/OperatorOverviewDOMapper.xml b/server/infra/dao/src/main/resources/mapper/OperatorOverviewDOMapper.xml deleted file mode 100644 index 2ec31fbf..00000000 --- a/server/infra/dao/src/main/resources/mapper/OperatorOverviewDOMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, name, type, gmt_create, gmt_modified, description, lang - - - - - delete from kg_operator_overview - where id = #{id,jdbcType=BIGINT} - - - delete from kg_operator_overview - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_operator_overview (name, type, gmt_create, - gmt_modified, description, lang - ) - values (#{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, - #{gmtModified,jdbcType=TIMESTAMP}, #{description,jdbcType=VARCHAR}, #{lang,jdbcType=VARCHAR} - ) - - - - SELECT LAST_INSERT_ID() - - insert into kg_operator_overview - - - name, - - - type, - - - gmt_create, - - - gmt_modified, - - - description, - - - lang, - - - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{description,jdbcType=VARCHAR}, - - - #{lang,jdbcType=VARCHAR}, - - - - - - update kg_operator_overview - - - id = #{record.id,jdbcType=BIGINT}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - description = #{record.description,jdbcType=VARCHAR}, - - - lang = #{record.lang,jdbcType=VARCHAR}, - - - - - - - - update kg_operator_overview - set id = #{record.id,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - description = #{record.description,jdbcType=VARCHAR}, - lang = #{record.lang,jdbcType=VARCHAR} - - - - - - update kg_operator_overview - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - description = #{description,jdbcType=VARCHAR}, - - - lang = #{lang,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_operator_overview - set name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - description = #{description,jdbcType=VARCHAR}, - lang = #{lang,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mapper/OperatorVersionDOMapper.xml b/server/infra/dao/src/main/resources/mapper/OperatorVersionDOMapper.xml deleted file mode 100644 index eade3bb5..00000000 --- a/server/infra/dao/src/main/resources/mapper/OperatorVersionDOMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, overview_id, main_class, jar_address, gmt_create, gmt_modified, version - - - - - delete from kg_operator_version - where id = #{id,jdbcType=BIGINT} - - - delete from kg_operator_version - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_operator_version (overview_id, main_class, jar_address, - gmt_create, gmt_modified, version - ) - values (#{overviewId,jdbcType=BIGINT}, #{mainClass,jdbcType=VARCHAR}, #{jarAddress,jdbcType=VARCHAR}, - #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{version,jdbcType=INTEGER} - ) - - - - SELECT LAST_INSERT_ID() - - insert into kg_operator_version - - - overview_id, - - - main_class, - - - jar_address, - - - gmt_create, - - - gmt_modified, - - - version, - - - - - #{overviewId,jdbcType=BIGINT}, - - - #{mainClass,jdbcType=VARCHAR}, - - - #{jarAddress,jdbcType=VARCHAR}, - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{version,jdbcType=INTEGER}, - - - - - - update kg_operator_version - - - id = #{record.id,jdbcType=BIGINT}, - - - overview_id = #{record.overviewId,jdbcType=BIGINT}, - - - main_class = #{record.mainClass,jdbcType=VARCHAR}, - - - jar_address = #{record.jarAddress,jdbcType=VARCHAR}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - version = #{record.version,jdbcType=INTEGER}, - - - - - - - - update kg_operator_version - set id = #{record.id,jdbcType=BIGINT}, - overview_id = #{record.overviewId,jdbcType=BIGINT}, - main_class = #{record.mainClass,jdbcType=VARCHAR}, - jar_address = #{record.jarAddress,jdbcType=VARCHAR}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - version = #{record.version,jdbcType=INTEGER} - - - - - - update kg_operator_version - - - overview_id = #{overviewId,jdbcType=BIGINT}, - - - main_class = #{mainClass,jdbcType=VARCHAR}, - - - jar_address = #{jarAddress,jdbcType=VARCHAR}, - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - version = #{version,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_operator_version - set overview_id = #{overviewId,jdbcType=BIGINT}, - main_class = #{mainClass,jdbcType=VARCHAR}, - jar_address = #{jarAddress,jdbcType=VARCHAR}, - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - version = #{version,jdbcType=INTEGER} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mapper/SPGJobInfoDOMapper.xml b/server/infra/dao/src/main/resources/mapper/SPGJobInfoDOMapper.xml deleted file mode 100644 index 676c62dd..00000000 --- a/server/infra/dao/src/main/resources/mapper/SPGJobInfoDOMapper.xml +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, gmt_create, gmt_modified, name, type, project_id, cron, status, ext_info, external_job_info_id - - - content - - - - - - delete from kg_spg_job_info - where id = #{id,jdbcType=BIGINT} - - - delete from kg_spg_job_info - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_spg_job_info (gmt_create, gmt_modified, name, - type, project_id, cron, - status, ext_info, external_job_info_id, - content) - values (#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{projectId,jdbcType=BIGINT}, #{cron,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{extInfo,jdbcType=VARCHAR}, #{externalJobInfoId,jdbcType=VARCHAR}, - #{content,jdbcType=LONGVARCHAR}) - - - - SELECT LAST_INSERT_ID() - - insert into kg_spg_job_info - - - gmt_create, - - - gmt_modified, - - - name, - - - type, - - - project_id, - - - cron, - - - status, - - - ext_info, - - - external_job_info_id, - - - content, - - - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{projectId,jdbcType=BIGINT}, - - - #{cron,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{extInfo,jdbcType=VARCHAR}, - - - #{externalJobInfoId,jdbcType=VARCHAR}, - - - #{content,jdbcType=LONGVARCHAR}, - - - - - - update kg_spg_job_info - - - id = #{record.id,jdbcType=BIGINT}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - project_id = #{record.projectId,jdbcType=BIGINT}, - - - cron = #{record.cron,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=VARCHAR}, - - - ext_info = #{record.extInfo,jdbcType=VARCHAR}, - - - external_job_info_id = #{record.externalJobInfoId,jdbcType=VARCHAR}, - - - content = #{record.content,jdbcType=LONGVARCHAR}, - - - - - - - - update kg_spg_job_info - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=BIGINT}, - cron = #{record.cron,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - ext_info = #{record.extInfo,jdbcType=VARCHAR}, - external_job_info_id = #{record.externalJobInfoId,jdbcType=VARCHAR}, - content = #{record.content,jdbcType=LONGVARCHAR} - - - - - - update kg_spg_job_info - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=BIGINT}, - cron = #{record.cron,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, - ext_info = #{record.extInfo,jdbcType=VARCHAR}, - external_job_info_id = #{record.externalJobInfoId,jdbcType=VARCHAR} - - - - - - update kg_spg_job_info - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - project_id = #{projectId,jdbcType=BIGINT}, - - - cron = #{cron,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ext_info = #{extInfo,jdbcType=VARCHAR}, - - - external_job_info_id = #{externalJobInfoId,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_spg_job_info - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=BIGINT}, - cron = #{cron,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ext_info = #{extInfo,jdbcType=VARCHAR}, - external_job_info_id = #{externalJobInfoId,jdbcType=VARCHAR}, - content = #{content,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} - - - update kg_spg_job_info - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=BIGINT}, - cron = #{cron,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ext_info = #{extInfo,jdbcType=VARCHAR}, - external_job_info_id = #{externalJobInfoId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mapper/SPGJobInstDOMapper.xml b/server/infra/dao/src/main/resources/mapper/SPGJobInstDOMapper.xml deleted file mode 100644 index 9c69023b..00000000 --- a/server/infra/dao/src/main/resources/mapper/SPGJobInstDOMapper.xml +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, gmt_create, gmt_modified, job_id, type, project_id, status, start_time, end_time, - external_job_inst_id - - - result, progress, log_info - - - - - - delete from kg_spg_job_inst - where id = #{id,jdbcType=BIGINT} - - - delete from kg_spg_job_inst - - - - - - - SELECT LAST_INSERT_ID() - - insert into kg_spg_job_inst (gmt_create, gmt_modified, job_id, - type, project_id, status, - start_time, end_time, external_job_inst_id, - result, progress, log_info - ) - values (#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{jobId,jdbcType=BIGINT}, - #{type,jdbcType=VARCHAR}, #{projectId,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, - #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{externalJobInstId,jdbcType=VARCHAR}, - #{result,jdbcType=LONGVARCHAR}, #{progress,jdbcType=LONGVARCHAR}, #{logInfo,jdbcType=LONGVARCHAR} - ) - - - - SELECT LAST_INSERT_ID() - - insert into kg_spg_job_inst - - - gmt_create, - - - gmt_modified, - - - job_id, - - - type, - - - project_id, - - - status, - - - start_time, - - - end_time, - - - external_job_inst_id, - - - result, - - - progress, - - - log_info, - - - - - #{gmtCreate,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - #{jobId,jdbcType=BIGINT}, - - - #{type,jdbcType=VARCHAR}, - - - #{projectId,jdbcType=BIGINT}, - - - #{status,jdbcType=VARCHAR}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{externalJobInstId,jdbcType=VARCHAR}, - - - #{result,jdbcType=LONGVARCHAR}, - - - #{progress,jdbcType=LONGVARCHAR}, - - - #{logInfo,jdbcType=LONGVARCHAR}, - - - - - - update kg_spg_job_inst - - - id = #{record.id,jdbcType=BIGINT}, - - - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - - - job_id = #{record.jobId,jdbcType=BIGINT}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - project_id = #{record.projectId,jdbcType=BIGINT}, - - - status = #{record.status,jdbcType=VARCHAR}, - - - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - - - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - - - external_job_inst_id = #{record.externalJobInstId,jdbcType=VARCHAR}, - - - result = #{record.result,jdbcType=LONGVARCHAR}, - - - progress = #{record.progress,jdbcType=LONGVARCHAR}, - - - log_info = #{record.logInfo,jdbcType=LONGVARCHAR}, - - - - - - - - update kg_spg_job_inst - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - job_id = #{record.jobId,jdbcType=BIGINT}, - type = #{record.type,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=BIGINT}, - status = #{record.status,jdbcType=VARCHAR}, - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - external_job_inst_id = #{record.externalJobInstId,jdbcType=VARCHAR}, - result = #{record.result,jdbcType=LONGVARCHAR}, - progress = #{record.progress,jdbcType=LONGVARCHAR}, - log_info = #{record.logInfo,jdbcType=LONGVARCHAR} - - - - - - update kg_spg_job_inst - set id = #{record.id,jdbcType=BIGINT}, - gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}, - job_id = #{record.jobId,jdbcType=BIGINT}, - type = #{record.type,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=BIGINT}, - status = #{record.status,jdbcType=VARCHAR}, - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - external_job_inst_id = #{record.externalJobInstId,jdbcType=VARCHAR} - - - - - - update kg_spg_job_inst - - - gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - job_id = #{jobId,jdbcType=BIGINT}, - - - type = #{type,jdbcType=VARCHAR}, - - - project_id = #{projectId,jdbcType=BIGINT}, - - - status = #{status,jdbcType=VARCHAR}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - external_job_inst_id = #{externalJobInstId,jdbcType=VARCHAR}, - - - result = #{result,jdbcType=LONGVARCHAR}, - - - progress = #{progress,jdbcType=LONGVARCHAR}, - - - log_info = #{logInfo,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update kg_spg_job_inst - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - job_id = #{jobId,jdbcType=BIGINT}, - type = #{type,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=BIGINT}, - status = #{status,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - external_job_inst_id = #{externalJobInstId,jdbcType=VARCHAR}, - result = #{result,jdbcType=LONGVARCHAR}, - progress = #{progress,jdbcType=LONGVARCHAR}, - log_info = #{logInfo,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} - - - update kg_spg_job_inst - set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - job_id = #{jobId,jdbcType=BIGINT}, - type = #{type,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=BIGINT}, - status = #{status,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - external_job_inst_id = #{externalJobInstId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/server/infra/dao/src/main/resources/mybatis-generator-config.xml b/server/infra/dao/src/main/resources/mybatis-generator-config.xml index 87008581..00562b2d 100644 --- a/server/infra/dao/src/main/resources/mybatis-generator-config.xml +++ b/server/infra/dao/src/main/resources/mybatis-generator-config.xml @@ -68,14 +68,6 @@
- - - -
- - - -
@@ -100,21 +92,5 @@
- - - -
- - - -
- - - -
- - - -
diff --git a/server/initdb.sql b/server/initdb.sql deleted file mode 100644 index 0a1bb696..00000000 --- a/server/initdb.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Copyright 2023 Ant Group CO., Ltd. --- --- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except --- in compliance with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software distributed under the License --- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express --- or implied. - - - -use openspg; - - - - diff --git a/server/lib/spgreasoner-local-0.0.1.jar b/server/lib/spgreasoner-local-0.0.1.jar deleted file mode 100644 index 1beb5a1a..00000000 Binary files a/server/lib/spgreasoner-local-0.0.1.jar and /dev/null differ diff --git a/server/pom.xml b/server/pom.xml index 7896649c..78a4815e 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -40,18 +40,11 @@ api/http-server arks/sofaboot biz/common - biz/reasoner biz/schema - cloudext/interface/job-scheduler - cloudext/interface/computing - cloudext/impl/job-scheduler/local - cloudext/impl/computing/local common/model common/service core/schema/model core/schema/service - core/reasoner/model - core/reasoner/service infra/dao test testdata @@ -97,36 +90,11 @@ biz-common ${project.version}
- - com.antgroup.openspg.server - biz-reasoner - ${project.version} - com.antgroup.openspg.server biz-schema ${project.version} - - com.antgroup.openspg.server - cloudext-interface-job-scheduler - ${project.version} - - - com.antgroup.openspg.server - cloudext-interface-computing - ${project.version} - - - com.antgroup.openspg.server - cloudext-impl-job-scheduler-local - ${project.version} - - - com.antgroup.openspg.server - cloudext-impl-computing-local - ${project.version} - com.antgroup.openspg.server common-service @@ -137,16 +105,6 @@ core-schema-service ${project.version} - - com.antgroup.openspg.server - core-reasoner-model - ${project.version} - - - com.antgroup.openspg.server - core-reasoner-service - ${project.version} - com.antgroup.openspg.server infra-dao