Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
rename BizModel to BizInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
TomorJM committed Sep 7, 2023
1 parent 58378b0 commit ab86722
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,22 +32,22 @@
* @author mingmen
* @date 2023/6/14
*/
public class QueryAllBizHandler extends AbstractCommandHandler<InputMeta, List<BizModel>> {
public class QueryAllBizHandler extends AbstractCommandHandler<InputMeta, List<BizInfo>> {

@Override
public Output<List<BizModel>> handle(InputMeta inputMeta) {
public Output<List<BizInfo>> handle(InputMeta inputMeta) {
List<Biz> bizList = getOperationService().queryBizList();
List<BizModel> bizModels = new ArrayList<>(bizList.size());
List<BizInfo> bizInfos = new ArrayList<>(bizList.size());

Check warning on line 40 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java#L40

Added line #L40 was not covered by tests
for (Biz biz : bizList) {
BizModel model = new BizModel();
BizInfo model = new BizInfo();

Check warning on line 42 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java#L42

Added line #L42 was not covered by tests
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);

Check warning on line 48 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java#L48

Added line #L48 was not covered by tests
}
return Output.ofSuccess(bizModels);
return Output.ofSuccess(bizInfos);

Check warning on line 50 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/handler/QueryAllBizHandler.java#L50

Added line #L50 was not covered by tests
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author mingmen
* @date 2023/6/14
*/
public class BizModel {
public class BizInfo {

Check warning on line 25 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizInfo.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/command/builtin/model/BizInfo.java#L25

Added line #L25 was not covered by tests
private String bizName;

private String bizVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));

Check warning on line 103 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java#L101-L103

Added lines #L101 - L103 were not covered by tests
}

Expand All @@ -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));

Check warning on line 116 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java#L113-L116

Added lines #L113 - L116 were not covered by tests
}
if (StringUtils.isEmpty(type) || Constants.PLUGIN.equals(type)) {
PluginModel pluginModel = new PluginModel();
Expand All @@ -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();

Check warning on line 133 in arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java#L132-L133

Added lines #L132 - L133 were not covered by tests
try {
if (StringUtils.isEmpty(bizName) && StringUtils.isEmpty(bizVersion)) {
Expand Down

0 comments on commit ab86722

Please sign in to comment.