From bfb80afee22e9f936491c0c0a77c7f0b72a92da8 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Wed, 12 Jun 2024 00:21:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=95=B0=E6=8D=AE=E6=A8=A1=E5=9E=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/data/GenericsDataDefinition.java | 46 +++++++------ .../handler/data/model/GenericsDataModel.java | 12 ++++ .../AbstractGenericsDataStrategy.java | 65 +++++++++++++++++++ .../data/strategy/GenericsDataStrategy.java | 48 ++++---------- .../data/strategy/MapDataStrategy.java | 22 ------- .../asset/enums/HostConfigTypeEnum.java | 8 +-- .../module/asset/enums/HostExtraItemEnum.java | 12 ++-- .../strategy/HostSshConfigStrategy.java | 24 +++---- .../strategy/HostLabelExtraStrategy.java | 16 ++--- .../extra/strategy/HostSshExtraStrategy.java | 16 ++--- .../service/impl/HostConfigServiceImpl.java | 12 ++-- .../service/impl/HostExtraServiceImpl.java | 11 ++-- .../preference/model/PreferenceModel.java | 30 --------- .../strategy/IPreferenceStrategy.java | 21 ------ .../infra/enums/PreferenceTypeEnum.java | 35 ++++------ .../model/SystemPreferenceModel.java | 3 +- .../model/TerminalPreferenceModel.java | 3 +- .../strategy/SystemPreferenceStrategy.java | 15 ++++- .../strategy/TerminalPreferenceStrategy.java | 21 ++++-- .../service/impl/PreferenceServiceImpl.java | 9 +-- 20 files changed, 205 insertions(+), 224 deletions(-) create mode 100644 orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/AbstractGenericsDataStrategy.java delete mode 100644 orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/MapDataStrategy.java delete mode 100644 orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/model/PreferenceModel.java delete mode 100644 orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/IPreferenceStrategy.java diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/GenericsDataDefinition.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/GenericsDataDefinition.java index 2900a33e..9bddaa81 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/GenericsDataDefinition.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/GenericsDataDefinition.java @@ -1,9 +1,8 @@ package com.orion.visor.framework.common.handler.data; -import com.alibaba.fastjson.JSON; import com.orion.spring.SpringHolder; import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; /** * 标准数据定义 @@ -12,45 +11,50 @@ import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; * @version 1.0.0 * @since 2023/12/21 0:07 */ +@SuppressWarnings("unchecked") public interface GenericsDataDefinition { - /** - * 获取数据模型类型 - * - * @return class - */ - Class getModel(); - /** * 获取数据处理策略 * * @return class */ - Class> getStrategy(); + Class> getStrategyClass(); /** * 获取数据模型策略处理器 * - * @param Model - * @param Strategy - * @return StrategyBean + * @param Model + * @param Strategy + * @return Strategy Bean */ - @SuppressWarnings("unchecked") - default > Strategy getStrategyBean() { - return (Strategy) SpringHolder.getBean(this.getStrategy()); + default > S getStrategy() { + return (S) SpringHolder.getBean(this.getStrategyClass()); } /** * 反序列化对象 * - * @param json json - * @param Model + * @param serialModel serialModel + * @param Model * @return object */ - @SuppressWarnings("unchecked") - default Model parse(String json) { - return (Model) JSON.parseObject(json, this.getModel()); + default M parse(String serialModel) { + return (M) this.getStrategy().parse(serialModel); } + /** + * 转为视图对象 + * + * @param serialModel serialModel + * @param Model + * @return viewModel + */ + default M toView(String serialModel) { + GenericsDataStrategy strategy = this.getStrategy(); + GenericsDataModel model = strategy.parse(serialModel); + strategy.toView(model); + return (M) model; + } } diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/model/GenericsDataModel.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/model/GenericsDataModel.java index f55dd244..ab068d5f 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/model/GenericsDataModel.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/model/GenericsDataModel.java @@ -2,6 +2,8 @@ package com.orion.visor.framework.common.handler.data.model; import com.alibaba.fastjson.JSON; +import java.util.Map; + /** * 标准数据模型 * @@ -20,4 +22,14 @@ public interface GenericsDataModel { return JSON.toJSONString(this); } + + /** + * 转为 map + * + * @return map + */ + default Map toMap() { + return JSON.parseObject(this.serial()); + } + } diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/AbstractGenericsDataStrategy.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/AbstractGenericsDataStrategy.java new file mode 100644 index 00000000..11c74a56 --- /dev/null +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/AbstractGenericsDataStrategy.java @@ -0,0 +1,65 @@ +package com.orion.visor.framework.common.handler.data.strategy; + +import com.alibaba.fastjson.JSON; +import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; + +/** + * 标准数据处理策略 基类 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2024/6/11 21:44 + */ +public abstract class AbstractGenericsDataStrategy implements GenericsDataStrategy { + + protected final Class modelClass; + + public AbstractGenericsDataStrategy(Class modelClass) { + this.modelClass = modelClass; + } + + /** + * 更新填充 + * + * @param beforeModel 修改前的配置 + * @param afterModel 修改后的配置 + */ + protected void updateFill(M beforeModel, M afterModel) { + } + + /** + * 预校验参数 + * + * @param model model + */ + protected void preValid(M model) { + } + + /** + * 校验参数 + * + * @param model model + */ + protected void valid(M model) { + } + + @Override + public void doValid(M beforeModel, M afterModel) { + // 预校验参数 + this.preValid(afterModel); + // 更新填充 + this.updateFill(beforeModel, afterModel); + // 校验参数 + this.valid(afterModel); + } + + @Override + public M parse(String serialModel) { + return JSON.parseObject(serialModel, modelClass); + } + + @Override + public void toView(M model) { + } + +} diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/GenericsDataStrategy.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/GenericsDataStrategy.java index 93992305..4378269e 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/GenericsDataStrategy.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/GenericsDataStrategy.java @@ -9,60 +9,38 @@ import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; * @version 1.0.0 * @since 2023/12/20 22:09 */ -public interface GenericsDataStrategy { +public interface GenericsDataStrategy { /** * 获取默认值 * * @return 默认值 */ - Model getDefault(); - - /** - * 更新填充 - * - * @param beforeModel 修改前的配置 - * @param afterModel 修改后的配置 - */ - void updateFill(Model beforeModel, Model afterModel); - - /** - * 预校验参数 - * - * @param model model - */ - void preValid(Model model); - - /** - * 校验参数 - * - * @param model model - */ - void valid(Model model); + M getDefault(); /** * 执行完整验证链 *

- * preValid > updateFill > preValid + * preValid > updateFill > valid * * @param beforeModel beforeModel * @param afterModel afterModel */ - default void doValidChain(Model beforeModel, Model afterModel) { - // 预校验参数 - this.preValid(afterModel); - // 更新填充 - this.updateFill(beforeModel, afterModel); - // 校验参数 - this.valid(afterModel); - } + void doValid(M beforeModel, M afterModel); + + /** + * 解析数据 + * + * @param serialModel serialModel + * @return model + */ + M parse(String serialModel); /** * 转为视图配置 * * @param model model - * @return 视图配置 */ - View toView(String model); + void toView(M model); } diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/MapDataStrategy.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/MapDataStrategy.java deleted file mode 100644 index 4e92dbb4..00000000 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/handler/data/strategy/MapDataStrategy.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.orion.visor.framework.common.handler.data.strategy; - -import com.alibaba.fastjson.JSONObject; -import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; - -import java.util.Map; - -/** - * map 数据处理策略 - * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/12/20 22:11 - */ -public interface MapDataStrategy extends GenericsDataStrategy> { - - @Override - default Map toView(String model) { - return JSONObject.parseObject(model); - } - -} diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostConfigTypeEnum.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostConfigTypeEnum.java index 81b3a636..996bf15f 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostConfigTypeEnum.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostConfigTypeEnum.java @@ -3,8 +3,7 @@ package com.orion.visor.module.asset.enums; import com.orion.visor.framework.common.enums.EnableStatus; import com.orion.visor.framework.common.handler.data.GenericsDataDefinition; import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; -import com.orion.visor.module.asset.handler.host.config.model.HostSshConfigModel; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; import com.orion.visor.module.asset.handler.host.config.strategy.HostSshConfigStrategy; import lombok.AllArgsConstructor; import lombok.Getter; @@ -24,7 +23,6 @@ public enum HostConfigTypeEnum implements GenericsDataDefinition { * SSH 配置 */ SSH("ssh", - HostSshConfigModel.class, HostSshConfigStrategy.class, EnableStatus.ENABLED.getValue()), @@ -32,9 +30,7 @@ public enum HostConfigTypeEnum implements GenericsDataDefinition { private final String type; - private final Class model; - - private final Class> strategy; + private final Class> strategyClass; private final Integer defaultStatus; diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostExtraItemEnum.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostExtraItemEnum.java index 3cb4b484..f0f78510 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostExtraItemEnum.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/enums/HostExtraItemEnum.java @@ -2,9 +2,7 @@ package com.orion.visor.module.asset.enums; import com.orion.visor.framework.common.handler.data.GenericsDataDefinition; import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; -import com.orion.visor.module.asset.handler.host.extra.model.HostLabelExtraModel; -import com.orion.visor.module.asset.handler.host.extra.model.HostSshExtraModel; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; import com.orion.visor.module.asset.handler.host.extra.strategy.HostLabelExtraStrategy; import com.orion.visor.module.asset.handler.host.extra.strategy.HostSshExtraStrategy; import lombok.AllArgsConstructor; @@ -24,20 +22,18 @@ public enum HostExtraItemEnum implements GenericsDataDefinition { /** * SSH 额外配置 */ - SSH("ssh", HostSshExtraModel.class, HostSshExtraStrategy.class), + SSH("ssh", HostSshExtraStrategy.class), /** * 标签额外配置 */ - LABEL("label", HostLabelExtraModel.class, HostLabelExtraStrategy.class), + LABEL("label", HostLabelExtraStrategy.class), ; private final String item; - private final Class model; - - private final Class> strategy; + private final Class> strategyClass; public static HostExtraItemEnum of(String type) { if (type == null) { diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/config/strategy/HostSshConfigStrategy.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/config/strategy/HostSshConfigStrategy.java index ceb4ae5f..d0775b68 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/config/strategy/HostSshConfigStrategy.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/config/strategy/HostSshConfigStrategy.java @@ -1,13 +1,12 @@ package com.orion.visor.module.asset.handler.host.config.strategy; -import com.alibaba.fastjson.JSON; import com.orion.lang.utils.Booleans; import com.orion.lang.utils.Charsets; import com.orion.lang.utils.Exceptions; import com.orion.lang.utils.Strings; import com.orion.visor.framework.common.constant.Const; import com.orion.visor.framework.common.constant.ErrorMessage; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; +import com.orion.visor.framework.common.handler.data.strategy.AbstractGenericsDataStrategy; import com.orion.visor.framework.common.security.PasswordModifier; import com.orion.visor.framework.common.utils.Valid; import com.orion.visor.module.asset.dao.HostIdentityDAO; @@ -18,7 +17,6 @@ import com.orion.visor.module.asset.handler.host.config.model.HostSshConfigModel import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.Map; /** * 主机 SSH 配置策略 @@ -28,7 +26,7 @@ import java.util.Map; * @since 2023/9/19 14:26 */ @Component -public class HostSshConfigStrategy implements MapDataStrategy { +public class HostSshConfigStrategy extends AbstractGenericsDataStrategy { @Resource private HostKeyDAO hostKeyDAO; @@ -40,6 +38,10 @@ public class HostSshConfigStrategy implements MapDataStrategy toView(String config) { - if (config == null) { - return null; + public void toView(HostSshConfigModel model) { + if (model == null) { + return; } - HostSshConfigModel model = JSON.parseObject(config, HostSshConfigModel.class); model.setHasPassword(Strings.isNotBlank(model.getPassword())); model.setPassword(null); - return JSON.parseObject(JSON.toJSONString(model)); } /** diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/extra/strategy/HostLabelExtraStrategy.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/extra/strategy/HostLabelExtraStrategy.java index 0f93e2fa..bb7fc4c6 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/extra/strategy/HostLabelExtraStrategy.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/handler/host/extra/strategy/HostLabelExtraStrategy.java @@ -1,7 +1,7 @@ package com.orion.visor.module.asset.handler.host.extra.strategy; import com.orion.visor.framework.common.constant.Const; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; +import com.orion.visor.framework.common.handler.data.strategy.AbstractGenericsDataStrategy; import com.orion.visor.module.asset.handler.host.extra.model.HostLabelExtraModel; import org.springframework.stereotype.Component; @@ -13,7 +13,11 @@ import org.springframework.stereotype.Component; * @since 2024/2/29 23:16 */ @Component -public class HostLabelExtraStrategy implements MapDataStrategy { +public class HostLabelExtraStrategy extends AbstractGenericsDataStrategy { + + public HostLabelExtraStrategy() { + super(HostLabelExtraModel.class); + } @Override public HostLabelExtraModel getDefault() { @@ -36,12 +40,4 @@ public class HostLabelExtraStrategy implements MapDataStrategy { +public class HostSshExtraStrategy extends AbstractGenericsDataStrategy { @Resource private HostKeyDAO hostKeyDAO; @@ -33,6 +33,10 @@ public class HostSshExtraStrategy implements MapDataStrategy @Resource private DataPermissionApi dataPermissionApi; + public HostSshExtraStrategy() { + super(HostSshExtraModel.class); + } + @Override public HostSshExtraModel getDefault() { return HostSshExtraModel.builder() @@ -40,10 +44,6 @@ public class HostSshExtraStrategy implements MapDataStrategy .build(); } - @Override - public void updateFill(HostSshExtraModel beforeModel, HostSshExtraModel afterModel) { - } - @Override public void preValid(HostSshExtraModel model) { HostExtraSshAuthTypeEnum authType = Valid.valid(HostExtraSshAuthTypeEnum::of, model.getAuthType()); @@ -79,8 +79,4 @@ public class HostSshExtraStrategy implements MapDataStrategy } } - @Override - public void valid(HostSshExtraModel model) { - } - } diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostConfigServiceImpl.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostConfigServiceImpl.java index 7691813a..a108fa76 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostConfigServiceImpl.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostConfigServiceImpl.java @@ -8,7 +8,7 @@ import com.orion.visor.framework.common.constant.ErrorMessage; import com.orion.visor.framework.common.enums.BooleanBit; import com.orion.visor.framework.common.enums.EnableStatus; import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; import com.orion.visor.framework.common.utils.Valid; import com.orion.visor.module.asset.convert.HostConfigConvert; import com.orion.visor.module.asset.dao.HostConfigDAO; @@ -53,7 +53,7 @@ public class HostConfigServiceImpl implements HostConfigService { // 转换 HostConfigVO vo = HostConfigConvert.MAPPER.to(config); // 获取配置 - Map configMap = configType.getStrategyBean().toView(config.getConfig()); + Map configMap = configType.toView(config.getConfig()).toMap(); vo.setConfig(configMap); return vo; } @@ -121,10 +121,10 @@ public class HostConfigServiceImpl implements HostConfigService { OperatorLogs.add(OperatorLogs.TYPE, type.getType()); // 检查版本 Valid.eq(record.getVersion(), request.getVersion(), ErrorMessage.DATA_MODIFIED); - MapDataStrategy strategy = type.getStrategyBean(); + GenericsDataStrategy strategy = type.getStrategy(); GenericsDataModel beforeConfig = type.parse(record.getConfig()); // 更新前校验 - strategy.doValidChain(beforeConfig, newConfig); + strategy.doValid(beforeConfig, newConfig); // 修改配置 HostConfigDO update = new HostConfigDO(); update.setId(record.getId()); @@ -225,7 +225,7 @@ public class HostConfigServiceImpl implements HostConfigService { insert.setHostId(hostId); insert.setType(type.getType()); insert.setStatus(type.getDefaultStatus()); - insert.setConfig(type.getStrategyBean().getDefault().serial()); + insert.setConfig(type.getStrategy().getDefault().serial()); insert.setVersion(Const.DEFAULT_VERSION); return insert; } @@ -244,7 +244,7 @@ public class HostConfigServiceImpl implements HostConfigService { } // 转为视图 HostConfigVO vo = HostConfigConvert.MAPPER.to(row); - Map config = type.getStrategyBean().toView(row.getConfig()); + Map config = type.toView(row.getConfig()).toMap(); vo.setConfig(config); return vo; } diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostExtraServiceImpl.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostExtraServiceImpl.java index 1eac608b..f825edd4 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostExtraServiceImpl.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/com/orion/visor/module/asset/service/impl/HostExtraServiceImpl.java @@ -3,7 +3,7 @@ package com.orion.visor.module.asset.service.impl; import com.orion.lang.function.Functions; import com.orion.lang.utils.collect.Maps; import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; -import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; import com.orion.visor.framework.common.utils.Valid; import com.orion.visor.framework.security.core.utils.SecurityUtils; import com.orion.visor.module.asset.entity.request.host.HostExtraQueryRequest; @@ -98,7 +98,7 @@ public class HostExtraServiceImpl implements HostExtraService { Long hostId = request.getHostId(); Long userId = SecurityUtils.getLoginUserId(); HostExtraItemEnum item = Valid.valid(HostExtraItemEnum::of, request.getItem()); - MapDataStrategy strategy = item.getStrategyBean(); + GenericsDataStrategy strategy = item.getStrategy(); // 查询原始配置 DataExtraQueryDTO query = DataExtraQueryDTO.builder() .userId(userId) @@ -114,7 +114,7 @@ public class HostExtraServiceImpl implements HostExtraService { GenericsDataModel newExtra = item.parse(request.getExtra()); GenericsDataModel beforeExtra = item.parse(beforeExtraItem.getValue()); // 更新验证 - strategy.doValidChain(beforeExtra, newExtra); + strategy.doValid(beforeExtra, newExtra); // 更新配置 return dataExtraApi.updateExtraValue(beforeExtraItem.getId(), newExtra.serial()); } @@ -129,12 +129,11 @@ public class HostExtraServiceImpl implements HostExtraService { * @return viewMap */ private Map checkItemAndToView(HostExtraItemEnum item, String extraValue, Long userId, Long hostId) { - MapDataStrategy strategy = item.getStrategyBean(); if (extraValue == null) { // 初始化默认数据 extraValue = this.checkInitItem(item, userId, hostId); } - return strategy.toView(extraValue); + return item.toView(extraValue).toMap(); } /** @@ -146,7 +145,7 @@ public class HostExtraServiceImpl implements HostExtraService { * @return defaultValue */ private String checkInitItem(HostExtraItemEnum item, Long userId, Long hostId) { - MapDataStrategy strategy = item.getStrategyBean(); + GenericsDataStrategy strategy = item.getStrategy(); // 初始化默认数据 String extraValue = strategy.getDefault().serial(); // 插入默认值 diff --git a/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/model/PreferenceModel.java b/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/model/PreferenceModel.java deleted file mode 100644 index dbdd181a..00000000 --- a/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/model/PreferenceModel.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.orion.visor.module.infra.handler.preference.model; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.orion.lang.utils.Refs; -import com.orion.lang.utils.collect.Maps; - -import java.util.Map; -import java.util.function.Function; - -/** - * 偏好 - * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/10/8 13:54 - */ -public interface PreferenceModel { - - /** - * 转为 map - * - * @return map - */ - default Map toMap() { - JSONObject map = JSON.parseObject(JSON.toJSONString(this)); - return Maps.map(map, Function.identity(), Refs::json); - } - -} diff --git a/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/IPreferenceStrategy.java b/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/IPreferenceStrategy.java deleted file mode 100644 index 58e6bd7d..00000000 --- a/orion-visor-module-infra/orion-visor-module-infra-provider/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/IPreferenceStrategy.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.orion.visor.module.infra.handler.preference.strategy; - -import com.orion.visor.module.infra.handler.preference.model.PreferenceModel; - -/** - * 偏好处理策略 - * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/10/8 13:49 - */ -public interface IPreferenceStrategy { - - /** - * 获取默认值 - * - * @return 默认值 - */ - Model getDefault(); - -} diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/enums/PreferenceTypeEnum.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/enums/PreferenceTypeEnum.java index 83493575..abc999a5 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/enums/PreferenceTypeEnum.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/enums/PreferenceTypeEnum.java @@ -1,8 +1,10 @@ package com.orion.visor.module.infra.enums; -import com.orion.spring.SpringHolder; -import com.orion.visor.module.infra.handler.preference.model.PreferenceModel; -import com.orion.visor.module.infra.handler.preference.strategy.IPreferenceStrategy; +import com.orion.visor.framework.common.handler.data.GenericsDataDefinition; +import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; +import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy; +import com.orion.visor.module.infra.handler.preference.strategy.SystemPreferenceStrategy; +import com.orion.visor.module.infra.handler.preference.strategy.TerminalPreferenceStrategy; import lombok.Getter; /** @@ -13,32 +15,28 @@ import lombok.Getter; * @since 2023/10/8 11:31 */ @Getter -public enum PreferenceTypeEnum { +public enum PreferenceTypeEnum implements GenericsDataDefinition { /** * 系统偏好 */ - SYSTEM("systemPreferenceStrategy"), + SYSTEM(SystemPreferenceStrategy.class), /** * 终端偏好 */ - TERMINAL("terminalPreferenceStrategy"), + TERMINAL(TerminalPreferenceStrategy.class), ; - PreferenceTypeEnum(String beanName) { + PreferenceTypeEnum(Class> strategyClass) { this.type = this.name(); - this.beanName = beanName; + this.strategyClass = strategyClass; } private final String type; - /** - * 策越 bean 名称 - * 可能跨模块所以不用 class - */ - private final String beanName; + private final Class> strategyClass; public static PreferenceTypeEnum of(String type) { if (type == null) { @@ -52,15 +50,4 @@ public enum PreferenceTypeEnum { return null; } - /** - * 获取策略 - * - * @param model - * @param type - * @return IPreferenceStrategy - */ - public > T getStrategy() { - return SpringHolder.getBean(beanName); - } - } diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/SystemPreferenceModel.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/SystemPreferenceModel.java index 731ac309..e63b1288 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/SystemPreferenceModel.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/SystemPreferenceModel.java @@ -1,5 +1,6 @@ package com.orion.visor.module.infra.handler.preference.model; +import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,7 +17,7 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -public class SystemPreferenceModel implements PreferenceModel { +public class SystemPreferenceModel implements GenericsDataModel { /** * 是否使用侧边菜单 diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/TerminalPreferenceModel.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/TerminalPreferenceModel.java index 9dd05b41..eb2d8bd7 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/TerminalPreferenceModel.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/model/TerminalPreferenceModel.java @@ -2,6 +2,7 @@ package com.orion.visor.module.infra.handler.preference.model; import com.alibaba.fastjson.JSONObject; import com.orion.lang.able.IJsonObject; +import com.orion.visor.framework.common.handler.data.model.GenericsDataModel; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,7 +21,7 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -public class TerminalPreferenceModel implements PreferenceModel { +public class TerminalPreferenceModel implements GenericsDataModel { /** * 新建连接类型 diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/SystemPreferenceStrategy.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/SystemPreferenceStrategy.java index 5fc83f25..25029c9d 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/SystemPreferenceStrategy.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/handler/preference/strategy/SystemPreferenceStrategy.java @@ -1,5 +1,7 @@ package com.orion.visor.module.infra.handler.preference.strategy; +import com.orion.lang.utils.Exceptions; +import com.orion.visor.framework.common.handler.data.strategy.AbstractGenericsDataStrategy; import com.orion.visor.module.infra.handler.preference.model.SystemPreferenceModel; import org.springframework.stereotype.Component; @@ -10,8 +12,12 @@ import org.springframework.stereotype.Component; * @version 1.0.0 * @since 2023/10/8 13:48 */ -@Component("systemPreferenceStrategy") -public class SystemPreferenceStrategy implements IPreferenceStrategy { +@Component +public class SystemPreferenceStrategy extends AbstractGenericsDataStrategy { + + public SystemPreferenceStrategy() { + super(SystemPreferenceModel.class); + } @Override public SystemPreferenceModel getDefault() { @@ -28,4 +34,9 @@ public class SystemPreferenceStrategy implements IPreferenceStrategy { +@Component +public class TerminalPreferenceStrategy extends AbstractGenericsDataStrategy { + + public TerminalPreferenceStrategy() { + super(TerminalPreferenceModel.class); + } @Override public TerminalPreferenceModel getDefault() { @@ -24,7 +30,7 @@ public class TerminalPreferenceStrategy implements IPreferenceStrategy getDefaultPreferenceByType(String type, List items) { PreferenceTypeEnum preferenceType = Valid.valid(PreferenceTypeEnum::of, type); // 获取默认值 - Map defaultModel = preferenceType.getStrategy() + Map defaultModel = preferenceType.getStrategy() .getDefault() .toMap(); Map result = Maps.newMap(); if (Lists.isEmpty(items)) { - defaultModel.forEach((k, v) -> result.put(k, Refs.unref(defaultModel.get(k)))); + defaultModel.forEach((k, v) -> result.put(k, defaultModel.get(k))); } else { - items.forEach(s -> result.put(s, Refs.unref(defaultModel.get(s)))); + items.forEach(s -> result.put(s, defaultModel.get(s))); } return result; } @@ -218,9 +218,10 @@ public class PreferenceServiceImpl implements PreferenceService { // 初始化 if (Maps.isEmpty(config)) { // 获取默认值 - config = type.getStrategy() + Map defaultConfig = type.getStrategy() .getDefault() .toMap(); + config = Maps.map(defaultConfig, Function.identity(), Refs::json); // 插入默认值 List entities = config .entrySet() From af97f752f5bed90690a857a719b23f3495c35285 Mon Sep 17 00:00:00 2001 From: lijiahang Date: Wed, 12 Jun 2024 15:13:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:pencil:=20=E4=BF=AE=E6=94=B9=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=9C=B0=E5=9D=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 +++++++++---------- docker-upgrade.sh | 1 - orion-visor-dependencies/pom.xml | 2 +- .../orion-visor-framework-common/pom.xml | 2 +- .../framework/common/constant/AppConst.java | 6 ++--- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- orion-visor-framework/pom.xml | 2 +- orion-visor-launch/pom.xml | 2 +- .../src/main/resources/application.yaml | 4 ++-- .../orion-visor-module-asset-provider/pom.xml | 2 +- .../orion-visor-module-asset-service/pom.xml | 2 +- orion-visor-module-asset/pom.xml | 2 +- .../orion-visor-module-infra-provider/pom.xml | 2 +- .../orion-visor-module-infra-service/pom.xml | 2 +- orion-visor-module-infra/pom.xml | 2 +- .../src/components/app/app-footer/index.vue | 8 +++---- .../dashboard/workplace/components/docs.vue | 8 +++---- pom.xml | 2 +- sql/init-4-data.sql | 4 ++-- 33 files changed, 52 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index acd3e7e5..a843f9bd 100644 --- a/README.md +++ b/README.md @@ -13,27 +13,27 @@ + href="https://github.com/dromara/orion-visor/releases"> release - star + href="https://gitee.com/dromara/orion-visor/stargazers"> + star - fork + href="https://gitee.com/dromara/orion-visor/members"> + fork + href="https://github.com/dromara/orion-visor"> star + href="https://github.com/dromara/orion-visor"> star

@@ -53,7 +53,7 @@ * 🔗 演示地址: http://101.43.254.243:1081/ * 🔏 演示账号: admin/admin -* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/lijiahangmax/orion-visor) [gitee](https://gitee.com/lijiahangmax/orion-visor) +* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor) * 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目! * 🎭 演示环境部分功能不可用, 完整功能请本地部署! * 📛 演示环境请不要随便删除数据! @@ -63,7 +63,7 @@ ```bash # clone -git clone https://github.com/lijiahangmax/orion-visor +git clone https://github.com/dromara/orion-visor cd orion-visor # 启动 docker compose up -d @@ -131,8 +131,8 @@ docker compose up -d ## 免责声明 -在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/lijiahangmax/orion-visor/blob/main/DISCLAIMER.md) +在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/dromara/orion-visor/blob/main/DISCLAIMER.md) ## License -本项目遵循 [Apache-2.0](https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE) 开源许可证。 +本项目遵循 [Apache-2.0](https://github.com/dromara/orion-visor/blob/main/LICENSE) 开源许可证。 diff --git a/docker-upgrade.sh b/docker-upgrade.sh index 52f56f4e..3887bcfa 100644 --- a/docker-upgrade.sh +++ b/docker-upgrade.sh @@ -1,6 +1,5 @@ #/bin/bash docker compose down -sh ./pull.sh # demo 启动 if [ "$1" == "demo" ]; then sed -i 's/DEMO_MODE=false/DEMO_MODE=true/g' docker-compose.yml diff --git a/orion-visor-dependencies/pom.xml b/orion-visor-dependencies/pom.xml index 9cc9a61e..033d180c 100644 --- a/orion-visor-dependencies/pom.xml +++ b/orion-visor-dependencies/pom.xml @@ -11,7 +11,7 @@ ${project.artifactId} 项目所有依赖 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor 2.0.7 diff --git a/orion-visor-framework/orion-visor-framework-common/pom.xml b/orion-visor-framework/orion-visor-framework-common/pom.xml index 3d19c493..6b446405 100644 --- a/orion-visor-framework/orion-visor-framework-common/pom.xml +++ b/orion-visor-framework/orion-visor-framework-common/pom.xml @@ -14,7 +14,7 @@ jar 项目公共基准包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java index 89682f15..0f311534 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java @@ -18,10 +18,10 @@ public interface AppConst extends OrionConst { String ORION_VISOR = "orion-visor"; - String GITHUB = "https://github.com/lijiahangmax/orion-visor"; + String GITHUB = "https://github.com/dromara/orion-visor"; - String GITEE = "https://gitee.com/lijiahangmax/orion-visor"; + String GITEE = "https://gitee.com/dromara/orion-visor"; - String ISSUES = "https://github.com/lijiahangmax/orion-visor/issues"; + String ISSUES = "https://github.com/dromara/orion-visor/issues"; } diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-banner/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-banner/pom.xml index 0d62aa8f..a650c6d2 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-banner/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-banner/pom.xml @@ -14,7 +14,7 @@ jar 项目 banner 打印包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-biz-operator-log/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-biz-operator-log/pom.xml index 283b5a56..3859eaa3 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-biz-operator-log/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-biz-operator-log/pom.xml @@ -14,7 +14,7 @@ jar 项目操作日志包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-datasource/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-datasource/pom.xml index 3d7e864a..137ceed3 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-datasource/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-datasource/pom.xml @@ -14,7 +14,7 @@ jar 项目数据源配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-desensitize/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-desensitize/pom.xml index 35fd715a..db012646 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-desensitize/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-desensitize/pom.xml @@ -14,7 +14,7 @@ jar 项目数据脱敏包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-job/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-job/pom.xml index d9f6f371..b225ecf9 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-job/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-job/pom.xml @@ -14,7 +14,7 @@ jar 项目定时任务配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-log/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-log/pom.xml index e6f64d2e..e2e47972 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-log/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-log/pom.xml @@ -14,7 +14,7 @@ jar 项目日志配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-monitor/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-monitor/pom.xml index 5e1d50c9..7765d62a 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-monitor/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-monitor/pom.xml @@ -14,7 +14,7 @@ jar 项目监控配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/pom.xml index 5f994e23..ad4e9fdb 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/pom.xml @@ -14,7 +14,7 @@ jar 项目 mybatis 配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-redis/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-redis/pom.xml index b9da3058..449bd426 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-redis/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-redis/pom.xml @@ -14,7 +14,7 @@ jar 项目 redis 配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-security/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-security/pom.xml index 489db73a..691e2dba 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-security/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-security/pom.xml @@ -14,7 +14,7 @@ jar 项目 security 配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-storage/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-storage/pom.xml index d1d14429..07ec23b2 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-storage/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-storage/pom.xml @@ -14,7 +14,7 @@ jar 项目存储层配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-swagger/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-swagger/pom.xml index cd81bd72..323a9915 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-swagger/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-swagger/pom.xml @@ -14,7 +14,7 @@ jar 项目 swagger 配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-test/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-test/pom.xml index 00f68c39..9feb54cd 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-test/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-test/pom.xml @@ -14,7 +14,7 @@ jar 项目单元测试包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-web/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-web/pom.xml index d7d5e2ae..b2def1f8 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-web/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-web/pom.xml @@ -14,7 +14,7 @@ jar 项目 web 包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-websocket/pom.xml b/orion-visor-framework/orion-visor-spring-boot-starter-websocket/pom.xml index ebe78ea3..4508ce85 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-websocket/pom.xml +++ b/orion-visor-framework/orion-visor-spring-boot-starter-websocket/pom.xml @@ -14,7 +14,7 @@ jar 项目 websocket 配置包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-framework/pom.xml b/orion-visor-framework/pom.xml index 9e047423..dbaa7974 100644 --- a/orion-visor-framework/pom.xml +++ b/orion-visor-framework/pom.xml @@ -13,7 +13,7 @@ pom 项目组件包 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor orion-visor-framework-common diff --git a/orion-visor-launch/pom.xml b/orion-visor-launch/pom.xml index 7748b291..c2e14714 100644 --- a/orion-visor-launch/pom.xml +++ b/orion-visor-launch/pom.xml @@ -13,7 +13,7 @@ jar 后端服务主项目容器 按需引用 orion-visor-module-xxx 依赖 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-launch/src/main/resources/application.yaml b/orion-visor-launch/src/main/resources/application.yaml index d72dc6d1..19771a27 100644 --- a/orion-visor-launch/src/main/resources/application.yaml +++ b/orion-visor-launch/src/main/resources/application.yaml @@ -220,10 +220,10 @@ orion: title: orion-visor 运维平台 description: 一站式运维服务平台 version: ${orion.version} - url: https://github.com/lijiahangmax/orion-visor + url: https://github.com/dromara/orion-visor email: ljh1553488six@139.com license: Apache-2.0 - license-url: https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE + license-url: https://github.com/dromara/orion-visor/blob/main/LICENSE grouped-api: infra: group: "infra - 基建模块" diff --git a/orion-visor-module-asset/orion-visor-module-asset-provider/pom.xml b/orion-visor-module-asset/orion-visor-module-asset-provider/pom.xml index 43a9c052..787ab92b 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-provider/pom.xml +++ b/orion-visor-module-asset/orion-visor-module-asset-provider/pom.xml @@ -13,7 +13,7 @@ jar 项目资产模块 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/pom.xml b/orion-visor-module-asset/orion-visor-module-asset-service/pom.xml index 4fb0c273..d42203a8 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/pom.xml +++ b/orion-visor-module-asset/orion-visor-module-asset-service/pom.xml @@ -13,7 +13,7 @@ jar 项目资产模块 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-module-asset/pom.xml b/orion-visor-module-asset/pom.xml index ddc424ea..e9d7fbe0 100644 --- a/orion-visor-module-asset/pom.xml +++ b/orion-visor-module-asset/pom.xml @@ -13,7 +13,7 @@ pom 项目资产模块 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor orion-visor-module-asset-provider diff --git a/orion-visor-module-infra/orion-visor-module-infra-provider/pom.xml b/orion-visor-module-infra/orion-visor-module-infra-provider/pom.xml index 779e9b3d..3c70a8e8 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-provider/pom.xml +++ b/orion-visor-module-infra/orion-visor-module-infra-provider/pom.xml @@ -13,7 +13,7 @@ jar 项目基建模块 用户 菜单 日志等 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/pom.xml b/orion-visor-module-infra/orion-visor-module-infra-service/pom.xml index 82a41024..a0196e61 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/pom.xml +++ b/orion-visor-module-infra/orion-visor-module-infra-service/pom.xml @@ -13,7 +13,7 @@ jar 项目基建模块 用户 菜单 日志等 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor diff --git a/orion-visor-module-infra/pom.xml b/orion-visor-module-infra/pom.xml index 21271900..01b683f7 100644 --- a/orion-visor-module-infra/pom.xml +++ b/orion-visor-module-infra/pom.xml @@ -13,7 +13,7 @@ pom 项目基建模块 用户 菜单 日志等 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor orion-visor-module-infra-provider diff --git a/orion-visor-ui/src/components/app/app-footer/index.vue b/orion-visor-ui/src/components/app/app-footer/index.vue index 50257901..d1279776 100644 --- a/orion-visor-ui/src/components/app/app-footer/index.vue +++ b/orion-visor-ui/src/components/app/app-footer/index.vue @@ -2,11 +2,11 @@ - github - gitee + github + gitee 文档 - License - v{{ version }} {{ release }} + License + v{{ version }} {{ release }} Copyright 2023 - {{ new Date().getFullYear() }} Li Jiahang, All rights reserved. diff --git a/orion-visor-ui/src/views/dashboard/workplace/components/docs.vue b/orion-visor-ui/src/views/dashboard/workplace/components/docs.vue index dda6eb6a..65738d64 100644 --- a/orion-visor-ui/src/views/dashboard/workplace/components/docs.vue +++ b/orion-visor-ui/src/views/dashboard/workplace/components/docs.vue @@ -5,16 +5,16 @@ :body-style="{ padding: '0px 20px 8px 20px' }"> - github + github - gitee + gitee - License + License - 上报 bug + 上报 bug 操作手册 diff --git a/pom.xml b/pom.xml index 18956434..0d831372 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ${project.artifactId} 项目脚手架 - https://github.com/lijiahangmax/orion-visor + https://github.com/dromara/orion-visor orion-visor-dependencies diff --git a/sql/init-4-data.sql b/sql/init-4-data.sql index 8cdd91e1..9b7327f8 100644 --- a/sql/init-4-data.sql +++ b/sql/init-4-data.sql @@ -397,8 +397,8 @@ INSERT INTO `system_menu` VALUES (186, 184, '查询任务日志', 'asset:exec-jo INSERT INTO `system_menu` VALUES (187, 184, '删除任务日志', 'asset:exec-job-log:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-04-12 13:51:59', '1', '1', 0); INSERT INTO `system_menu` VALUES (189, 184, '清理任务日志', 'asset:exec-job-log:management:clear', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-04-12 13:51:58', '1', '1', 0); INSERT INTO `system_menu` VALUES (190, 184, '中断计划任务', 'asset:exec-job-log:interrupt', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-04-12 00:00:33', '1', '1', 0); -INSERT INTO `system_menu` VALUES (191, 0, '提交bug', NULL, 1, 1020, 1, 1, 0, 1, 'IconBug', 'https://github.com/lijiahangmax/orion-visor/issues', NULL, '2024-04-26 11:30:18', '2024-05-17 12:57:29', '1', '1', 0); -INSERT INTO `system_menu` VALUES (192, 0, '点个赞~', NULL, 1, 1030, 1, 1, 0, 1, 'IconThumbUp', 'https://github.com/lijiahangmax/orion-visor', NULL, '2024-04-26 11:32:30', '2024-05-17 12:57:32', '1', '1', 0); +INSERT INTO `system_menu` VALUES (191, 0, '提交bug', NULL, 1, 1020, 1, 1, 0, 1, 'IconBug', 'https://github.com/dromara/orion-visor/issues', NULL, '2024-04-26 11:30:18', '2024-06-12 14:03:29', '1', '1', 0); +INSERT INTO `system_menu` VALUES (192, 0, '点个赞~', NULL, 1, 1030, 1, 1, 0, 1, 'IconThumbUp', 'https://github.com/dromara/orion-visor', NULL, '2024-04-26 11:32:30', '2024-06-12 14:03:25', '1', '1', 0); INSERT INTO `system_menu` VALUES (193, 0, '计划任务', NULL, 1, 430, 1, 1, 1, 0, 'IconCalendarClock', NULL, 'jobModule', '2024-04-28 15:31:24', '2024-04-28 15:32:56', '1', '1', 0); INSERT INTO `system_menu` VALUES (194, 152, '在线会话', NULL, 2, 20, 1, 1, 1, 0, 'IconUserGroup', NULL, 'connectSession', '2024-05-07 11:12:17', '2024-05-07 11:12:35', '1', '1', 0); INSERT INTO `system_menu` VALUES (195, 194, '查询在线会话', 'asset:host-connect-session:management:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2024-05-07 11:13:16', '2024-05-07 11:13:16', '1', '1', 0); From f618aef988a006b05d2396a5ee0ba3cb0197aa4a Mon Sep 17 00:00:00 2001 From: lijiahang Date: Wed, 12 Jun 2024 15:14:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:bookmark:=20=E5=8D=87=E7=BA=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 6 +++--- docker/orion-visor-mysql/build.sh | 2 +- docker/orion-visor-redis/build.sh | 2 +- docker/orion-visor-service/build.sh | 2 +- orion-visor-dependencies/pom.xml | 2 +- .../com/orion/visor/framework/common/constant/AppConst.java | 2 +- orion-visor-ui/.env.development | 2 +- orion-visor-ui/.env.production | 2 +- orion-visor-ui/package.json | 2 +- pom.xml | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b103de8e..f32dd89f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.3' services: orion-visor-service: - image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.7 + image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.8 ports: - 1081:80 environment: @@ -20,7 +20,7 @@ services: - orion-visor-mysql - orion-visor-redis orion-visor-mysql: - image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.7 + image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.8 privileged: true ports: - 3307:3306 @@ -34,7 +34,7 @@ services: - /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files - /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql orion-visor-redis: - image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.7 + image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.8 privileged: true ports: - 6380:6379 diff --git a/docker/orion-visor-mysql/build.sh b/docker/orion-visor-mysql/build.sh index a12d2d7b..d79acb14 100644 --- a/docker/orion-visor-mysql/build.sh +++ b/docker/orion-visor-mysql/build.sh @@ -1,5 +1,5 @@ #/bin/bash -version=2.0.7 +version=2.0.8 cp -r ../../sql ./sql docker build -t orion-visor-mysql:${version} . rm -rf ./sql diff --git a/docker/orion-visor-redis/build.sh b/docker/orion-visor-redis/build.sh index d9629d7f..69bfe2a5 100644 --- a/docker/orion-visor-redis/build.sh +++ b/docker/orion-visor-redis/build.sh @@ -1,5 +1,5 @@ #/bin/bash -version=2.0.7 +version=2.0.8 docker build -t orion-visor-redis:${version} . docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version} docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version} diff --git a/docker/orion-visor-service/build.sh b/docker/orion-visor-service/build.sh index aaa4e01e..63f1cf8b 100644 --- a/docker/orion-visor-service/build.sh +++ b/docker/orion-visor-service/build.sh @@ -1,5 +1,5 @@ #/bin/bash -version=2.0.7 +version=2.0.8 mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar mv ../../orion-visor-ui/dist ./dist docker build -t orion-visor-service:${version} . diff --git a/orion-visor-dependencies/pom.xml b/orion-visor-dependencies/pom.xml index 033d180c..345b3fa7 100644 --- a/orion-visor-dependencies/pom.xml +++ b/orion-visor-dependencies/pom.xml @@ -14,7 +14,7 @@ https://github.com/dromara/orion-visor - 2.0.7 + 2.0.8 2.7.17 2.7.15 1.5.0 diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java index 0f311534..ce24c084 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/AppConst.java @@ -14,7 +14,7 @@ public interface AppConst extends OrionConst { /** * 同 ${orion.version} 迭代时候需要手动更改 */ - String VERSION = "2.0.7"; + String VERSION = "2.0.8"; String ORION_VISOR = "orion-visor"; diff --git a/orion-visor-ui/.env.development b/orion-visor-ui/.env.development index d09a8a7d..44992d18 100644 --- a/orion-visor-ui/.env.development +++ b/orion-visor-ui/.env.development @@ -1,6 +1,6 @@ VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api' VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive' -VITE_APP_VERSION= '2.0.7' +VITE_APP_VERSION= '2.0.8' VITE_APP_RELEASE= 'Community' VITE_SFTP_PREVIEW_MB= 2 VITE_DEMO_MODE= false diff --git a/orion-visor-ui/.env.production b/orion-visor-ui/.env.production index ff9b7c38..a66c39b0 100644 --- a/orion-visor-ui/.env.production +++ b/orion-visor-ui/.env.production @@ -1,6 +1,6 @@ VITE_API_BASE_URL= '/orion-visor/api' VITE_WS_BASE_URL= '/orion-visor/keep-alive' -VITE_APP_VERSION= '2.0.7' +VITE_APP_VERSION= '2.0.8' VITE_APP_RELEASE= 'Community' VITE_SFTP_PREVIEW_MB= 2 VITE_DEMO_MODE= false diff --git a/orion-visor-ui/package.json b/orion-visor-ui/package.json index afcf09d5..11ef6dce 100644 --- a/orion-visor-ui/package.json +++ b/orion-visor-ui/package.json @@ -1,7 +1,7 @@ { "name": "orion-visor-ui", "description": "Orion Visor UI", - "version": "2.0.7", + "version": "2.0.8", "private": true, "author": "Jiahang Li", "license": "Apache 2.0", diff --git a/pom.xml b/pom.xml index 0d831372..782b9abc 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ - 2.0.7 + 2.0.8 8 8 3.0.0-M5