From ab867228916f54e0cf737e0ead5fd35e4a50dc71 Mon Sep 17 00:00:00 2001 From: mingmen Date: Thu, 7 Sep 2023 10:29:53 +0800 Subject: [PATCH] rename BizModel to BizInfo --- .../builtin/handler/QueryAllBizHandler.java | 14 +++++++------- .../model/{BizModel.java => BizInfo.java} | 2 +- .../arklet/core/health/HealthService.java | 4 ++-- .../arklet/core/health/HealthServiceImpl.java | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) rename arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/{BizModel.java => BizInfo.java} (98%) diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java index a944cbf58..4018e9969 100644 --- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java +++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java @@ -21,7 +21,7 @@ import com.alipay.sofa.ark.spi.model.Biz; import com.alipay.sofa.serverless.arklet.core.command.builtin.BuiltinCommand; -import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizModel; +import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizInfo; import com.alipay.sofa.serverless.arklet.core.command.meta.AbstractCommandHandler; import com.alipay.sofa.serverless.arklet.core.command.meta.Command; import com.alipay.sofa.serverless.arklet.core.command.meta.Output; @@ -32,22 +32,22 @@ * @author mingmen * @date 2023/6/14 */ -public class QueryAllBizHandler extends AbstractCommandHandler> { +public class QueryAllBizHandler extends AbstractCommandHandler> { @Override - public Output> handle(InputMeta inputMeta) { + public Output> handle(InputMeta inputMeta) { List bizList = getOperationService().queryBizList(); - List bizModels = new ArrayList<>(bizList.size()); + List bizInfos = new ArrayList<>(bizList.size()); for (Biz biz : bizList) { - BizModel model = new BizModel(); + BizInfo model = new BizInfo(); model.setBizName(biz.getBizName()); model.setBizVersion(biz.getBizVersion()); model.setBizState(biz.getBizState()); model.setMainClass(biz.getMainClass()); model.setWebContextPath(biz.getWebContextPath()); - bizModels.add(model); + bizInfos.add(model); } - return Output.ofSuccess(bizModels); + return Output.ofSuccess(bizInfos); } @Override diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizInfo.java similarity index 98% rename from arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java rename to arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizInfo.java index 5cd4f36af..8d5130a95 100644 --- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizModel.java +++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizInfo.java @@ -22,7 +22,7 @@ * @author mingmen * @date 2023/6/14 */ -public class BizModel { +public class BizInfo { private String bizName; private String bizVersion; diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthService.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthService.java index f4322a7bd..175d0f584 100644 --- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthService.java +++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthService.java @@ -19,7 +19,7 @@ import com.alipay.sofa.serverless.arklet.core.ArkletComponent; import com.alipay.sofa.serverless.arklet.core.health.indicator.ArkletBaseIndicator; import com.alipay.sofa.serverless.arklet.core.health.model.Health; -import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizModel; +import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizInfo; import com.alipay.sofa.serverless.arklet.core.command.builtin.model.PluginModel; /** @@ -37,7 +37,7 @@ public interface HealthService extends ArkletComponent { Health queryModuleInfo(String type, String name, String version); - Health queryModuleInfo(BizModel bizModel); + Health queryModuleInfo(BizInfo bizInfo); Health queryModuleInfo(PluginModel pluginModel); diff --git a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java index 6ca4f0850..d0771b2bf 100644 --- a/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java +++ b/arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java @@ -30,7 +30,7 @@ import com.alipay.sofa.serverless.arklet.core.health.model.Constants; import com.alipay.sofa.serverless.arklet.core.health.model.Health; import com.alipay.sofa.serverless.arklet.core.health.model.PluginHealthMeta; -import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizModel; +import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizInfo; import com.alipay.sofa.serverless.arklet.core.command.builtin.model.PluginModel; import com.alipay.sofa.serverless.arklet.core.common.log.ArkletLogger; import com.alipay.sofa.serverless.arklet.core.common.log.ArkletLoggerFactory; @@ -99,7 +99,7 @@ public Health getHealth(String[] indicatorIds) { @Override public Health queryModuleInfo() { return Health.createHealth().putAllHealthData(queryMasterBiz()) - .putAllHealthData(queryModuleInfo(new BizModel())) + .putAllHealthData(queryModuleInfo(new BizInfo())) .putAllHealthData(queryModuleInfo(new PluginModel())); } @@ -110,10 +110,10 @@ public Health queryModuleInfo(String type, String name, String version) { AssertUtils.isTrue(StringUtils.isEmpty(type) || Constants.typeOfInfo(type), "illegal type: %s", type); if (StringUtils.isEmpty(type) || Constants.BIZ.equals(type)) { - BizModel bizModel = new BizModel(); - bizModel.setBizName(name); - bizModel.setBizVersion(version); - health.putAllHealthData(queryModuleInfo(bizModel)); + BizInfo bizInfo = new BizInfo(); + bizInfo.setBizName(name); + bizInfo.setBizVersion(version); + health.putAllHealthData(queryModuleInfo(bizInfo)); } if (StringUtils.isEmpty(type) || Constants.PLUGIN.equals(type)) { PluginModel pluginModel = new PluginModel(); @@ -128,8 +128,8 @@ public Health queryModuleInfo(String type, String name, String version) { } @Override - public Health queryModuleInfo(BizModel bizModel) { - String bizName = bizModel.getBizName(), bizVersion = bizModel.getBizVersion(); + public Health queryModuleInfo(BizInfo bizInfo) { + String bizName = bizInfo.getBizName(), bizVersion = bizInfo.getBizVersion(); Health health = Health.createHealth(); try { if (StringUtils.isEmpty(bizName) && StringUtils.isEmpty(bizVersion)) {