서버 관리 - 목록 구현 완료

This commit is contained in:
현성필
2023-05-17 10:03:03 +09:00
parent 2fae8ae0be
commit 1ad677cfdd
3 changed files with 185 additions and 11 deletions
@@ -5,6 +5,7 @@ import com.eactive.httpmockserver.common.search.ColumnSearchModel;
import com.eactive.httpmockserver.common.search.SearchCondition;
import com.eactive.httpmockserver.common.search.SearchModel;
import com.eactive.httpmockserver.server.entity.Server;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
@@ -17,17 +18,29 @@ public class ServerSearch implements BaseSearch<Server> {
private String basePath;
private int port;
private String port;
private List<String> checkedIdForDel;
@Override
public List<SearchModel> buildSearchCondition() {
List<SearchModel> models = new ArrayList<>();
models.add(new ColumnSearchModel("name", SearchCondition.LIKE, name));
models.add(new ColumnSearchModel("hostname", SearchCondition.LIKE, hostname));
models.add(new ColumnSearchModel("basePath", SearchCondition.LIKE, basePath));
models.add(new ColumnSearchModel("port", SearchCondition.EQUAL, port));
if (StringUtils.isNotEmpty(name)) {
models.add(new ColumnSearchModel("name", SearchCondition.LIKE, name));
}
if (StringUtils.isNotEmpty(hostname)) {
models.add(new ColumnSearchModel("hostname", SearchCondition.LIKE, hostname));
}
if (StringUtils.isNotEmpty(basePath)) {
models.add(new ColumnSearchModel("basePath", SearchCondition.LIKE, basePath));
}
if (StringUtils.isNotEmpty(port)) {
models.add(new ColumnSearchModel("port", SearchCondition.EQUAL, Integer.parseInt(port)));
}
return models;
}
@@ -56,11 +69,11 @@ public class ServerSearch implements BaseSearch<Server> {
this.basePath = basePath;
}
public int getPort() {
public String getPort() {
return port;
}
public void setPort(int port) {
public void setPort(String port) {
this.port = port;
}
@@ -71,10 +71,6 @@ public class Server {
this.port = port;
}
@Transient
public String getFullHostAddress() {
return scheme + "://" + hostname + (port == null ? "" : ":" + port) + basePath;
}
public boolean isEnabled() {
return enabled;
@@ -83,4 +79,10 @@ public class Server {
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Transient
public String getFullHostAddress() {
return scheme + "://" + hostname + (port == null ? "" : ":" + port) + basePath;
}
}