feat(cli): 增加服务分组方便批量启停服务

服务可以分在多个分组里
This commit is contained in:
2024-02-04 18:27:51 +08:00
parent b8607dbdc4
commit d155779952
8 changed files with 127 additions and 38 deletions

View File

@@ -1,6 +1,8 @@
package com.lanyuanxiaoyao.service.cli.core;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@@ -11,6 +13,7 @@ import java.util.Map;
*/
public class ServiceInfo {
private String name;
private List<String> groups = new ArrayList<>();
private Integer replicas = 0;
private String sourceJar;
private Map<String, Object> environments = new HashMap<>();
@@ -24,6 +27,14 @@ public class ServiceInfo {
this.name = name;
}
public List<String> getGroups() {
return groups;
}
public void setGroups(List<String> groups) {
this.groups = groups;
}
public Integer getReplicas() {
return replicas;
}
@@ -59,11 +70,12 @@ public class ServiceInfo {
@Override
public String toString() {
return "ServiceInfo{" +
"name='" + name + '\'' +
", replicas=" + replicas +
", sourceJar='" + sourceJar + '\'' +
", environments=" + environments +
", arguments=" + arguments +
'}';
"name='" + name + '\'' +
", groups=" + groups +
", replicas=" + replicas +
", sourceJar='" + sourceJar + '\'' +
", environments=" + environments +
", arguments=" + arguments +
'}';
}
}