diff --git a/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java b/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java index d898bc849a..de85b7132e 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java @@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import io.dataease.api.ds.vo.DatasourceDTO; import io.dataease.commons.constants.OptConstants; import io.dataease.constant.DataSourceType; -import io.dataease.constant.LogOT; -import io.dataease.constant.LogST; import io.dataease.datasource.dao.auto.entity.CoreDatasource; import io.dataease.datasource.dao.auto.mapper.CoreDatasourceMapper; import io.dataease.datasource.dao.ext.mapper.DataSourceExtMapper; @@ -14,7 +12,6 @@ import io.dataease.datasource.dao.ext.po.DataSourceNodePO; import io.dataease.datasource.dto.DatasourceNodeBO; import io.dataease.exception.DEException; import io.dataease.license.config.XpackInteract; -import io.dataease.log.DeLog; import io.dataease.model.BusiNodeRequest; import io.dataease.model.BusiNodeVO; import io.dataease.operation.manage.CoreOptRecentManage; @@ -73,14 +70,14 @@ public class DataSourceManage { return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false); } - @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE) + @XpackInteract(value = "datasourceResourceTree", before = false) public void innerSave(CoreDatasource coreDatasource) { coreDatasourceMapper.insert(coreDatasource); coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.NEW); } - @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) + @XpackInteract(value = "datasourceResourceTree", before = false) public void innerEdit(CoreDatasource coreDatasource) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); @@ -91,7 +88,7 @@ public class DataSourceManage { coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE); } - @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) + @XpackInteract(value = "datasourceResourceTree", before = false) public void innerEditStatus(CoreDatasource coreDatasource) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); @@ -99,7 +96,7 @@ public class DataSourceManage { coreDatasourceMapper.update(coreDatasource, updateWrapper); } - @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) + @XpackInteract(value = "datasourceResourceTree", before = false) public void move(DatasourceDTO dataSourceDTO) { Long id = dataSourceDTO.getId(); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 46539eb917..3a58f304bb 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -188,6 +188,7 @@ public class DatasourceServer implements DatasourceApi { return hasRepeat; } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) @Transactional public DatasourceDTO move(DatasourceDTO dataSourceDTO) { if (dataSourceDTO.getPid() == null) { @@ -218,6 +219,7 @@ public class DatasourceServer implements DatasourceApi { return dataSourceDTO; } + @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE) @Transactional public DatasourceDTO createFolder(DatasourceDTO dataSourceDTO) { dataSourceDTO.setCreateTime(System.currentTimeMillis()); @@ -232,6 +234,7 @@ public class DatasourceServer implements DatasourceApi { return dataSourceDTO; } + @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE) @Transactional @Override public DatasourceDTO save(DatasourceDTO dataSourceDTO) throws DEException { @@ -311,6 +314,7 @@ public class DatasourceServer implements DatasourceApi { return dataSourceDTO; } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) @Transactional @Override public DatasourceDTO update(DatasourceDTO dataSourceDTO) throws DEException { diff --git a/de-xpack b/de-xpack index 5110792386..4889ffa0fc 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 51107923868b5d6eb0b05d3f7a28c8b7c5b44591 +Subproject commit 4889ffa0fcdfebe2755f5f1ce3b371e858abc981 diff --git a/sdk/common/src/main/java/io/dataease/utils/DeClassUtils.java b/sdk/common/src/main/java/io/dataease/utils/DeClassUtils.java new file mode 100644 index 0000000000..c427dd51c1 --- /dev/null +++ b/sdk/common/src/main/java/io/dataease/utils/DeClassUtils.java @@ -0,0 +1,45 @@ +package io.dataease.utils; + +public class DeClassUtils { + + public static boolean isPrimitiveOrWrapper(Object obj) { + if (obj == null) { + return false; + } + + Class objClass = obj.getClass(); + for (Class primitiveWrapper : primitiveWrappers) { + if (primitiveWrapper.isAssignableFrom(objClass)) { + return true; + } + } + + return isPrimitive(objClass); + } + + private static boolean isPrimitive(Class clazz) { + if (clazz.isPrimitive()) { + return true; + } + + String name = clazz.getName(); + for (String primitiveTypeName : primitiveTypeNames) { + if (name.equals(primitiveTypeName)) { + return true; + } + } + + return false; + } + + private static final Class[] primitiveWrappers = { + Boolean.class, Character.class, Byte.class, Short.class, + Integer.class, Long.class, Float.class, Double.class + }; + + private static final String[] primitiveTypeNames = { + "boolean", "char", "byte", "short", + "int", "long", "float", "double" + }; + +}