diff --git a/ozburst-all/mimeter-dashboard/README.md b/ozburst-all/mimeter-dashboard/README.md new file mode 100644 index 000000000..6d30898fc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/README.md @@ -0,0 +1 @@ +# 概述 \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/pom.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/pom.xml new file mode 100644 index 000000000..7b91d6731 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/pom.xml @@ -0,0 +1,43 @@ + + + + + mimeter-dashboard + run.mone + 1.0.0-SNAPSHOT + + 4.0.0 + + mimeter-dashboard-api + + + com.xiaomi.youpin + youpin-infra-rpc + 1.28-SNAPSHOT + provided + + + + com.xiaomi.mone + http-docs-core + 2.7.12-mone-v5-SNAPSHOT + provided + + + org.projectlombok + lombok + 1.18.24 + + + + com.xiaomi + dayu-api + 0.3.1-SNAPSHOT + + + + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyDTO.java new file mode 100644 index 000000000..d4e8d1ba3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyDTO.java @@ -0,0 +1,32 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class AgentApplyDTO implements Serializable { + private Integer id; + + @HttpApiDocClassDefine(value = "applyUser", required = true, description = "申请人", defaultValue = "dzx") + private String applyUser; + + @HttpApiDocClassDefine(value = "applyOrgId", required = true, description = "申请组织id", defaultValue = "DSGKBW") + private String applyOrgId; + + @HttpApiDocClassDefine(value = "applyOrgName", required = true, description = "申请组织中文名", defaultValue = "研发效能组") + private String applyOrgName; + + @HttpApiDocClassDefine(value = "agentIp", required = true, description = "压测机ip", defaultValue = "127.0.0.1") + private String agentIp; + + @HttpApiDocClassDefine(value = "agentHostname", required = true, description = "主机名", defaultValue = "xdwqd") + private String agentHostname; + + @HttpApiDocClassDefine(value = "applyStatus", required = true, description = "申请状态", defaultValue = "0:待审核 1:审核完成 2:拒绝") + private Integer applyStatus; + + @HttpApiDocClassDefine(value = "ctime", required = true, description = "申请时间", defaultValue = "") + private Long ctime; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyList.java new file mode 100644 index 000000000..f58a7c918 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyList.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentApplyList extends PageBase implements Serializable { + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "申请记录列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyReq.java new file mode 100644 index 000000000..c015c0a8d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentApplyReq.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentApplyReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIDs", required = true, description = "发压机Id列表", defaultValue = "") + List agentIDs; + + @HttpApiDocClassDefine(value = "applier", ignore = true) + String applier; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTO.java new file mode 100644 index 000000000..25532abeb --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTO.java @@ -0,0 +1,42 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentDTO implements Serializable { + + private Integer id; + + private String serverName; + + private String ip; + + private Integer port; + + private Integer cpu; + + private Long mem; + + private Integer useCpu; + + private Long useMem; + + private String hostname; + + private String clientDesc; + + private Long ctime; + + private Long utime; + + private Boolean enable; + + private String tenant; + + private String tenantCn; + + private List domainConfs; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTOList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTOList.java new file mode 100644 index 000000000..fb4f939b7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentDTOList.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentDTOList extends PageBase implements Serializable { + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "发压机信息列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentHostsConf.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentHostsConf.java new file mode 100644 index 000000000..45608c767 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentHostsConf.java @@ -0,0 +1,12 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentHostsConf implements Serializable { + private String agentIp; + private List domainConfs; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorBo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorBo.java new file mode 100644 index 000000000..a09f33cb5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorBo.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AgentMonitorBo implements Serializable { + private Long fromTime; + private Long toTime; + private List agentMonitorInfos; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorInfo.java new file mode 100644 index 000000000..c7351a004 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/AgentMonitorInfo.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class AgentMonitorInfo implements Serializable { + private String podIp; + private String nodeIp; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/ApplyStatusEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/ApplyStatusEnum.java new file mode 100644 index 000000000..5e29d0045 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/ApplyStatusEnum.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.agent; + +public enum ApplyStatusEnum { + + UnAuditing(0, "UnAuditing"), + ApplyPass(1, "ApplyPass"), + + ApplyRefuse(2, "ApplyRefuse"), + + ; + + + + public final int statusCode; + public final String statusName; + + ApplyStatusEnum(int statusCode, String statusName) { + this.statusCode = statusCode; + this.statusName = statusName; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DelHostForAgentsReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DelHostForAgentsReq.java new file mode 100644 index 000000000..485e9eaab --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DelHostForAgentsReq.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DelHostForAgentsReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIps", required = true, description = "发压机Ip列表", defaultValue = "127.0.0.1") + List agentIps; + @HttpApiDocClassDefine(value = "domain", required = true, description = "域名", defaultValue = "com.test.xxx") + String domain; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyByRateReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyByRateReq.java new file mode 100644 index 000000000..978194c84 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyByRateReq.java @@ -0,0 +1,23 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DomainApplyByRateReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIPs", required = true, description = "发压机Ip列表", defaultValue = "") + List agentIPs; + + @HttpApiDocClassDefine(value = "applier",ignore = true) + String applier; + + @HttpApiDocClassDefine(value = "domain",required = true,description = "要绑定的域名") + String domain; + + @HttpApiDocClassDefine(value = "domainIpAndRates",required = true,description = "ip和比例") + List domainIpAndRates; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyDTO.java new file mode 100644 index 000000000..71f6328ac --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyDTO.java @@ -0,0 +1,30 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DomainApplyDTO implements Serializable { + private Integer id; + + @HttpApiDocClassDefine(value = "applyUser", required = true, description = "申请人", defaultValue = "dzx") + private String applyUser; + + @HttpApiDocClassDefine(value = "ip", required = true, description = "绑定的ip", defaultValue = "127.0.0.1") + private String ip; + + @HttpApiDocClassDefine(value = "domain", required = true, description = "域名", defaultValue = "com.xiao.xxx") + private String domain; + + @HttpApiDocClassDefine(value = "applyStatus", required = true, description = "申请状态", defaultValue = "0:待审核 1:审核完成 2:拒绝") + private Integer applyStatus; + + @HttpApiDocClassDefine(value = "agentIpList", required = true, description = "绑定的机器ip列表", defaultValue = "") + private List agentIpList; + + @HttpApiDocClassDefine(value = "ctime", required = true, description = "申请时间", defaultValue = "") + private Long ctime; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyList.java new file mode 100644 index 000000000..53bf25050 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyList.java @@ -0,0 +1,36 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DomainApplyList extends PageBase implements Serializable { + + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "申请记录列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyReq.java new file mode 100644 index 000000000..e950ca638 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainApplyReq.java @@ -0,0 +1,23 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DomainApplyReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIPs", required = true, description = "发压机Ip列表", defaultValue = "") + List agentIPs; + + @HttpApiDocClassDefine(value = "applier",ignore = true) + String applier; + + @HttpApiDocClassDefine(value = "domain",required = true,description = "要绑定的域名") + String domain; + + @HttpApiDocClassDefine(value = "ip",required = true,description = "要绑定的ip",defaultValue = "127.0.0.1") + String ip; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainConf.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainConf.java new file mode 100644 index 000000000..46d0fc20f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainConf.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; +@Data +public class DomainConf implements Serializable { + private String domain; + private String ip; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainIpAndRate.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainIpAndRate.java new file mode 100644 index 000000000..3cca3e144 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/DomainIpAndRate.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DomainIpAndRate implements Serializable { + @HttpApiDocClassDefine(value = "ip",required = true,description = "要绑定的ip") + private String ip; + @HttpApiDocClassDefine(value = "rate",required = true,description = "比例,只能整数 10、20..100") + private Integer rate; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetAgentListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetAgentListReq.java new file mode 100644 index 000000000..514474567 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetAgentListReq.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetAgentListReq implements Serializable { + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetApplyListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetApplyListReq.java new file mode 100644 index 000000000..4034f0171 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/GetApplyListReq.java @@ -0,0 +1,39 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetApplyListReq implements Serializable { + + @HttpApiDocClassDefine(value = "applyUser", required = false, description = "申请人", defaultValue = "dzx") + private String applyUser; + + @HttpApiDocClassDefine(value = "applyStatus", required = true, description = "申请状态", defaultValue = "0:待审核 1:审核完成") + private Integer applyStatus; + + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/HostForAgentReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/HostForAgentReq.java new file mode 100644 index 000000000..e4a0dc3d0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/HostForAgentReq.java @@ -0,0 +1,17 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class HostForAgentReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIp", required = true, description = "发压机Ip", defaultValue = "127.0.0.1") + String agentIp; + @HttpApiDocClassDefine(value = "domain", required = true, description = "域名", defaultValue = "com.test.xxx") + String domain; + @HttpApiDocClassDefine(value = "ip", required = true, description = "绑定的ip", defaultValue = "127.0.0.1") + String ip; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/LoadHostsFileReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/LoadHostsFileReq.java new file mode 100644 index 000000000..c852a3ad3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/LoadHostsFileReq.java @@ -0,0 +1,12 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class LoadHostsFileReq implements Serializable { + @HttpApiDocClassDefine(value = "agentIp", required = true, description = "要获取发压机Ip", defaultValue = "127.0.0.1") + private String agentIp; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/SyncHostsReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/SyncHostsReq.java new file mode 100644 index 000000000..2eaa0f331 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/SyncHostsReq.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SyncHostsReq implements Serializable { + private List agentHostsConfList; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/TenantForAgentReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/TenantForAgentReq.java new file mode 100644 index 000000000..a5cc63a7a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/agent/TenantForAgentReq.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.agent; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TenantForAgentReq implements Serializable { + @HttpApiDocClassDefine(value = "agentID", required = true, description = "发压机Id", defaultValue = "66") + Integer agentID; + @HttpApiDocClassDefine(value = "tenant", required = true, description = "租户id", defaultValue = "xx/yy") + String tenant; + @HttpApiDocClassDefine(value = "tenantCn", required = true, description = "租户id 中文路径", defaultValue = ".../效能组") + String tenantCn; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointConditionEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointConditionEnum.java new file mode 100644 index 000000000..1bf541c79 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointConditionEnum.java @@ -0,0 +1,21 @@ +package run.mone.mimeter.dashboard.bo.common; + + +public enum CheckPointConditionEnum { + + BIGGER(1), + BIGGER_AND_EQ(2), + SMLLER(3), + SMALLER_AND_EQ(4), + EQ(5), + CONTAIN(6), + NOT_CONTAIN(7), + NOT_EQ(8), + ; + + public final int code; + + CheckPointConditionEnum(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointTypeEnum.java new file mode 100644 index 000000000..a139a5af7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CheckPointTypeEnum.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.common; + + +public enum CheckPointTypeEnum { + + STATUS_CODE(1), + HEADER_CODE(2), + OUTPUT_CODE(3); + + public final int code; + + CheckPointTypeEnum(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CommonEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CommonEnum.java new file mode 100644 index 000000000..6169f404a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/CommonEnum.java @@ -0,0 +1,37 @@ +package run.mone.mimeter.dashboard.bo.common; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CommonEnum implements Serializable { + private int code; + private String ChineseDesc; + private String EnglishDesc; + + private String unit; + + + public CommonEnum(int code, String ChineseDesc, String EnglishDesc) { + this.code = code; + this.ChineseDesc = ChineseDesc; + this.EnglishDesc = EnglishDesc; + } + + public CommonEnum(int code, String ChineseDesc) { + this.code = code; + this.ChineseDesc = ChineseDesc; + } + + public CommonEnum(String ChineseDesc, String EnglishDesc) { + this.ChineseDesc = ChineseDesc; + this.EnglishDesc = EnglishDesc; + } + + public CommonEnum(String ChineseDesc, String EnglishDesc, String unit) { + this.ChineseDesc = ChineseDesc; + this.EnglishDesc = EnglishDesc; + this.unit = unit; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Constants.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Constants.java new file mode 100644 index 000000000..06cc7ef5e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Constants.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.common; + + +public class Constants { + + public static final String MiOne_Tenant = "TEST"; + + public static final int STATUS_ON = 1; + public static final int STATUS_OFF = 2; + + public static final int DEGREE_WARN = 1; + public static final int DEGREE_ERROR = 2; + + public static final int TRUE = 1; + public static final int FALSE = 0; + + public static final int ROLE_ADMIN = 1; + public static final int ROLE_WORK = 2; + public static final int ROLE_GUEST = 3; + + public static final int HTTP_REQ_GET = 0; + public static final int HTTP_REQ_POST = 1; + + public static final int MI_API_HTTP_REQ_GET = 1; + public static final int MI_API_HTTP_REQ_POST = 0; + + public static final int REPORT_STATUS_RUNNING = 0; + + public static final int REPORT_STATUS_INACTIVE = 1; + + public static final int REPORT_STATUS_FINISH = 3; + + public static final int DEFAULT_PAGE_SIZE = 20; + + public static final int SINGLE_API_DEBUG = 0; + public static final int SCENE_DEBUG = 1; + public static final int SCENE_BENCH = 2; + + public static final int HTTP_API_TYPE = 1; + public static final int DUBBO_API_TYPE = 3; + public static final int GATEWAY_API_TYPE = 4; + + public static final String DEFAULT_EXPR_PREX = "params.toMap()"; + + public static final String DEFAULT_EXPR_JSON_PREX = "params.json()"; + + public static final String EXPR_INT_FLAG = "::int"; + + public static final String EXPR_BOOLEAN_FLAG = "::boolean"; + + public static final String EXPR_STRING_FLAG = "::string"; + + public static final String EXPR_LIST_FLAG = "::list["; + + public static final int SCENE_TYPE_HTTP = 0; + public static final int SCENE_TYPE_DUBBO = 1; + + + public static final int NACOS_TYPE_ST = 0; + public static final int NACOS_TYPE_OL = 1; + + public static final int SCENE_PARAM_DATA_TYPE_GLOBAL = 0; + public static final int SCENE_PARAM_DATA_TYPE_LINK = 1; + + public static final String CONTENT_TYPE_APP_JSON= "application/json"; + public static final String CONTENT_TYPE_APP_FORM= "application/x-www-form-urlencoded"; + public static final String CONTENT_TYPE_APP_FORM2= "x-www-form-urlencoded"; + + public static final String SKIP_MI_DUN_USER_NAME = "mone-skip-mi-dun-username"; + + public static final String PROJECT_NAME = "MiMeter"; + + public static final String NACOS_ST = "staging"; + public static final String NACOS_CN_ONLINE = "online"; + + public static final int CASE_TYPE_HTTP = 0; + public static final int CASE_TYPE_RPCX = 1; + + public static final int DEFAULT_SCENE_GROUP = 30001; + + public static final Long DEFAULT_API_TIMEOUT = 6000L; + + public static final int SCENE_ENV_ST = 0; + + public static final int SCENE_ENV_OL = 1; + + public static final long ONE_YEAR_MS = 1000 * 60 * 60 * 24 * 365L; + + + public static final String BENCH_BEGIN_MSG = "{\n" + + " \"config\": {\n" + + " \"wide_screen_mode\": true\n" + + " },\n" + + " \"header\": {\n" + + " \"title\": {\n" + + " \"tag\": \"plain_text\",\n" + + " \"content\": \"MiMeter压测平台消息通知\"\n" + + " }\n" + + " },\n" + + " \"elements\": [\n" + + " {\n" + + " \"tag\": \"hr\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"div\",\n" + + " \"text\": {\n" + + " \"tag\": \"plain_text\",\n" + + " \"content\": \"场景名: ${sceneName}\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"tag\": \"div\",\n" + + " \"text\": {\n" + + " \"tag\": \"plain_text\",\n" + + " \"content\": \"操作人: ${opUser}\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"tag\": \"div\",\n" + + " \"text\": {\n" + + " \"tag\": \"plain_text\",\n" + + " \"content\": \"压测时长:${benchTime}\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"tag\": \"div\",\n" + + " \"text\": {\n" + + " \"tag\": \"plain_text\",\n" + + " \"content\": \"压测量级:${totalRps}\"\n" + + " }\n" + + " },\n" + + " {\n" + + " \"tag\": \"hr\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"div\",\n" + + " \"text\": {\n" + + " \"tag\": \"lark_md\",\n" + + " \"content\": \"压测报告链接:https://test.com/report-detail?reportId=${reportId}&isRunning=1\"\n" + + " }\n" + + " }\n" + + " ]\n" + + "}"; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/EmitterTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/EmitterTypeEnum.java new file mode 100644 index 000000000..d12593639 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/EmitterTypeEnum.java @@ -0,0 +1,31 @@ +package run.mone.mimeter.dashboard.bo.common; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/30 + */ +public enum EmitterTypeEnum { + + FINISH("finish"), + + SLA_WARN("sla_warn"), + SLA_ERROR("sla_error"), + + TOTAL_STAT_ANALYSIS("total_stat_analysis") + ; + + private String value; + + EmitterTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PageBase.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PageBase.java new file mode 100644 index 000000000..29be272f0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PageBase.java @@ -0,0 +1,24 @@ +package run.mone.mimeter.dashboard.bo.common; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PageBase implements Serializable { + /** + * 当前的页码 + */ + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; + + /** + * 总记录数 + */ + @HttpApiDocClassDefine(value = "total", required = true, description = "总记录数", defaultValue = "100") + private long total = 0; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PagedResp.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PagedResp.java new file mode 100644 index 000000000..37ac1b0f1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/PagedResp.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/7 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class PagedResp { + + private long total; + + private T data; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Result.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Result.java new file mode 100644 index 000000000..c5af84eae --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/Result.java @@ -0,0 +1,75 @@ +package run.mone.mimeter.dashboard.bo.common; + + +import run.mone.mimeter.dashboard.exception.CommonError; + +import java.io.Serializable; + +/** + * http json 返回结果 + */ +public class Result implements Serializable { + + private int code; + private String message; + private T data; + + public Result() { + } + + public Result(int code, String message) { + this.code = code; + this.message = message; + } + + public Result(int code, String message, T data) { + this.code = code; + this.message = message; + this.data = data; + } + + public static Result success(T t) { + return new Result<>(0, "ok", t); + } + + public static Result fail(int code, String msg) { + return new Result(code, msg, null); + } + + public static Result fail(CommonError error) { + return new Result(error.code, error.message); + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + @Override + public String toString() { + return "Result{" + + "code=" + code + + ", message='" + message + '\'' + + ", data=" + data + + '}'; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/TestReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/TestReq.java new file mode 100644 index 000000000..be57d3ede --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/common/TestReq.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo.common; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TestReq implements Serializable { + private String uid; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetDto.java new file mode 100644 index 000000000..38b8db7f3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetDto.java @@ -0,0 +1,76 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class DatasetDto implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "数据源序号", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "name", required = true, description = "数据源名称", defaultValue = "数据源示例名") + private String name; + + @HttpApiDocClassDefine(value = "note", required = false, description = "数据源描述", defaultValue = "数据源示理描述") + private String note; + + @HttpApiDocClassDefine(value = "type", required = true, description = "数据源分类", defaultValue = "1") + private Integer type; + + @HttpApiDocClassDefine(value = "defaultParamName", required = false, description = "默认参数名", defaultValue = "paramName") + private String defaultParamName; + + @HttpApiDocClassDefine(value = "ignoreFirstRow", required = false, description = "忽略上传文件首行", defaultValue = "0") + private Integer ignoreFirstRow; + + @HttpApiDocClassDefine(value = "fileName", required = false, description = "文件名", defaultValue = "tmp.csv") + private String fileName; + + @HttpApiDocClassDefine(value = "fileUrl", required = false, description = "文件下载链接", defaultValue = "http://") + private String fileUrl; + + @HttpApiDocClassDefine(value = "fileKsKey", required = false, description = "文件位于云上的key", defaultValue = "xx/xxx/xx") + private String fileKsKey; + + @HttpApiDocClassDefine(value = "fileRows", required = false, description = "文件行数", defaultValue = "10") + private Long fileRows; + + @HttpApiDocClassDefine(value = "fileSize", required = false, description = "文件大小", defaultValue = "100") + private Long fileSize; + + @HttpApiDocClassDefine(value = "previewFileRows", required = false, description = "预览文件", defaultValue = "") + private List previewFileRows; + + @HttpApiDocClassDefine(value = "header", required = true, description = "请求header", defaultValue = "{\"X-Real-IP\":\"127.0.0.1\"}") + private Map header; + + @HttpApiDocClassDefine(value = "interfaceUrl", required = true, description = "接口url", defaultValue = "http://") + private String interfaceUrl; + + @HttpApiDocClassDefine(value = "trafficRecordId", required = false, description = "流量录制", defaultValue = "100") + private Integer trafficRecordId; + + @HttpApiDocClassDefine(value = "bindScenes", required = false, description = "引用场景", defaultValue = "") + private Map bindScenes; + + @HttpApiDocClassDefine(value = "ctime", required = false, description = "创建时间", defaultValue = "0") + private Long ctime; + + @HttpApiDocClassDefine(value = "utime", required = false, description = "更新时间", defaultValue = "1") + private Long utime; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "创建人") + private String creator; + + @HttpApiDocClassDefine(value = "updater", required = false, description = "更新人", defaultValue = "更新人") + private String updater; + + @HttpApiDocClassDefine(value = "tenant",ignore = true, description = "租户", defaultValue = "") + private String tenant; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLineNum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLineNum.java new file mode 100644 index 000000000..e28cf223b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLineNum.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DatasetLineNum implements Serializable { + Integer datasetId; + String fileName; + String fileUrl; + String fileKsKey; + Long fileRaw; + String defaultParamName; + Boolean ignoreFirstLine; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLinesReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLinesReq.java new file mode 100644 index 000000000..3f08abc34 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetLinesReq.java @@ -0,0 +1,17 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DatasetLinesReq implements Serializable { + private Integer datasetId; + private String fileUrl; + private String fileKsKey; + private String defaultParamName; + //读对应文件的起始行数 + private Integer from; + //读对应文件的最后一行 + private Integer to; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetList.java new file mode 100644 index 000000000..e115e830b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetList.java @@ -0,0 +1,36 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DatasetList extends PageBase implements Serializable { + + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "数据源列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetSceneRelationDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetSceneRelationDto.java new file mode 100644 index 000000000..b59fb1b9f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetSceneRelationDto.java @@ -0,0 +1,35 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class DatasetSceneRelationDto implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "序号", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "datasetId", required = true, description = "数据源序号", defaultValue = "1") + private Integer datasetId; + + @HttpApiDocClassDefine(value = "sceneId", required = true, description = "场景序号", defaultValue = "1") + private Integer sceneId; + + @HttpApiDocClassDefine(value = "ctime", required = false, description = "创建时间", defaultValue = "0") + private Long ctime; + + @HttpApiDocClassDefine(value = "utime", required = false, description = "更新时间", defaultValue = "1") + private Long utime; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "创建人") + private String creator; + + @HttpApiDocClassDefine(value = "updater", required = false, description = "更新人", defaultValue = "更新人") + private String updater; + + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetTypeEnum.java new file mode 100644 index 000000000..30d5ab0e7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/DatasetTypeEnum.java @@ -0,0 +1,33 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import java.util.Arrays; +import java.util.List; + +public enum DatasetTypeEnum { + + FileUpload(1, "FileUpload"), + TrafficRecord(2, "TrafficRecord"), + GlobalHeader(3, "GlobalHeader"), + DataOutput(4, "DataOutput"), + Interface(5, "Interface"); + + + + public int typeCode; + public String typeName; + + DatasetTypeEnum(int typeCode, String typeName) { + this.typeCode = typeCode; + this.typeName = typeName; + } + + public static List getDatasetTypes() { + return Arrays.asList( + FileUpload.typeCode, + TrafficRecord.typeCode, + GlobalHeader.typeCode, + DataOutput.typeCode, + Interface.typeCode + ); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/GetDatasetListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/GetDatasetListReq.java new file mode 100644 index 000000000..06ce7aabe --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/GetDatasetListReq.java @@ -0,0 +1,44 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetDatasetListReq implements Serializable { + + @HttpApiDocClassDefine(value = "datasetName", required = true, description = "数据源名称", defaultValue = "name") + private String datasetName; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "dingpei") + private String creator; + + @HttpApiDocClassDefine(value = "type", required = true, description = "数据源分类", defaultValue = "1") + private Integer type; + + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; + + @HttpApiDocClassDefine(value = "tenant",ignore = true, description = "租户", defaultValue = "") + private String tenant; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/ParamData.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/ParamData.java new file mode 100644 index 000000000..2e2544923 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/ParamData.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ParamData implements Serializable { + + @HttpApiDocClassDefine(value = "datasetId", required = true, description = "数据源id", defaultValue = "1") + private Integer datasetId; + + @HttpApiDocClassDefine(value = "paramName", required = true, description = "参数名", defaultValue = "key1") + private String paramName; + + @HttpApiDocClassDefine(value = "datasetName", required = true, description = "数据来源", defaultValue = "file.csv") + private String datasetName; + + @HttpApiDocClassDefine(value = "columnIndex", required = true, description = "索引列", defaultValue = "第1列") + private Integer columnIndex; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/PreviewFileRes.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/PreviewFileRes.java new file mode 100644 index 000000000..0a416e9a9 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/PreviewFileRes.java @@ -0,0 +1,25 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.util.List; + +/** + * @author dingpei + * @date 2022-07-15 + */ +@Data +public class PreviewFileRes { + + @HttpApiDocClassDefine(value = "fileName", required = false, description = "文件名", defaultValue = "tmp.csv") + private String fileName; + + @HttpApiDocClassDefine(value = "fileRows", required = false, description = "文件行数", defaultValue = "10") + private Long fileRows; + + @HttpApiDocClassDefine(value = "previewFileRows", required = false, description = "文件预览", defaultValue = "") + private List previewFileRows; + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneFileDetailRes.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneFileDetailRes.java new file mode 100644 index 000000000..ff8f9c5d7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneFileDetailRes.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.util.List; + +/** + * @author dingpei + * @date 2022-07-15 + */ +@Data +public class SceneFileDetailRes { + + @HttpApiDocClassDefine(value = "datasetLists",required = true,description = "文件列表") + List datasetLists; + + @HttpApiDocClassDefine(value = "paramDataList",required = true,description = "参数列表") + List paramDataList; + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneParamData.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneParamData.java new file mode 100644 index 000000000..2d6457cb3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/SceneParamData.java @@ -0,0 +1,17 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SceneParamData implements Serializable { + + @HttpApiDocClassDefine(value = "paramDataType", required = true, description = "参数类型 0:全局 1:链路", defaultValue = "1") + Integer paramDataType; + + @HttpApiDocClassDefine(value = "paramDataList", required = true, description = "参数列表") + List paramDataList; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/UploadFileRes.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/UploadFileRes.java new file mode 100644 index 000000000..fc258dfd4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/dataset/UploadFileRes.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.bo.dataset; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.util.List; + +/** + * @author dingpei + * @date 2022-07-15 + */ +@Data +public class UploadFileRes { + + @HttpApiDocClassDefine(value = "fileName", required = false, description = "文件名", defaultValue = "tmp.csv") + private String fileName; + + @HttpApiDocClassDefine(value = "fileUrl", required = false, description = "文件下载链接", defaultValue = "http://") + private String fileUrl; + + @HttpApiDocClassDefine(value = "fileKsKey", required = false, description = "文件位于云上的key", defaultValue = "xx/xxx/xx") + private String fileKsKey; + + @HttpApiDocClassDefine(value = "fileRows", required = false, description = "文件行数", defaultValue = "10") + private Long fileRows; + + @HttpApiDocClassDefine(value = "fileColumns", required = false, description = "文件列数", defaultValue = "3") + private int fileColumns; + + @HttpApiDocClassDefine(value = "fileSize", required = false, description = "文件大小", defaultValue = "100") + private Long fileSize; + + @HttpApiDocClassDefine(value = "firstRow", required = false, description = "首行", defaultValue = "") + private List firstRow; + + @HttpApiDocClassDefine(value = "previewFileRows", required = false, description = "文件预览", defaultValue = "") + private List previewFileRows; + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/openapi/OpenSceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/openapi/OpenSceneDTO.java new file mode 100644 index 000000000..4ac052731 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/openapi/OpenSceneDTO.java @@ -0,0 +1,31 @@ +package run.mone.mimeter.dashboard.bo.openapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.scene.SerialLinkDTO; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OpenSceneDTO implements Serializable { + + @HttpApiDocClassDefine(value = "name", required = true, description = "场景名", defaultValue = "测试场景1") + private String name; + + @HttpApiDocClassDefine(value = "remark", description = "备注", defaultValue = "这是一个http链路场景") + private String remark; + + @HttpApiDocClassDefine(value = "sceneType", description = "场景类型 0:http 1:dubbo", defaultValue = "1") + private Integer sceneType; + + @HttpApiDocClassDefine(value = "serialLinkDTOs", description = "串联链路信息列表") + private List serialLinkDTOs; + + @HttpApiDocClassDefine(value = "benchMode", required = true, description = "压力模式 0 RPS (目前仅支持该模式)", defaultValue = "0") + private Integer benchMode; + + @HttpApiDocClassDefine(value = "incrementMode", required = true, description = "递增模式 0 手动(Rps下仅支持手动模式)", defaultValue = "0") + private Integer incrementMode; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/GetOperationLogListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/GetOperationLogListReq.java new file mode 100644 index 000000000..79022f195 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/GetOperationLogListReq.java @@ -0,0 +1,41 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.operationlog; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetOperationLogListReq implements Serializable { + + @HttpApiDocClassDefine(value = "sceneId", required = false, description = "场景id", defaultValue = "1") + private int sceneId; + + @HttpApiDocClassDefine(value = "startTime", required = false, description = "开始时间", defaultValue = "13245432") + private long startTime; + + @HttpApiDocClassDefine(value = "endTime", required = false, description = "结束时间", defaultValue = "34223444") + private long endTime; + + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogDto.java new file mode 100644 index 000000000..f4832d066 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogDto.java @@ -0,0 +1,39 @@ +package run.mone.mimeter.dashboard.bo.operationlog; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OperationLogDto implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "操作记录序号", defaultValue = "1") + private Long id; + + @HttpApiDocClassDefine(value = "reportId", required = false, description = "报告id", defaultValue = "报告id") + private String reportId; + + @HttpApiDocClassDefine(value = "sceneId", required = false, description = "场景id", defaultValue = "1") + private Integer sceneId; + + @HttpApiDocClassDefine(value = "type", required = false, description = "分类", defaultValue = "1") + private Integer type; + + @HttpApiDocClassDefine(value = "content", required = false, description = "操作内容", defaultValue = "内容") + private String content; + + @HttpApiDocClassDefine(value = "supportOperation", required = false, description = "操作", defaultValue = "") + private List supportOperation; + + @HttpApiDocClassDefine(value = "createTime", required = false, description = "创建时间", defaultValue = "0") + private Long createTime; + + @HttpApiDocClassDefine(value = "updateTime", required = false, description = "更新时间", defaultValue = "1") + private Long updateTime; + + @HttpApiDocClassDefine(value = "createBy", required = false, description = "创建人", defaultValue = "创建人") + private String createBy; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogList.java new file mode 100644 index 000000000..2113147bf --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogList.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.operationlog; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OperationLogList extends PageBase implements Serializable { + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "操作记录列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogTypeEnum.java new file mode 100644 index 000000000..d9f957e33 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationLogTypeEnum.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.bo.operationlog; + +public enum OperationLogTypeEnum { + + NEW_OPERATION(1, "NEW"), + UPDATE_OPERATION(2, "UPDATE"), + DELETE_OPERATION(3, "DELETE"), + START_BENCH(4, "START_BENCH"), + STOP_BENCH(5, "STOP_BENCH"), + DEBUG_OPERATION(5, "DEBUG"); + + public int typeCode; + public String typeName; + + OperationLogTypeEnum(int typeCode, String typeName) { + this.typeCode = typeCode; + this.typeName = typeName; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationTypeEnum.java new file mode 100644 index 000000000..e33316d15 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/OperationTypeEnum.java @@ -0,0 +1,19 @@ +package run.mone.mimeter.dashboard.bo.operationlog; + +public enum OperationTypeEnum { + + VIEW_SNAPSHOT("VIEW_SNAPSHOT", "查看快照"), + VIEW_REPORT("VIEW_REPORT", "查看报告"), + DEBUG_RECORD("DEBUG_RECORD", "调试记录"), + COPY_SNAPSHOT("COPY_SNAPSHOT", "复制快照"); + + public String typeName; + + public String typeCname; + + OperationTypeEnum(String typeName, String typeCname) { + this.typeName = typeName; + this.typeCname = typeCname; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/PerOperation.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/PerOperation.java new file mode 100644 index 000000000..3b59d4a0a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/operationlog/PerOperation.java @@ -0,0 +1,25 @@ +package run.mone.mimeter.dashboard.bo.operationlog; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PerOperation implements Serializable { + + @HttpApiDocClassDefine(value = "operationName", required = false, description = "具体操作", defaultValue = "查看报告") + private String operationName; + + @HttpApiDocClassDefine(value = "operationType", required = false, description = "具体操作", defaultValue = "ViewReport") + private String operationType; + + @HttpApiDocClassDefine(value = "detailInfo", required = false, description = "操作对象", defaultValue = "dsgfds") + private String detailInfo; + + public PerOperation(String operationName, String operationType, String detailInfo) { + this.operationName = operationName; + this.operationType = operationType; + this.detailInfo = detailInfo; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ErrRateBo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ErrRateBo.java new file mode 100644 index 000000000..583e41e1d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ErrRateBo.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo.report; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ErrRateBo implements Serializable { + private String totalErrRate; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReportInfoBo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReportInfoBo.java new file mode 100644 index 000000000..b70616100 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReportInfoBo.java @@ -0,0 +1,81 @@ +package run.mone.mimeter.dashboard.bo.report; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ReportInfoBo implements Serializable { + + private Long id; + + private Long sceneId; + + private String snapshotId; + + private String reportId; + + private String reportName; + + @HttpApiDocClassDefine(value = "duration", description = "压测时长(秒)") + private Integer duration; + + @HttpApiDocClassDefine(value = "concurrency", description = "并发数") + private Integer concurrency; + + private Integer concurrencyMax; + + @HttpApiDocClassDefine(value = "createBy", description = "创建人用户名") + private String createBy; + + private String tenant; + + private Date createTime; + + private Date updateTime; + + private Integer status; + + private String filePath; + + @HttpApiDocClassDefine(value = "agents", description = "agents ip列表") + private String agents; + + private String linkToDagId; + + @HttpApiDocClassDefine(value = "extra", description = "扩展信息json") + private String extra; + + private Long finishTime; + + private String slaEventList; + + private String totalStatAnalysis; + + private String successRate; + + public boolean checkCreate() { + return this.sceneId != null && this.sceneId > 0 && + StringUtils.isNotBlank(this.reportId) && + StringUtils.isNotBlank(this.createBy); + } + + public boolean checkUpdate() { + return StringUtils.isNotBlank(this.reportId); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReqRespLogRecord.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReqRespLogRecord.java new file mode 100644 index 000000000..baa80eb99 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/ReqRespLogRecord.java @@ -0,0 +1,70 @@ +package run.mone.mimeter.dashboard.bo.report; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Builder; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/8/15 + */ +@Data +@Builder +public class ReqRespLogRecord { + + private Long timestamp; + + private boolean failed; + + private Long taskId; + + @HttpApiDocClassDefine(value = "apiType", required = true, description = "api类型,http:1, dubbo:3") + private Integer apiType; + + @HttpApiDocClassDefine(value = "uri", required = true, description = "http url或dubbo服务名") + private String uri; + + @HttpApiDocClassDefine(value = "method", required = true, description = "http或dubbo方法") + private String method; + + private Integer rt; + + @HttpApiDocClassDefine(value = "respCode", description = "响应状态码") + private Long code; + + private Long sceneId; + + @HttpApiDocClassDefine(value = "serialId", description = "链路id") + private Long serialId; + + @HttpApiDocClassDefine(value = "reportId", description = "报告id") + private String reportId; + + @HttpApiDocClassDefine(value = "apiId", description = "api id") + private Long apiId; + + @HttpApiDocClassDefine(value = "traceId", description = "traceId") + private String traceId; + + @HttpApiDocClassDefine(value = "params", description = "请求body") + private String params; + + @HttpApiDocClassDefine(value = "result", description = "返回结果") + private String result; + + private String errorInfo; + + private String reqHeaders; + + private String respHeaders; + + public boolean validate() { + return this.taskId != null && this.taskId > 0 && + StringUtils.isNotBlank(this.uri) && StringUtils.isNotBlank(this.method) && + StringUtils.isNotBlank(this.method) && this.rt != null && this.rt > 0 && + this.code != null && this.sceneId != null && this.sceneId > 0 && + this.result != null && StringUtils.isNotBlank(this.reportId); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/RmReportReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/RmReportReq.java new file mode 100644 index 000000000..1ea9aa28e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/RmReportReq.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.report; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class RmReportReq implements Serializable { + @HttpApiDocClassDefine(value = "reportIds", required = true) + List reportIds; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/SearchApiLogReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/SearchApiLogReq.java new file mode 100644 index 000000000..16b23286e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/report/SearchApiLogReq.java @@ -0,0 +1,67 @@ +package run.mone.mimeter.dashboard.bo.report; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/8/15 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SearchApiLogReq { + + @HttpApiDocClassDefine(value = "sceneId") + private Long sceneId; + + @HttpApiDocClassDefine(value = "taskId", required = true) + private Long taskId; + + @HttpApiDocClassDefine(value = "serialId", description = "链路id") + private Long serialId; + + @HttpApiDocClassDefine(value = "reportId", description = "报告id") + private String reportId; + + @HttpApiDocClassDefine(value = "apiId", description = "api id") + private Long apiId; + + @HttpApiDocClassDefine(value = "apiUri", description = "http url或dubbo服务名") + private String apiUri; + + @HttpApiDocClassDefine(value = "apiMethod", description = "http或dubbo方法") + private String apiMethod; + + @HttpApiDocClassDefine(value = "rtMin", description = "最小rt") + private Long rtMin; + + @HttpApiDocClassDefine(value = "rtMax", description = "最大rt") + private Long rtMax; + + @HttpApiDocClassDefine(value = "failed", description = "是否失败") + private Boolean failed; + + @HttpApiDocClassDefine(value = "respCode", description = "响应状态码") + private Integer respCode; + + @HttpApiDocClassDefine(value = "startTs", description = "开始时间戳") + private Long startTs; + + @HttpApiDocClassDefine(value = "endTs", description = "结束时间戳") + private Long endTs; + + @HttpApiDocClassDefine(value = "traceId", description = "traceId") + private String traceId; + + @HttpApiDocClassDefine(value = "pageNo", required = true) + private Integer pageNo; + + @HttpApiDocClassDefine(value = "pageSize", required = true) + private Integer pageSize; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/ApiBenchInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/ApiBenchInfo.java new file mode 100644 index 000000000..b2c0d7360 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/ApiBenchInfo.java @@ -0,0 +1,38 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +@Data +public class ApiBenchInfo implements Serializable,Comparable { + + @HttpApiDocClassDefine(value = "apiOrder",required = true,description = "接口顺序",defaultValue = "1") + private Integer apiOrder; + + @HttpApiDocClassDefine(value = "serialName",required = true,description = "链路名",defaultValue = "串联链路1") + private String serialName; + + @HttpApiDocClassDefine(value = "apiName",description = "接口名称",defaultValue = "压测百度") + private String apiName; + + @HttpApiDocClassDefine(value = "maxRps",description = "最大接口Rps",defaultValue = "2300") + private Integer maxRps; + + @HttpApiDocClassDefine(value = "originRps",description = "起始接口Rps",defaultValue = "10") + private Integer originRps; + + @HttpApiDocClassDefine(value = "linkOriRps",description = "链路起始rps",defaultValue = "10") + private Integer linkOriRps; + + @HttpApiDocClassDefine(value = "linkTps",description = "链路最大rps",defaultValue = "100") + private Integer linkTps; + + @HttpApiDocClassDefine(value = "linkBenchTime",description = "链路施压时间",defaultValue = "30") + private Integer linkBenchTime; + + @Override + public int compareTo(ApiBenchInfo apiBenchInfo) { + return this.apiOrder.compareTo(apiBenchInfo.apiOrder); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BasicSceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BasicSceneDTO.java new file mode 100644 index 000000000..b12e3e3b7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BasicSceneDTO.java @@ -0,0 +1,43 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class BasicSceneDTO implements Serializable { + @HttpApiDocClassDefine(value = "id", required = true, description = "场景id", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "name", required = true, description = "场景名", defaultValue = "测试场景1") + private String name; + + @HttpApiDocClassDefine(value = "remark", description = "备注", defaultValue = "这是一个http链路场景") + private String remark; + + @HttpApiDocClassDefine(value = "status", description = "场景状态 0 待启动 1 执行中", defaultValue = "1") + private Integer status; + + @HttpApiDocClassDefine(value = "benchTime", required = true, description = "施压时间(s)", defaultValue = "60") + private Integer benchTime; + + @HttpApiDocClassDefine(value = "sceneType", required = true, description = "场景类型 0:http 1:dubbo", defaultValue = "1") + private Integer sceneType; + + @HttpApiDocClassDefine(value = "curReportId", required = true, description = "当前报告id", defaultValue = "1jhlq3r1") + private String curReportId; + + @HttpApiDocClassDefine(value = "creator", required = true, description = "创建人", defaultValue = "dongzhenxing") + private String creator; + + @HttpApiDocClassDefine(value = "rpsRate", required = true, description = "rps比例", defaultValue = "10") + private Integer rpsRate; + + @HttpApiDocClassDefine(value = "uTime", required = true, description = "更新时间", defaultValue = "1124141241241") + private Long uTime; + + @HttpApiDocClassDefine(value = "cTime", required = true, description = "创建时间", defaultValue = "1124141241241") + private Long cTime; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchCalendar.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchCalendar.java new file mode 100644 index 000000000..e70553a13 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchCalendar.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class BenchCalendar implements Serializable { + private List benchDateList; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchDate.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchDate.java new file mode 100644 index 000000000..9d5c9131f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/BenchDate.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class BenchDate implements Serializable { + @HttpApiDocClassDefine(value = "benchCalendar", description = "该日期压测次数", defaultValue = "3") + private Integer dateBenchCount; + @HttpApiDocClassDefine(value = "benchCalendar", description = "压测日期", defaultValue = "2022-12-06") + private String benchDate; + @HttpApiDocClassDefine(value = "benchCalendar", ignore = true,description = "时间戳", defaultValue = "") + private Long timestamp; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/CreateSceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/CreateSceneDTO.java new file mode 100644 index 000000000..9d1b09c94 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/CreateSceneDTO.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CreateSceneDTO extends SceneDTO implements Serializable { + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DefaultSceneInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DefaultSceneInfo.java new file mode 100644 index 000000000..7bc38dd15 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DefaultSceneInfo.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DefaultSceneInfo implements Serializable { + + String defaultSceneName; + String sceneType; + Object apiInfo; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DubboApiInfoDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DubboApiInfoDTO.java new file mode 100644 index 000000000..d32439dde --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/DubboApiInfoDTO.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneDubboApiInfoItemDetail; + +import java.io.Serializable; + +@Data +public class DubboApiInfoDTO extends SceneDubboApiInfoItemDetail implements Serializable,Comparable { + + @HttpApiDocClassDefine(value = "sourceType", required = true, description = "接口来源类型 1:mi-api 2:手动添加", defaultValue = "1") + private Integer sourceType; + + @HttpApiDocClassDefine(value = "requestTimeout", description = "dubbo接口即的请求超时时间 ms", defaultValue = "500") + private Integer requestTimeout; + + @Override + public int compareTo(DubboApiInfoDTO dubboApiInfoDTO) { + return getApiOrder().compareTo(dubboApiInfoDTO.getApiOrder()); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/EditSceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/EditSceneDTO.java new file mode 100644 index 000000000..9c5dad560 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/EditSceneDTO.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class EditSceneDTO extends SceneDTO implements Serializable { + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListByIdsReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListByIdsReq.java new file mode 100644 index 000000000..db651284c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListByIdsReq.java @@ -0,0 +1,33 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class GetSceneListByIdsReq implements Serializable { + + @HttpApiDocClassDefine(value = "sceneIdList",required = true,description = "场景id列表") + private List sceneIdList; + + @HttpApiDocClassDefine(value = "sceneType",required = false,description = "场景类型 0:http 1:dubbo ") + private Integer sceneType; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListReq.java new file mode 100644 index 000000000..84373daf4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GetSceneListReq.java @@ -0,0 +1,44 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetSceneListReq implements Serializable { + + @HttpApiDocClassDefine(value = "page") + private int page; + + @HttpApiDocClassDefine(value = "pageSize") + private int pageSize; + + @HttpApiDocClassDefine(value = "keyword", required = false) + private String keyword; + + @HttpApiDocClassDefine(value = "sceneType", required = false, description = "场景类型 0:http 1:dubbo ") + private Integer sceneType; + + @HttpApiDocClassDefine(value = "status", description = "筛选场景状态 0:待运行、1:运行成功、4:运行中、5:已停止") + private Integer status; + + @HttpApiDocClassDefine(value = "tenant", ignore = true, required = false) + private String tenant; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GlobalHeader.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GlobalHeader.java new file mode 100644 index 000000000..bf25e15c7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/GlobalHeader.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GlobalHeader implements Serializable { + private String headerName; + private String headerValue; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/HttpApiInfoDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/HttpApiInfoDTO.java new file mode 100644 index 000000000..8663c79da --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/HttpApiInfoDTO.java @@ -0,0 +1,42 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.sceneapi.ApiTrafficInfo; +import run.mone.mimeter.dashboard.bo.sceneapi.ApiX5Info; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneHttpApiInfoItemDetail; + +import java.io.Serializable; + +@Data +public class HttpApiInfoDTO extends SceneHttpApiInfoItemDetail implements Serializable,Comparable{ + + @HttpApiDocClassDefine(value = "sourceType", required = true, description = "接口来源类型 1:mi-api 2:手动添加", defaultValue = "1") + private Integer sourceType; + + @HttpApiDocClassDefine(value = "requestTimeout", description = "接口即的请求超时时间 ms", defaultValue = "500") + private Integer requestTimeout; + + @HttpApiDocClassDefine(value = "needLogin",ignore = true, description = "该接口是否需要登录", defaultValue = "false") + private Boolean needLogin; + + @HttpApiDocClassDefine(value = "apiTspAuth", description = "单接口汽车部tsp验权信息,若配置将覆盖全局", defaultValue = "") + private TspAuthInfo apiTspAuth; + + @HttpApiDocClassDefine(value = "apiTrafficInfo", description = "该接口的流量录制配置", defaultValue = "") + private ApiTrafficInfo apiTrafficInfo; + + @HttpApiDocClassDefine(value = "apiX5Info", description = "该接口使用x5鉴权的信息", defaultValue = "") + private ApiX5Info apiX5Info; + + @HttpApiDocClassDefine(value = "tokenType", ignore = true,description = "该接口使用的token业务类别", defaultValue = "1") + private Integer tokenType; + + @HttpApiDocClassDefine(value = "contentType", description = "post请求数据格式类型", defaultValue = "application/json") + private String contentType; + + @Override + public int compareTo(HttpApiInfoDTO httpApiInfoDTO) { + return getApiOrder().compareTo(httpApiInfoDTO.getApiOrder()); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneDTO.java new file mode 100644 index 000000000..e492dd997 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneDTO.java @@ -0,0 +1,122 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.agent.AgentDTO; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class SceneDTO implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "场景id", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "name", required = true, description = "场景名", defaultValue = "测试场景1") + private String name; + + @HttpApiDocClassDefine(value = "groupID", required = true, description = "所属分组id", defaultValue = "1") + private Integer groupID; + + @HttpApiDocClassDefine(value = "creator", description = "创建人", defaultValue = "dzx") + private String creator; + + @HttpApiDocClassDefine(value = "更新人", description = "更新人", defaultValue = "dzx") + private String updater; + + @HttpApiDocClassDefine(value = "uTime", required = true, description = "更新时间", defaultValue = "1124141241241") + private Long uTime; + + @HttpApiDocClassDefine(value = "cTime", required = true, description = "创建时间", defaultValue = "1124141241241") + private Long cTime; + + @HttpApiDocClassDefine(value = "benchCount", required = true, description = "压测次数", defaultValue = "12") + private Integer benchCount; + + @HttpApiDocClassDefine(value = "lastBenchTime", required = true, description = "最近压测时间", defaultValue = "1234234422") + private Long lastBenchTime; + + @HttpApiDocClassDefine(value = "apiNum", required = true, description = "有效接口数", defaultValue = "12") + private Integer apiNum; + + @HttpApiDocClassDefine(value = "remark", description = "备注", defaultValue = "这是一个http链路场景") + private String remark; + + @HttpApiDocClassDefine(value = "sceneType", description = "场景类型 0:http 1:dubbo", defaultValue = "1") + private Integer sceneType; + + @HttpApiDocClassDefine(value = "serialLinkDTOs", description = "串联链路信息列表") + private List serialLinkDTOs; + + @HttpApiDocClassDefine(value = "benchMode", required = true, description = "压力模式 0 RPS (目前仅支持该模式)", defaultValue = "0") + private Integer benchMode; + + @HttpApiDocClassDefine(value = "incrementMode", required = true, description = "rps模式下,0 固定rps、1 手动控制rps、2 百分比递增", defaultValue = "0") + private Integer incrementMode; + + @HttpApiDocClassDefine(value = "increasePercent", description = "rps百分比递增模式下,可选 5、10、20、25、50,默认10", defaultValue = "10") + private Integer increasePercent; + + @HttpApiDocClassDefine(value = "benchTime", required = true, description = "施压时间(s)", defaultValue = "60") + private Integer benchTime; + + @HttpApiDocClassDefine(value = "maxBenchQps", required = true, description = "最大施压qps(s)", defaultValue = "60") + private Integer maxBenchQps; + + @HttpApiDocClassDefine(value = "rpsRate", required = true, description = "施压比例,百分比", defaultValue = "60") + private Integer rpsRate; + + @HttpApiDocClassDefine(value = "apiBenchInfos", description = "场景各接口施压配置,最大、起始RPS,json格式", defaultValue = "") + private List apiBenchInfos; + + @HttpApiDocClassDefine(value = "slaBo", description = "SLA配置", defaultValue = "") + private SlaDto slaDto; + + @HttpApiDocClassDefine(value = "datasetIds", description = "数据集id列表", defaultValue = "") + private List datasetIds; + + @HttpApiDocClassDefine(value = "refDatasetIds", description = "引用的数据集id列表", defaultValue = "") + private Map refDatasetIds; + + @HttpApiDocClassDefine(value = "logRate", description = "日志采样率 百分比", defaultValue = "50") + private Integer logRate; + + @HttpApiDocClassDefine(value = "requestTimeout", description = "通用请求超时时间 ms", defaultValue = "500") + private Integer requestTimeout; + + @HttpApiDocClassDefine(value = "successCode", description = "请求成功状态码(默认200) ", defaultValue = "400,300") + private String successCode; + + @HttpApiDocClassDefine(value = "globalTspAuth", description = "全局汽车部tsp验权信息", defaultValue = "") + private TspAuthInfo globalTspAuth; + + @HttpApiDocClassDefine(value = "globalHeaderList", required = true, description = "全局header", defaultValue = "全局请求头") + private List globalHeaderList; + + @HttpApiDocClassDefine(value = "agentIdList", required = true, description = "绑定的压测机id列表", defaultValue = "") + private List agentIdList; + + @HttpApiDocClassDefine(value = "agentDTOList", required = true, description = "绑定的压测机信息列表", defaultValue = "") + private List agentDTOList; + + @HttpApiDocClassDefine(value = "sceneEnv", description = "场景环境 ", defaultValue = "500") + private Integer sceneEnv; + + @HttpApiDocClassDefine(value = "tenant",ignore = true, description = "租户", defaultValue = "") + private String tenant; + + @HttpApiDocClassDefine(value = "sceneSource",description = "场景来源", defaultValue = "0:控制台创建 1:openapi创建") + private Integer sceneSource; + + @HttpApiDocClassDefine(value = "useSla", description = "是否使用sla", defaultValue = "0:否,1:是") + private Integer useSla; + + @HttpApiDocClassDefine(value = "personsInCharge", description = "负责人列表", defaultValue = "") + private List personsInCharge; + + @HttpApiDocClassDefine(value = "benchCalendar", description = "压测日历", defaultValue = "") + private BenchCalendar benchCalendar; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneList.java new file mode 100644 index 000000000..d24d88ea5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneList.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SceneList extends PageBase implements Serializable { + + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneSnapshotBo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneSnapshotBo.java new file mode 100644 index 000000000..a3f78fcc8 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneSnapshotBo.java @@ -0,0 +1,49 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/23 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SceneSnapshotBo { + + private Long id; + + private Integer type; + + private Long sceneId; + + private String snapshotId; + + private Date createTime; + + private Date updateTime; + + private String createBy; + + private Integer version; + + @HttpApiDocClassDefine(value = "md5", description = "场景快照数据sha256") + private String md5; + + @HttpApiDocClassDefine(value = "scene", description = "场景快照json数据, SceneDTO") + private String scene; + + public boolean checkCreate() { + return this.sceneId != null && this.sceneId > 0 && StringUtils.isNotBlank(this.createBy) && + StringUtils.isNotBlank(this.scene); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneTaskAppsBo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneTaskAppsBo.java new file mode 100644 index 000000000..bbbccd968 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SceneTaskAppsBo.java @@ -0,0 +1,33 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SceneTaskAppsBo implements Serializable { + private String sceneTask; + private Long fromTime; + private Long toTime; + + private List serialLinks; + + @Data + public static class LinkTaskAppsBo implements Serializable { + private String serialLinkName; + private String serialLinkId; + private List apis; + } + + @Data + public static class ApiTaskAppsBo implements Serializable { + private String apiName; + private String apiId; + private List apps; + } + + + +} + diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SerialLinkDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SerialLinkDTO.java new file mode 100644 index 000000000..4c5afd421 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/SerialLinkDTO.java @@ -0,0 +1,32 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SerialLinkDTO implements Serializable { + + @HttpApiDocClassDefine(value = "httpApiInfoDTOList", description = "绑定的接口列表,http场景") + private List httpApiInfoDTOList; + + @HttpApiDocClassDefine(value = "dubboApiInfoDTOList", description = "绑定的接口列表,dubbo场景") + private List dubboApiInfoDTOList; + + @HttpApiDocClassDefine(value = "serialLinkID",required = false, description = "接口所属链路id,更新时使用,新增不需要", defaultValue = "12") + private Integer serialLinkID; + + @HttpApiDocClassDefine(value = "serialLinkName",required = true, description = "接口所属链路名", defaultValue = "串联链路1") + private String serialLinkName; + + @HttpApiDocClassDefine(value = "enable",required = true, description = "压测时是否启用该接口", defaultValue = "true") + private Boolean enable; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/TspAuthInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/TspAuthInfo.java new file mode 100644 index 000000000..aed95c9f4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scene/TspAuthInfo.java @@ -0,0 +1,29 @@ +package run.mone.mimeter.dashboard.bo.scene; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TspAuthInfo implements Serializable { + @HttpApiDocClassDefine(value = "enableAuth", description = "是否启用TSP验权", defaultValue = "false") + private boolean enableAuth; + @HttpApiDocClassDefine(value = "accessKey", description = "TSP验权的 accessKey", defaultValue = "xxxx") + private String accessKey; + @HttpApiDocClassDefine(value = "secretKey", description = "TSP验权的 secretKey", defaultValue = "xxxx") + private String secretKey; + + public TspAuthInfo(boolean enableAuth) { + this.enableAuth = enableAuth; + } + + public TspAuthInfo() { + } + + public TspAuthInfo(boolean enableAuth, String accessKey, String secretKey) { + this.enableAuth = enableAuth; + this.accessKey = accessKey; + this.secretKey = secretKey; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiHeader.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiHeader.java new file mode 100644 index 000000000..0cb8a96db --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiHeader.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiHeader implements Serializable { + private String headerName; + private String headerValue; + + public ApiHeader(String headerName, String headerValue) { + this.headerName = headerName; + this.headerValue = headerValue; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiTrafficInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiTrafficInfo.java new file mode 100644 index 000000000..e3ef2d6b9 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiTrafficInfo.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +/** + * todo 目前尚未支持dubbo的流量录制后续支持后续另加 dubbo 相关 + */ +@Data +public class ApiTrafficInfo implements Serializable { + @HttpApiDocClassDefine(value = "enableTraffic", description = "是否使用录制的流量", defaultValue = "false") + private boolean enableTraffic; + + @HttpApiDocClassDefine(value = "url", description = "录制的网关url", defaultValue = "/mtop/test/api") + private String url; + + @HttpApiDocClassDefine(value = "fromTime", description = "录制参数的时间范围起点", defaultValue = "141242112") + private long fromTime; + + @HttpApiDocClassDefine(value = "toTime", description = "录制参数的的时间范围终点", defaultValue = "141242112") + private long toTime; + + @HttpApiDocClassDefine(value = "recordingConfigId", description = "录制配置id", defaultValue = "31") + private Integer recordingConfigId; + + public ApiTrafficInfo() { + } + + public ApiTrafficInfo(boolean enableTraffic) { + this.enableTraffic = enableTraffic; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiX5Info.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiX5Info.java new file mode 100644 index 000000000..2e8ce4abc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/ApiX5Info.java @@ -0,0 +1,49 @@ +/* + * Copyright 2020 XiaoMi. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at the following link. + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +/** + * Created by dongzhenxing on 2023/3/6 10:43 AM + */ +@Data +public class ApiX5Info implements Serializable { + @HttpApiDocClassDefine(value = "enableX5", description = "是否使用x5协议", defaultValue = "false") + private boolean enableX5; + + @HttpApiDocClassDefine(value = "appID", description = "应用id", defaultValue = "121") + private String appId; + + @HttpApiDocClassDefine(value = "appKey", description = "应用密钥", defaultValue = "password") + private String appKey; + + @HttpApiDocClassDefine(value = "x5Method", description = "方法", defaultValue = "get") + private String x5Method; + + @HttpApiDocClassDefine(value = "x5Version", description = "x5的版本", defaultValue = "china") + private String x5Version; + + public ApiX5Info() { + } + + public ApiX5Info(boolean enableX5) { + this.enableX5 = enableX5; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/CheckPointInfoDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/CheckPointInfoDTO.java new file mode 100644 index 000000000..a3be0b1ee --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/CheckPointInfoDTO.java @@ -0,0 +1,17 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CheckPointInfoDTO implements Serializable { + private Integer id; + + @JsonProperty(value = "type") + private Integer checkType = 3; + private String checkObj; + private Integer checkCondition; + private String checkContent; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/FormParamValue.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/FormParamValue.java new file mode 100644 index 000000000..2ae550a7d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/FormParamValue.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class FormParamValue implements Serializable { + String paramKey; + Object paramValue; + + public FormParamValue(String paramKey, Object paramValue) { + this.paramKey = paramKey; + this.paramValue = paramValue; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetApiDetailReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetApiDetailReq.java new file mode 100644 index 000000000..98a9de52b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetApiDetailReq.java @@ -0,0 +1,21 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetApiDetailReq implements Serializable { + @HttpApiDocClassDefine(value = "projectID", required = true, description = "mi-api中的项目id", defaultValue = "432") + private Integer projectID; + + @HttpApiDocClassDefine(value = "apiID", required = true, description = "mi-api中的接口id", defaultValue = "666") + private Integer apiID; + + /** + * 1:http 3:dubbo 4:mione gateway + */ + @HttpApiDocClassDefine(value = "apiProtocol", required = true, description = "该接口的协议类型 1:http 3:dubbo 4:mione gateway", defaultValue = "1") + private Integer apiProtocol; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetDubboServiceReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetDubboServiceReq.java new file mode 100644 index 000000000..a4e42876c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/GetDubboServiceReq.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetDubboServiceReq implements Serializable { + String env; + String serviceName; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/OutputOriginEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/OutputOriginEnum.java new file mode 100644 index 000000000..10c93bc1d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/OutputOriginEnum.java @@ -0,0 +1,12 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +public enum OutputOriginEnum { + BODY_TXT(1), + BODY_JSON(2); + + public final int code; + + OutputOriginEnum(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiInfoItemBasic.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiInfoItemBasic.java new file mode 100644 index 000000000..64bf79f23 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiInfoItemBasic.java @@ -0,0 +1,42 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SceneApiInfoItemBasic implements Serializable { + @HttpApiDocClassDefine(value = "apiName", required = true, description = "接口名称", defaultValue = "测试接口") + private String apiName; + + @HttpApiDocClassDefine(value = "apiOrder", required = true, description = "该场景于该链路下的接口顺序", defaultValue = "1") + private Integer apiOrder; + + @HttpApiDocClassDefine(value = "projectID", ignore = true, required = true, description = "接口在mi-api中的项目id", defaultValue = "666") + private Integer projectID; + + @HttpApiDocClassDefine(value = "apiID", ignore = true, required = true, description = "接口在mi-api中的id", defaultValue = "1411") + private Integer apiID; + + @HttpApiDocClassDefine(value = "apiProtocol", required = true, description = "该接口的协议类型 1:http 3:dubbo 4:mione gateway", defaultValue = "1") + private Integer apiProtocol; + + @HttpApiDocClassDefine(value = "outputParamInfo", description = "出参定义", defaultValue = "") + private List outputParamInfos; + + @HttpApiDocClassDefine(value = "checkPointInfoList", description = "检查点信息列表", defaultValue = "") + private List checkPointInfoList; + + @HttpApiDocClassDefine(value = "filterCondition", description = "过滤条件列表", defaultValue = "") + private List filterCondition; + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiOutputParam.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiOutputParam.java new file mode 100644 index 000000000..ec32f66f9 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneApiOutputParam.java @@ -0,0 +1,21 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SceneApiOutputParam implements Serializable { + @HttpApiDocClassDefine(value = "paramName", required = true, description = "参数名称", defaultValue = "result") + private String paramName; + + @HttpApiDocClassDefine(value = "origin", required = true, description = "参数来源 1:Body:json 2:Body:txt", defaultValue = "1") + private Integer origin; + + @HttpApiDocClassDefine(value = "originParseExpr", required = true, description = "原解析表达式", defaultValue = "") + private String originParseExpr; + + @HttpApiDocClassDefine(value = "parseExpr", required = true, description = "解析表达式", defaultValue = "") + private String parseExpr; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemBasic.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemBasic.java new file mode 100644 index 000000000..0201c700a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemBasic.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SceneDubboApiInfoItemBasic extends SceneApiInfoItemBasic implements Serializable { + private String serviceName; + private String methodName; + private String group; + private String version; + private String path; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemDetail.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemDetail.java new file mode 100644 index 000000000..6e1c9669e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneDubboApiInfoItemDetail.java @@ -0,0 +1,26 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * for get dubbo api detail resp + */ +@Data +public class SceneDubboApiInfoItemDetail extends SceneDubboApiInfoItemBasic implements Serializable { + @HttpApiDocClassDefine(value = "dubboEnv", required = true, description = "dubbo服务的nacos环境", defaultValue = "staging") + private String dubboEnv; + + @HttpApiDocClassDefine(value = "requestParamTypeList", required = true, description = "请求参数类型列表", defaultValue = "[]") + private List requestParamTypeList; + + @HttpApiDocClassDefine(value = "requestBody", required = true, description = "请求数据,json格式字符串", defaultValue = "[{}]") + private String requestBody; + + @HttpApiDocClassDefine(value = "attachments", description = "dubbo携带的attachements,等同于http的header", defaultValue = "{}") + private String attachments; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemBasic.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemBasic.java new file mode 100644 index 000000000..dfd0879fa --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemBasic.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SceneHttpApiInfoItemBasic extends SceneApiInfoItemBasic implements Serializable { + @HttpApiDocClassDefine(value = "apiUrl", required = true, description = "接口的url", defaultValue = "/api/getUserInfo") + private String apiUrl; + + @HttpApiDocClassDefine(value = "apiRequestType", required = true, description = "http接口请求类型 0:post 1:get", defaultValue = "0") + private Integer apiRequestType; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemDetail.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemDetail.java new file mode 100644 index 000000000..8257f3646 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/SceneHttpApiInfoItemDetail.java @@ -0,0 +1,25 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +/** + * for get http api detail resp + */ +@Data +public class SceneHttpApiInfoItemDetail extends SceneHttpApiInfoItemBasic implements Serializable { + @HttpApiDocClassDefine(value = "requestInfo", description = "请求数据,json格式字符串,含格式", defaultValue = "{}") + private String requestInfo; + + @HttpApiDocClassDefine(value = "apiRequestParamType", description = "请求数据格式", defaultValue = "0") + private Integer apiRequestParamType; + + @HttpApiDocClassDefine(value = "requestRaw", description = "请求数据,json raw格式", defaultValue = "{}") + private String requestInfoRaw; + + @HttpApiDocClassDefine(value = "headerInfo", required = true, description = "请求头,json格式字符串", defaultValue = "{}") + private String headerInfo; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/X5VersionEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/X5VersionEnum.java new file mode 100644 index 000000000..d995ed5f0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sceneapi/X5VersionEnum.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.bo.sceneapi; + +public enum X5VersionEnum { + //中国区 + CHINA_VERSION("CHINA_VERSION"), + //信息部 + INFORMATION_VERISON("INFORMATION_VERISON"); + + public final String version; + + X5VersionEnum(String version) { + this.version = version; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GetSceneGroupListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GetSceneGroupListReq.java new file mode 100644 index 000000000..2c4ca4b6d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GetSceneGroupListReq.java @@ -0,0 +1,41 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.scenegroup; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetSceneGroupListReq implements Serializable { + + @HttpApiDocClassDefine(value = "page") + private int page; + + @HttpApiDocClassDefine(value = "pageSize") + private int pageSize; + + @HttpApiDocClassDefine(value = "keyword",required = false) + private String keyword; + + @HttpApiDocClassDefine(value = "sceneType",required = false,description = "场景类型 0:http 1:dubbo ") + private Integer sceneType; + + @HttpApiDocClassDefine(value = "tenant", ignore = true, required = false) + private String tenant; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GroupSceneDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GroupSceneDTO.java new file mode 100644 index 000000000..88dc09e9d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/GroupSceneDTO.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo.scenegroup; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.scene.BasicSceneDTO; + +import java.io.Serializable; +import java.util.List; + +@Data +public class GroupSceneDTO implements Serializable { + + private Integer sceneGroupID; + + private String groupName; + + private String groupDesc; + + private Long ctime; + + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupDTO.java new file mode 100644 index 000000000..9ae41254f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupDTO.java @@ -0,0 +1,18 @@ +package run.mone.mimeter.dashboard.bo.scenegroup; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SceneGroupDTO implements Serializable { + private Integer id; + + private String groupName; + + private String groupDesc; + + private String creator; + + private String tenant; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupList.java new file mode 100644 index 000000000..4719f9caf --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/scenegroup/SceneGroupList.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.scenegroup; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SceneGroupList extends PageBase implements Serializable { + + private List list; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/ActionEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/ActionEnum.java new file mode 100644 index 000000000..57cb7e024 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/ActionEnum.java @@ -0,0 +1,16 @@ +package run.mone.mimeter.dashboard.bo.sla; + +public enum ActionEnum { + + //报警级别 + WARNING("WARNING", "警告通知"), + ERROR("ERROR", "停止压测"); + + public String degreeName; + public String degreeCname; + + ActionEnum(String degreeName, String degreeCname) { + this.degreeName = degreeName; + this.degreeCname = degreeCname; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/AlarmDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/AlarmDto.java new file mode 100644 index 000000000..5c6586abd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/AlarmDto.java @@ -0,0 +1,19 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class AlarmDto implements Serializable { + + @HttpApiDocClassDefine(value = "alarmType", required = false, description = "报警类别", defaultValue = "") + private String alarmType; + + @HttpApiDocClassDefine(value = "alarmMethods", required = false, description = "报警方式 0:飞书 1:短信", defaultValue = "") + private List alarmMethods; + + private List usernames; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/BenchEvent.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/BenchEvent.java new file mode 100644 index 000000000..e640a7fa4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/BenchEvent.java @@ -0,0 +1,11 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class BenchEvent implements Serializable { + private String msg; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/DegreeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/DegreeEnum.java new file mode 100644 index 000000000..e47240a86 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/DegreeEnum.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.bo.sla; + +public enum DegreeEnum { + + //敏感程度 + Sensitive(1, "敏感,连续一次"), + Tolerable(2, "可容忍,连续三次"), + NotSensitive(3, "不敏感,连续五次"); + + + public final int code; + + public String degreeName; + public final String degreeCname; + + DegreeEnum(int code, String degreeCname) { + this.code = code; + this.degreeCname = degreeCname; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/GetSlaListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/GetSlaListReq.java new file mode 100644 index 000000000..20be6f741 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/GetSlaListReq.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.sla; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetSlaListReq implements Serializable { + + @HttpApiDocClassDefine(value = "slaName", required = false, description = "sla名称", defaultValue = "sla名称") + private String slaName; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "1") + private String creator; + + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/PerRuleItem.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/PerRuleItem.java new file mode 100644 index 000000000..b7cb4a134 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/PerRuleItem.java @@ -0,0 +1,37 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.sla; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.CommonEnum; + +import java.io.Serializable; +import java.util.List; + +@Data +public class PerRuleItem implements Serializable { + + + /** + * 返回的信息列表 + */ + private List ruleList; + + private String ruleItemTypeName; + private String ruleItemTypeCname; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaBusinessGroupEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaBusinessGroupEnum.java new file mode 100644 index 000000000..01625bd63 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaBusinessGroupEnum.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.sla; + +public enum SlaBusinessGroupEnum { + + InternetService("InternetService", "互联网服务"), + InternetGame("InternetGame", "互联网游戏"); + + public String businessGroupName; + public String businessGroupCname; + + SlaBusinessGroupEnum(String businessGroupName, String businessGroupCname) { + this.businessGroupName = businessGroupName; + this.businessGroupCname = businessGroupCname; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaDto.java new file mode 100644 index 000000000..8bee56ee9 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaDto.java @@ -0,0 +1,42 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SlaDto implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "sla序号", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "name", required = true, description = "sla名称", defaultValue = "sla示例名") + private String name; + + @HttpApiDocClassDefine(value = "note", required = false, description = "sla描述", defaultValue = "sla示理描述") + private String note; + + @HttpApiDocClassDefine(value = "businessGroup", required = true, description = "业务分类", defaultValue = "1") + private String businessGroup; + + @HttpApiDocClassDefine(value = "ctime", required = false, description = "创建时间", defaultValue = "0") + private Long ctime; + + @HttpApiDocClassDefine(value = "utime", required = false, description = "更新时间", defaultValue = "1") + private Long utime; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "创建人") + private String creator; + + @HttpApiDocClassDefine(value = "updater", required = false, description = "更新人", defaultValue = "更新人") + private String updater; + + @HttpApiDocClassDefine(value = "slaRuleList", required = false, description = "sla规则列表", defaultValue = "") + private List slaRuleDtos; + + @HttpApiDocClassDefine(value = "alarmDto", required = false, description = "报警方式与接收人", defaultValue = "") + private List alarmDtos; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaEvent.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaEvent.java new file mode 100644 index 000000000..f86f216a1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaEvent.java @@ -0,0 +1,23 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SlaEvent extends BenchEvent implements Serializable { + //若业务指标触发则有以下几项 + private int triggerApiId; + private String apiName; + private String apiUrlOrServiceName; + + private String alarmLevel; + private int degree; + private String slaRuleName; + private String ruleItemType; + private String ruleItem; + private String condition; + private String triggerItem; + private Double value; + private Double ruleTargetValue; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaList.java new file mode 100644 index 000000000..17a527c74 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaList.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.sla; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.common.PageBase; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SlaList extends PageBase implements Serializable { + + /** + * 返回的信息列表 + */ + @HttpApiDocClassDefine(value = "list", required = false, description = "sla列表") + private List list; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleDto.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleDto.java new file mode 100644 index 000000000..703706ee6 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleDto.java @@ -0,0 +1,52 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SlaRuleDto implements Serializable { + + @HttpApiDocClassDefine(value = "id", required = false, description = "sla规则序号", defaultValue = "1") + private Integer id; + + @HttpApiDocClassDefine(value = "slaId", required = false, description = "sla序号", defaultValue = "1") + private Integer slaId; + + @HttpApiDocClassDefine(value = "name", required = true, description = "sla规则名称", defaultValue = "sla规则示例名") + private String name; + + @HttpApiDocClassDefine(value = "ruleItemType", required = true, description = "指标类型", defaultValue = "业务指标") + private String ruleItemType; + + @HttpApiDocClassDefine(value = "ruleItem", required = true, description = "指标名", defaultValue = "成功率") + private String ruleItem; + + @HttpApiDocClassDefine(value = "condition", required = true, description = "对比条件", defaultValue = "=") + private String condition; + + @HttpApiDocClassDefine(value = "value", required = true, description = "对比值", defaultValue = "100") + private Integer value; + + @HttpApiDocClassDefine(value = "degree", required = true, description = "敏感程度", defaultValue = "1") + private Integer degree; + + @HttpApiDocClassDefine(value = "action", required = true, description = "报警级别", defaultValue = "WARNING") + private String action; + + @HttpApiDocClassDefine(value = "ctime", required = false, description = "创建时间", defaultValue = "0") + private Long ctime; + + @HttpApiDocClassDefine(value = "utime", required = false, description = "更新时间", defaultValue = "0") + private Long utime; + + @HttpApiDocClassDefine(value = "creator", required = false, description = "创建人", defaultValue = "创建人") + private String creator; + + @HttpApiDocClassDefine(value = "updater", required = false, description = "更新人", defaultValue = "更新人") + private String updater; + + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemEnum.java new file mode 100644 index 000000000..df88e0664 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemEnum.java @@ -0,0 +1,33 @@ +package run.mone.mimeter.dashboard.bo.sla; + +public enum SlaRuleItemEnum { + + //业务指标 + SuccessRate("SuccessRate", "成功率", "%"), + P99ResponseTime("P99ResponseTime", "P99_RT", "ms"), + + AvgResponseTime("AvgResponseTime", "Avg_RT", "ms"), + RequestPerSecond("RequestPerSecond", "RPS", "/s"), + + //监控指标 + CpuUtilization("CpuUtilization", "CPU利用率", "%"), + MemoryUtilization("MemoryUtilization", "内存利用率", "%"), + Load5Average("Load5Average", "load5平均值", ""), + Load5Max("Load5Max", "load5最大值", ""), + DropConnectionAverage("DropConnectionAverage", "丢弃连接数平均值", "个"), + DropConnectionMax("DropConnectionMax", "丢弃连接数最大值", "个"); + + + + public String ruleItemName; + + public String ruleItemCname; + + public String unit; + + SlaRuleItemEnum(String ruleItemName, String ruleItemCname, String unit) { + this.ruleItemName = ruleItemName; + this.ruleItemCname = ruleItemCname; + this.unit = unit; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemTypeEnum.java new file mode 100644 index 000000000..05b0ea9a1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/SlaRuleItemTypeEnum.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.sla; + +public enum SlaRuleItemTypeEnum { + + BusinessMetrics("BusinessMetrics", "业务指标"), + MonitorMetrics("MonitorMetrics", "监控指标"); + + public String ruleItemTypeName; + public String ruleItemTypeCname; + + SlaRuleItemTypeEnum(String ruleItemTypeName, String ruleItemTypeCname) { + this.ruleItemTypeName = ruleItemTypeName; + this.ruleItemTypeCname = ruleItemTypeCname; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/UserDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/UserDTO.java new file mode 100644 index 000000000..395f0ddbf --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/sla/UserDTO.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.sla; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserDTO implements Serializable { + private String user; + private String username; + private String email; + private String phoneNum; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/snapshot/SnapshotTypeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/snapshot/SnapshotTypeEnum.java new file mode 100644 index 000000000..d4e17036c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/snapshot/SnapshotTypeEnum.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.bo.snapshot; + +public enum SnapshotTypeEnum { + + SCENE_SNAPSHOT(1), + DEBUG_SNAPSHOT(2); + + public int typeCode; + + SnapshotTypeEnum(int typeCode) { + this.typeCode = typeCode; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ApiStatistics.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ApiStatistics.java new file mode 100644 index 000000000..dcbc43312 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ApiStatistics.java @@ -0,0 +1,101 @@ +package run.mone.mimeter.dashboard.bo.statistics; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiStatistics implements Serializable { + + private int apiId; + + private String apiName; + + /** + * 接口类型 0:http 1:dubbo + */ + private int apiType; + + private String uri; + + private String method; + + private String dubboServiceName; + + private String dubboMethodName; + + private String dubboGroup; + + private String dubboVersion; + + private int serialId; + + /** + * 该接口总请求次数 + */ + private int reqTotal; + + /** + * 业务事务处理总数 + */ + private int tansTotal; + + /** + * 该接口总请求成功次数 + */ + private int reqSucc; + + /** + * 该接口总请求失败次数 + */ + private int reqFail; + + /** + * 该接口请求成功率 + */ + private String succRate; + + /** + * 接口平均rt + */ + private int avgRt; + + /** + * 接口最大rt + */ + private int maxRt; + + + /** + * p99 rt + */ + private int p99Rt; + + + /** + * p95rt + */ + private int p95Rt; + + /** + * 接口平均tps + */ + private int avgTps; + + /** + * 接口最大tps + */ + private int maxTps; + + /** + * 接口最大rps + */ + private int maxRps; + + + /** + * 接口平均rps + */ + private int avgRps; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ErrorTypeAnalysis.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ErrorTypeAnalysis.java new file mode 100644 index 000000000..cfe106a5e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/ErrorTypeAnalysis.java @@ -0,0 +1,49 @@ +package run.mone.mimeter.dashboard.bo.statistics; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class ErrorTypeAnalysis implements Serializable { + /** + * 0:错误码 or 1:检查点 + */ + private int errorType; + + /** + * http错误状态码 + */ + private int errorCode; + /** + * 该错误占比 + */ + private String errRate; + + /** + * 各接口该错误次数 + */ + private Map errInApis; + + /** + * 错误次数最多的api id + */ + private Integer mostErrApi; + + /** + * 错误次数最多的接口名 + */ + private String mostErrApiName; + + /** + * 检查点错误类型的 规则id + */ + private Integer checkPointId; + + /** + * 检查点错误类型的类型 + */ + private String checkPointDesc; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/TotalStatAnalysisEvent.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/TotalStatAnalysisEvent.java new file mode 100644 index 000000000..05c49fbfa --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/statistics/TotalStatAnalysisEvent.java @@ -0,0 +1,103 @@ +package run.mone.mimeter.dashboard.bo.statistics; + + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.task.DagTaskRps; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class TotalStatAnalysisEvent implements Serializable { + + /** + * 全场景总请求次数 + */ + private int totalReq; + + /** + * 丢失连接数 + */ + private int lossConnNum; + + /** + * 全场景业务处理次数 + */ + private int totalTCount; + + /** + * 全场景成功次数 + */ + private int totalSuccReq; + + /** + * 全场景总错误请求次数 + */ + private int totalErrReq; + + /** + * 全场景成功率 + */ + private String totalSuccRate; + + /** + * 总错误占比 + */ + private String totalErrRate; + + /** + * 全场景平均rt + */ + private int avgRt; + + /** + * 全场景最大rt + */ + private int maxRt; + + /** + * 全场景平均tps + */ + private int avgTps; + + /** + * 全场景最大rps + */ + private int maxRps; + + /** + * 全场景平均rps + */ + private int avgRps; + + /** + * 全场景最大tps + */ + private int maxTps; + + /** + * 是否结束 + */ + private boolean finish; + + /** + * 全场景发压比例 + */ + private Integer rpsRate; + + /** + * 各错误类型统计分析 + */ + private List errorTypeAnalyses; + + /** + * 接口统计数据 + */ + private List apiStatisticsList; + + /** + * 链路id与dag任务id、rps映射 + */ + private Map linkToDagTaskRpsMap; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchIncreaseModeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchIncreaseModeEnum.java new file mode 100644 index 000000000..25c1eeeeb --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchIncreaseModeEnum.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.task; + +public enum BenchIncreaseModeEnum { + + //Rps压力增加模式 0 固定() 1 手动 2 百分比递增 + STABLE(0), + MANUAL(1), + PERCENT_INCREASE(2); + + public final int code; + + BenchIncreaseModeEnum(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchModeEnum.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchModeEnum.java new file mode 100644 index 000000000..c2705c262 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/BenchModeEnum.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.bo.task; + +public enum BenchModeEnum { + //压力模式 + RPS(0), + CONCURRENT(1); + + public final int code; + + BenchModeEnum(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DagTaskRps.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DagTaskRps.java new file mode 100644 index 000000000..40bf24504 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DagTaskRps.java @@ -0,0 +1,26 @@ +package run.mone.mimeter.dashboard.bo.task; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DagTaskRps implements Serializable { + @HttpApiDocClassDefine(value = "linkId", required = true, description = "链路id", defaultValue = "120221") + Integer linkId; + @HttpApiDocClassDefine(value = "taskId", required = true, description = "该链路当前任务id", defaultValue = "12123") + Integer taskId; + + @HttpApiDocClassDefine(value = "rps", required = true, description = "该链路当前任务rps", defaultValue = "10000") + Integer rps; + + public DagTaskRps() { + } + + public DagTaskRps(Integer linkId, Integer taskId, Integer rps) { + this.linkId = linkId; + this.taskId = taskId; + this.rps = rps; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DebugSceneApiInfoReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DebugSceneApiInfoReq.java new file mode 100644 index 000000000..ea80de25e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/DebugSceneApiInfoReq.java @@ -0,0 +1,75 @@ +package run.mone.mimeter.dashboard.bo.task; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; +import run.mone.mimeter.dashboard.bo.scene.TspAuthInfo; +import run.mone.mimeter.dashboard.bo.sceneapi.CheckPointInfoDTO; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneApiOutputParam; + +import java.io.Serializable; +import java.util.List; + +/** + * @author dongzhenxing + * 用于单独调试的接口信息 + */ +@Data +public class DebugSceneApiInfoReq implements Serializable { + + @HttpApiDocClassDefine(value = "apiType", description = "接口类型 1:http 3:dubbo") + private Integer apiType; + + @HttpApiDocClassDefine(value = "apiUrl", description = "http接口 url",defaultValue = "http://www.baidu.com") + private String apiUrl; + + @HttpApiDocClassDefine(value = "requestMethod", description = "请求方式 0:get,1:post",defaultValue = "1") + private Integer requestMethod; + + @HttpApiDocClassDefine(value = "apiHeader", description = "http请求头",defaultValue = "json格式字符串") + private String apiHeader; + + @HttpApiDocClassDefine(value = "requestParamInfo",ignore = true, description = "http请求参数信息,带格式",defaultValue = "") + private String requestParamInfo; + + @HttpApiDocClassDefine(value = "requestBody", description = "http请求参数信息,raw",defaultValue = "") + private String requestBody; + + @HttpApiDocClassDefine(value = "requestTimeout", description = "请求超时时间",defaultValue = "3000") + private Integer requestTimeout = 1000; + + @HttpApiDocClassDefine(value = "contentType", description = "http接口参数格式类型",defaultValue = "application/json") + private String contentType; + + @HttpApiDocClassDefine(value = "api_tsp_auth", description = "单接口汽车部tsp验权信息,若配置将覆盖全局", defaultValue = "") + private TspAuthInfo apiTspAuth; + + @HttpApiDocClassDefine(value = "checkPointInfoList", description = "检查点信息列表", defaultValue = "") + private List checkPointInfoList; + + @HttpApiDocClassDefine(value = "outputParamInfo", description = "出参定义", defaultValue = "") + private List outputParamInfos; + + private String checkPointInfoListStr; + + private String outputParamInfosStr; + + @HttpApiDocClassDefine(value = "serviceName", description = "dubbo服务名",defaultValue = "test0930.api.HealthService") + private String serviceName; + + @HttpApiDocClassDefine(value = "methodName", description = "dubbo方法名",defaultValue = "ping") + private String methodName; + + @HttpApiDocClassDefine(value = "paramTypeList", description = "参数类型列表",defaultValue = "") + private String paramTypeList; + + @HttpApiDocClassDefine(value = "dubboGroup", description = "dubbo服务分组",defaultValue = "staging") + private String dubboGroup; + + @HttpApiDocClassDefine(value = "dubboVersion", description = "dubbo服务版本",defaultValue = "1.0") + private String dubboVersion; + + private String dubboParamJson; + + private String attachments; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/LinkRpsInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/LinkRpsInfo.java new file mode 100644 index 000000000..3b9daa5f1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/LinkRpsInfo.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.bo.task; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class LinkRpsInfo implements Serializable { + Integer linkId; + Integer rps; + + public LinkRpsInfo(Integer linkId) { + this.linkId = linkId; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/QueryStatReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/QueryStatReq.java new file mode 100644 index 000000000..88d2fc6a6 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/QueryStatReq.java @@ -0,0 +1,26 @@ +package run.mone.mimeter.dashboard.bo.task; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/21 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class QueryStatReq { + + private Long taskId; + + private Long startTs; + + private Long endTs; + + private String query; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/SceneRpsRateReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/SceneRpsRateReq.java new file mode 100644 index 000000000..230c11ee7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/SceneRpsRateReq.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.bo.task; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class SceneRpsRateReq implements Serializable { + @HttpApiDocClassDefine(value = "sceneID", required = true, description = "场景id", defaultValue = "66312") + Integer sceneID; + @HttpApiDocClassDefine(value = "reportID", required = true, description = "报告id", defaultValue = "66124") + String reportID; + @HttpApiDocClassDefine(value = "rpsRate", required = true, description = "发压比例", defaultValue = "10") + Integer rpsRate; + + @HttpApiDocClassDefine(value = "linkToTaskMaps", required = true, description = "链路id与任务id映射", defaultValue = "") + Map linkToTaskMaps; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/TaskDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/TaskDTO.java new file mode 100644 index 000000000..65cbdc77e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/task/TaskDTO.java @@ -0,0 +1,48 @@ +package run.mone.mimeter.dashboard.bo.task; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class TaskDTO implements Serializable { + + /** + * 任务id列表 + */ + @HttpApiDocClassDefine(value = "ids", ignore = true, description = "该任务id列表", defaultValue = "") + private List ids; + + /** + * 场景定义id + */ + @HttpApiDocClassDefine(value = "sceneId", required = true, description = "任务所属的场景id", defaultValue = "12") + private Integer sceneId; + + /** + * 0:单接口调试 + * 1:场景调试 + * 2:场景压测 + */ + @HttpApiDocClassDefine(value = "submitTaskType", ignore = true) + private Integer submitTaskType; + + /** + * 每次压测任务绑定一个唯一报告id + */ + @HttpApiDocClassDefine(value = "reportId", ignore = true) + private String reportId; + + /** + * 用于调试的接口信息 + */ + @HttpApiDocClassDefine(value = "apiInfo", required = true, description = "具体的被调试接口信息,只有单接口调试时需要直接传") + private DebugSceneApiInfoReq apiInfo; + + private String opUser; + + private String tenant; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/traffic/record/GetGwApiInfoListReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/traffic/record/GetGwApiInfoListReq.java new file mode 100644 index 000000000..02d8dcadd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/bo/traffic/record/GetGwApiInfoListReq.java @@ -0,0 +1,40 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.bo.traffic.record; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GetGwApiInfoListReq implements Serializable { + + @HttpApiDocClassDefine(value = "name", required = false, description = "name", defaultValue = "名称") + private String name; + + @HttpApiDocClassDefine(value = "url", required = false, description = "url", defaultValue = "") + private String url; + + @HttpApiDocClassDefine(value = "page", required = true, description = "当前的页码", defaultValue = "1") + private int page; + + @HttpApiDocClassDefine(value = "pageSize", required = true, description = "每页条数", defaultValue = "10") + private int pageSize; + + private int env; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonError.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonError.java new file mode 100644 index 000000000..4ac12bf39 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonError.java @@ -0,0 +1,78 @@ +package run.mone.mimeter.dashboard.exception; + +/** + * 错误定义 + */ +public enum CommonError { + + Success(0, "success"), + UnknownError(1, "网络错误,请联系管理员"), + + UnknownUser(100000, "用户未登录"), + + // 参数问题 + InvalidParamError(100001, "无效的参数"), + InvalidIDParamError(100002, "无效的id参数"), + InvalidPageParamError(100003, "无效的列表请求参数"), + InvalidUsernameOrPasswdError(100004, "无效的用户名或密码"), + EmptyFileError(100005, "上传文件为空,请检查"), + TooLongParamError(100006, "参数过长"), + WrongFileTypeError(100007, "入参文件仅支持csv格式文件"), + OverMaxFileSizeError(100008, "上传文件过大"), + OverMaxFileRowsError(100009, "上传文件行数过大"), + FileFirstRowEmptyError(100010, "上传文件首行为空"), + UploadFileError(100011, "上传文件失败"), + DeleteFileBindingSceneError(100012, "有场景引用该文件,不能删除"), + MultiDeleteFileBindingSceneError(100013, "有选中文件被场景引用,不能删除"), + InvalidUserInfoError(100014, "无效的用户信息"), + + + SlaRuleAtLeastOneError(1001001, "请至少添加一条SLA规则"), + DeleteSlaBindingSceneError(1001002, "有场景引用该SLA,不能删除"), + + WrongGatewayEnvError(1002001, "网关环境错误"), + + + NewAccountError(200001, "创建账号失败"), + UnAuthorized(200002, "无权限执行此操作"), + BeanCopyError(200003, "执行属性拷贝失败"), + UpdateAccountError(200004, "更新账号失败"), + DelAccountError(200005, "删除账号失败"), + AccountNotFoundError(200006, "未找到给定账号信息"), + AccountExistError(200007, "用户名已经存在"), + JsonSerializeError(200008, "JSON序列化失败"), + JsonDeSerializeError(200008, "JSON反序列化失败"), + APIServerError(200009, "压测引擎任务请求失败"), + FileSaveError(200010, "文件保存失败"), + LoadFileError(200011, "读取文件失败"), + DubboDataTooLong(200012, "数据太大"), + LoadMiApiDataFail(200013, "加载mi-api接口数据失败"), + SceneAlreadyExist(200014, "该场景已存在"), + + UnableBenchAgent(200015, "不可用的压测机"), + + UnbindRefDataset(200016, "不允许解绑被引用的数据源"), + + AgentAlreadyApplied(200017, "本组已申请过该发压机"), + + AgentAlreadyGetTenant(200018, "该发压机已有租户"), + + InvalidAgentNumError(200019, "该模式至少绑定2台以上压测机"), + + SystemDeployingError(200020, "Mimeter 系统升级中,请稍后再试~"), + ; + + + + public int code; + public String message; + + public String getMessage() { + return message; + } + + CommonError(int code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonException.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonException.java new file mode 100644 index 000000000..3ef2da8b5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/exception/CommonException.java @@ -0,0 +1,35 @@ +package run.mone.mimeter.dashboard.exception; + +public class CommonException extends RuntimeException { + + private int code; + private String message; + + public CommonException(int code, String message) { + this.code = code; + this.message = message; + } + + + public CommonException(CommonError error) { + this.code = error.code; + this.message = error.message; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + @Override + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/BenchBroadcastService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/BenchBroadcastService.java new file mode 100644 index 000000000..1318c214e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/BenchBroadcastService.java @@ -0,0 +1,33 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.EmitterTypeEnum; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; +import run.mone.mimeter.dashboard.bo.statistics.TotalStatAnalysisEvent; +import run.mone.mimeter.dashboard.bo.sla.SlaEvent; + + +/** + * @author dongzhenxing + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/21 + */ +public interface BenchBroadcastService { + + /** + * 压测结束事件通知 + */ + Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, ReportInfoBo reportInfoBo); + + /** + * sla事件通知 + */ + Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, SlaEvent slaEvent); + + /** + * 数据统计分析事件通知 + */ + Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, TotalStatAnalysisEvent analysisEvent); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DatasetInfoSercice.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DatasetInfoSercice.java new file mode 100644 index 000000000..627b6540c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DatasetInfoSercice.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.DatasetLineNum; +import run.mone.mimeter.dashboard.bo.dataset.DatasetLinesReq; + +import java.util.List; +import java.util.TreeMap; + +public interface DatasetInfoSercice { + + Result> getLineNumBySceneId(Integer sceneID); + + Result>> getDatasetMap(List linesReqs); + + Result syncTenant(); + + Result updateDatasetTenant(Integer datasetId,String tenant); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DubboHealthService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DubboHealthService.java new file mode 100644 index 000000000..1a86fa0a4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/DubboHealthService.java @@ -0,0 +1,12 @@ +package run.mone.mimeter.dashboard.service; + + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.common.TestReq; + +public interface DubboHealthService { + + String health(TestReq testReq); + + Result getUid(); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/MonitorInfoService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/MonitorInfoService.java new file mode 100644 index 000000000..43ddacfc2 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/MonitorInfoService.java @@ -0,0 +1,7 @@ +package run.mone.mimeter.dashboard.service; + +import java.util.List; + +public interface MonitorInfoService { + List getAppListByReportID(Integer sceneId, String reportId); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/SceneInfoService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/SceneInfoService.java new file mode 100644 index 000000000..ae465dc5a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-api/src/main/java/run/mone/mimeter/dashboard/service/SceneInfoService.java @@ -0,0 +1,18 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.SceneDTO; + +public interface SceneInfoService { + Result getSceneByID(Integer sceneID); + + void updateSceneStatus(Integer sceneId,Integer sceneStatus); + + Result updatemimeterTaskStatus(String report,Integer status); + + Result updateSceneTenant(Integer sceneId,String tenant); + + Result tmpUpdateLogRate(int sceneId,int logRate); + + Result processLossTask(); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/pom.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/pom.xml new file mode 100644 index 000000000..1544fcf8f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/pom.xml @@ -0,0 +1,32 @@ + + + + + mimeter-dashboard + run.mone + 1.0.0-SNAPSHOT + + 4.0.0 + + mimeter-dashboard-common + + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + ch.qos.logback + logback-core + 1.1.2 + + + + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/src/main/java/run/mone/mimeter/dashboard/common/TemplateUtils.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/src/main/java/run/mone/mimeter/dashboard/common/TemplateUtils.java new file mode 100644 index 000000000..f81c01c4a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-common/src/main/java/run/mone/mimeter/dashboard/common/TemplateUtils.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.common; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TemplateUtils { + + public static String processTemplate(String template, Map params) { + Matcher m = Pattern.compile("\\$\\{\\w+\\}").matcher(template); + StringBuffer sb = new StringBuffer(); + while (m.find()) { + String param = m.group(); + String value = params.get(param.substring(2, param.length() - 1)); + m.appendReplacement(sb, value == null ? "" : value); + } + m.appendTail(sb); + return sb.toString(); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/Dockerfile b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/Dockerfile new file mode 100644 index 000000000..106b9ace9 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/Dockerfile @@ -0,0 +1,6 @@ +FROM miserver:0.2.31-jaeger +MAINTAINER youpin-biz-arch@xiaomi.com +RUN mkdir -p /home/work/mimeter-dashboard/ +RUN mkdir -p /home/work/log/mimeter-dashboard/ +COPY ./target/mimeter-dashboard-server-1.0.0-SNAPSHOT.jar /home/work/mimeter-dashboard/ +ENTRYPOINT ["java","-jar","-Xms1024M","-Xmx1024M","-XX:+UseG1GC","-XX:+PrintReferenceGC","-XX:+PrintGCDetails","-XX:+PrintGCDateStamps","-XX:+PrintHeapAtGC","-Xloggc:/home/work/log/mimeter-dashboard/gc.log","/home/work/mimeter-dashboard/mimeter-dashboard-server-1.0.0-SNAPSHOT.jar"] \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/pom.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/pom.xml new file mode 100644 index 000000000..82913ddbb --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/pom.xml @@ -0,0 +1,140 @@ + + + + mimeter-dashboard + run.mone + 1.0.0-SNAPSHOT + + 4.0.0 + + mimeter-dashboard-server + + + mimeter-dashboard-service + run.mone + 1.0.0-SNAPSHOT + + + org.apache.httpcomponents + httpclient + 4.5.5 + + + org.codehaus.janino + janino + 3.0.8 + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.7.5 + + run.mone.mimeter.dashboard.bootstrap.MimeterDashboardBootstrap + + + + + repackage + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.7 + + src/main/resources/generatorConfig.xml + true + true + + + + + mysql + mysql-connector-java + 8.0.20 + + + com.itfsw + mybatis-generator-plugin + 1.3.8 + + + + + + + + + + + dev + + dev + + + + src/main/resources/config/dev.properties + + + + + + opensource + + opensource + + + + src/main/resources/config/opensource.properties + + + + + + staging + + staging + + + true + + + + src/main/resources/config/staging.properties + + + + + + production + + production + + + + src/main/resources/config/production.properties + + + + + + + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/bootstrap/MimeterDashboardBootstrap.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/bootstrap/MimeterDashboardBootstrap.java new file mode 100644 index 000000000..b2eb6a306 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/bootstrap/MimeterDashboardBootstrap.java @@ -0,0 +1,27 @@ +package run.mone.mimeter.dashboard.bootstrap; + +import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; + +/** + * @author dongzhenxing + */ +@EnableAutoConfiguration +@ComponentScan(basePackages = {"run.mone.mimeter.dashboard", "com.xiaomi.youpin"}) +@DubboComponentScan(basePackages = "run.mone.mimeter.dashboard") +public class MimeterDashboardBootstrap { + private static final Logger logger = LoggerFactory.getLogger(MimeterDashboardBootstrap.class); + + public static void main(String... args) { + try { + SpringApplication.run(MimeterDashboardBootstrap.class, args); + } catch (Throwable throwable) { + logger.error(throwable.getMessage(), throwable); + System.exit(-1); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/common/ApiConsts.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/common/ApiConsts.java new file mode 100644 index 000000000..fae0aee57 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/common/ApiConsts.java @@ -0,0 +1,24 @@ +package run.mone.mimeter.dashboard.common; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +public class ApiConsts { + + public static final String API_PREFIX = "/api/bench"; + + public static final String GENERAL_LIST_ENDPOINT = "/list"; + public static final String GENERAL_DETAILS_ENDPOINT = "/details"; + + public static final String GENERAL_DELETE_ENDPOINT = "/delete"; + + public static final String REPORT_INFO_ROUTE = "/report/info"; + + public static final String SCENE_SNAPSHOT_ROUTE = "/scene/snapshot"; + + public static final String API_STAT_ROUTE = "/api/stat"; + + public static final String LOG_ROUTE = "/logs"; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DataSourceConfig.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DataSourceConfig.java new file mode 100644 index 000000000..9a937b1a1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DataSourceConfig.java @@ -0,0 +1,119 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.config; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.mchange.v2.c3p0.ComboPooledDataSource; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.support.TransactionTemplate; + +import javax.naming.NamingException; +import javax.sql.DataSource; +import java.beans.PropertyVetoException; + +@Slf4j +@Configuration +@MapperScan(basePackages = DataSourceConfig.PACKAGE, sqlSessionFactoryRef = "masterSqlSessionFactory") +public class DataSourceConfig { + + static final String PACKAGE = "run.mone.mimeter.dashboard.mapper"; + static final String MAPPER_LOCATION = "classpath:mapper/*Mapper.xml"; + + @Value("${spring.datasource.driverClassName}") + private String driverClass; + + @Value("${spring.datasource.default.initialPoolSize}") + private Integer defaultInitialPoolSize; + + @Value("${spring.datasource.default.maxPoolSize}") + private Integer defaultMaxPoolSize; + + @Value("${spring.datasource.default.minialPoolSize}") + private Integer defaultMinPoolSize; + + @NacosValue(value = "${spring.datasource.username}", autoRefreshed = true) + private String dataSourceUserName; + + @NacosValue(value = "${spring.datasource.url}", autoRefreshed = true) + private String dataSourceUrl; + + @NacosValue(value = "${spring.datasource.password}", autoRefreshed = true) + private String dataSourcePasswd; + + @Bean(name = "masterDataSource") + @Primary + public DataSource masterDataSource() throws PropertyVetoException, NamingException { + log.info("DataSourceConfig {} {}", dataSourceUrl, dataSourceUserName); + + ComboPooledDataSource dataSource = new ComboPooledDataSource(); + dataSource.setDriverClass(driverClass); + dataSource.setJdbcUrl(dataSourceUrl); + dataSource.setUser(dataSourceUserName); + dataSource.setPassword(dataSourcePasswd); + + dataSource.setInitialPoolSize(defaultInitialPoolSize); + dataSource.setMaxPoolSize(defaultMaxPoolSize); + dataSource.setMinPoolSize(defaultMinPoolSize); + + setDatasouce(dataSource); + + return dataSource; + } + + private void setDatasouce(ComboPooledDataSource dataSource) { + dataSource.setTestConnectionOnCheckin(true); + dataSource.setTestConnectionOnCheckout(false); + dataSource.setPreferredTestQuery("select 1"); + dataSource.setIdleConnectionTestPeriod(180); + } + + @Bean(name = "masterTransactionManager") + @Primary + public DataSourceTransactionManager masterTransactionManager() throws PropertyVetoException, NamingException { + return new DataSourceTransactionManager(masterDataSource()); + } + + @Bean(name = "masterSqlSessionFactory") + @Primary + public SqlSessionFactory masterSqlSessionFactory(@Qualifier("masterDataSource") DataSource masterDataSource) + throws Exception { + final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); + sessionFactory.setDataSource(masterDataSource); + sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() + .getResources(DataSourceConfig.MAPPER_LOCATION)); + sessionFactory.setTypeAliasesPackage("run.mone.mimeter.dashboard.pojo"); + return sessionFactory.getObject(); + } + + @Bean + public TransactionTemplate transactionTemplate(PlatformTransactionManager transactionManager) { + TransactionTemplate template = new TransactionTemplate(); + template.setTransactionManager(transactionManager); + return template; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DubboConfiguration.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DubboConfiguration.java new file mode 100644 index 000000000..c70b531bd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/DubboConfiguration.java @@ -0,0 +1,79 @@ +package run.mone.mimeter.dashboard.config; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ProtocolConfig; +import org.apache.dubbo.config.RegistryConfig; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +@Configuration +public class DubboConfiguration { + + @Value("${spring.application.name}") + private String applicationName; + + @Value("${dubbo.protocol.port}") + private int port; + + @Value("${server.port}") + private String httpGateWayPort; + + @NacosValue("${dubbo.registry.address.st}") + private String stDubboRegistryAddress; + + @NacosValue("${dubbo.registry.address.ol}") + private String olDubboRegistryAddress; + + @Value("${is.online}") + private boolean isOnline; + + /** + * Dubbo应用配置 + */ + @Bean + public ApplicationConfig applicationConfig() { + ApplicationConfig applicationConfig = new ApplicationConfig(); + applicationConfig.setName(applicationName); + applicationConfig.setQosEnable(false); + return applicationConfig; + } + + + /** + * 配置st注册中心 + */ + @Bean + @Primary + public RegistryConfig stRegistry() { + RegistryConfig registryConfig = new RegistryConfig(); + registryConfig.setAddress(stDubboRegistryAddress); + registryConfig.setDefault(!isOnline); + return registryConfig; + } + + /** + * 配置ol注册中心 + */ + @Bean + public RegistryConfig olRegistry() { + + RegistryConfig registryConfig = new RegistryConfig(); + registryConfig.setAddress(olDubboRegistryAddress); + registryConfig.setDefault(isOnline); + return registryConfig; + } + + @Bean + public ProtocolConfig protocolConfig() { + ProtocolConfig protocolConfig = new ProtocolConfig(); + protocolConfig.setPort(port); + protocolConfig.setTransporter("netty4"); + protocolConfig.setThreadpool("fixed"); + protocolConfig.setThreads(800); + return protocolConfig; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/FilterConfiguration.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/FilterConfiguration.java new file mode 100644 index 000000000..26e4fbc9b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/FilterConfiguration.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.config; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.xiaomi.aegis.filter.AegisFilter; +import com.xiaomi.mone.tpc.login.filter.HttpReqUserFilter; +import com.xiaomi.mone.tpc.login.util.ConstUtil; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FilterConfiguration { + + @NacosValue("${aegis.sdk.public.key:}") + private String aegisSdk; + + @Value("${server.cas.ignoreUrl}") + private String ignoreUrl; + + @Value("${is_local:false}") + private String isLocal; + + @Value("${cas.inner.auth}") + private String innerAuth; + + @NacosValue(value = "${token.parse.url:}", autoRefreshed = true) + private String tokenParseUrl; + + @NacosValue(value = "${server.cas.loginUrl:}", autoRefreshed = true) + private String loginUrl; + + @NacosValue(value = "${server.cas.logoutUrl:}", autoRefreshed = true) + private String logoutUrl; + + @NacosValue(value = "${server.cas.userInfoPath:}", autoRefreshed = true) + private String userInfoPath; + + @Bean + public FilterRegistrationBean filterCasBean() { + FilterRegistrationBean registrationBean = new FilterRegistrationBean(); + registrationBean.setFilter(new HttpReqUserFilter()); + registrationBean.addUrlPatterns("/*"); + registrationBean.addInitParameter(ConstUtil.innerAuth, innerAuth); + registrationBean.addInitParameter(ConstUtil.authTokenUrl, tokenParseUrl); + registrationBean.addInitParameter(ConstUtil.CAS_PUBLIC_KEY, aegisSdk); + if (isLocal.equals("true")) { + ignoreUrl = "/*"; + } + registrationBean.addInitParameter("IGNORE_URL", ignoreUrl); + registrationBean.addInitParameter("devMode", "false"); + registrationBean.addInitParameter(ConstUtil.USER_INFO_PATH, userInfoPath); + registrationBean.addInitParameter(ConstUtil.loginUrl, loginUrl); + registrationBean.addInitParameter(ConstUtil.logoutUrl, logoutUrl); + registrationBean.setOrder(0); + return registrationBean; + } + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/InitService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/InitService.java new file mode 100644 index 000000000..d4d54f65f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/InitService.java @@ -0,0 +1,53 @@ +package run.mone.mimeter.dashboard.config; + +import com.xiaomi.data.push.nacos.NacosNaming; +import org.apache.dubbo.common.utils.NetUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; + +@Service +public class InitService { + @Resource(name = "nacosNamingSt") + private NacosNaming nacosNamingSt; + + @Resource(name = "nacosNamingOl") + private NacosNaming nacosNamingOl; + + @Value("${server.port}") + private String httpPort; + + @Value("${dubbo.group}") + private String group; + + @PostConstruct + public void init() { + String host = System.getenv("host.ip") == null ? NetUtils.getLocalHost() : System.getenv("host.ip"); + final String port = httpPort; + + final String appName = "MiMeter"; + NacosNaming nacosNaming; + if (group.equals("online")){ + nacosNaming = nacosNamingOl; + }else { + nacosNaming = nacosNamingSt; + } + try { + nacosNaming.registerInstance(appName, host, Integer.valueOf(port), group); + + Runtime.getRuntime().addShutdownHook(new Thread(()->{ + try { + System.out.println("stop"); + nacosNaming.deregisterInstance(appName, host, Integer.valueOf(port), group); + } catch (Exception e) { + //ignore + } + })); + } catch (Exception ignored) { + } + } + + +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/NacosConfiguration.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/NacosConfiguration.java new file mode 100644 index 000000000..858ee5217 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/config/NacosConfiguration.java @@ -0,0 +1,72 @@ +package run.mone.mimeter.dashboard.config; + +import com.alibaba.nacos.api.annotation.NacosProperties; +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig; +import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource; +import com.xiaomi.data.push.nacos.NacosNaming; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import run.mone.mimeter.dashboard.bo.NacosInfo; + +@Configuration +@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "${nacos.config.addrs}")) +@NacosPropertySource(dataId = "${nacos.config.data.id}", autoRefreshed = true) +public class NacosConfiguration { + /** + * 中国区st nacos + */ + @NacosValue("${dubbo.registry.address.st}") + private String nacosAddressSt; + + @NacosValue(value = "${nacos.usernameSt}") + private String nacosUsernameCnSt; + + @NacosValue(value = "${nacos.passwordSt}") + private String nacosPasswordCnSt; + + /** + * 中国区线上 nacos + */ + @NacosValue("${dubbo.registry.address.ol}") + private String nacosAddressOl; + + @NacosValue(value = "${nacos.usernameOl}") + private String nacosUsernameCnOl; + + @NacosValue(value = "${nacos.passwordOl}") + private String nacosPasswordCnOl; + + @Bean + public NacosInfo nacosInfo(){ + return new NacosInfo(nacosUsernameCnSt,nacosPasswordCnSt,nacosUsernameCnOl,nacosPasswordCnOl); + } + + /** + * 中国区st nacos + * @return + */ + @Bean + @Primary + public NacosNaming nacosNamingSt() { + NacosNaming nacosNaming = new NacosNaming(); + String[] address = nacosAddressSt.split("//"); + nacosNaming.setServerAddr(address[1]); + nacosNaming.init(); + return nacosNaming; + } + + /** + * 中国区线上nacos + * @return + */ + @Bean + public NacosNaming nacosNamingOl() { + NacosNaming nacosNaming = new NacosNaming(); + String[] address = nacosAddressOl.split("//"); + nacosNaming.setServerAddr(address[1]); + nacosNaming.init(); + return nacosNaming; + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/AgentController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/AgentController.java new file mode 100644 index 000000000..6d9785fc0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/AgentController.java @@ -0,0 +1,283 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import com.xiaomi.mone.tpc.common.vo.OrgInfoVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.bo.agent.*; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.AgentService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Objects; + +@Slf4j +@RestController +@RequestMapping("/api/bench/agent") +@HttpApiModule(value = "AgentController", apiController = AgentController.class) +public class AgentController { + + @Autowired + private LoginService loginService; + + @Autowired + private AgentService agentService; + + @HttpApiDoc(value = "/api/bench/agent/getAgentList", apiName = "获取本组压测机列表详情", method = MiApiRequestMethod.POST, description = "获取压测机列表详情") + @RequestMapping(value = "/getAgentList", method = RequestMethod.POST) + public Result> getAgentList( + HttpServletRequest request,String tenant) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getAgentList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + if (tenant == null || tenant.equals("")){ + tenant = account.getTenant(); + } + return agentService.getAgentListByTenant(tenant); + } + + @HttpApiDoc(value = "/api/bench/agent/getAllAgentList", apiName = "获取全部压测机列表详情", method = MiApiRequestMethod.POST, description = "获取全部压测机列表详情") + @RequestMapping(value = "/getAllAgentList", method = RequestMethod.POST) + public Result getAllAgentList( + HttpServletRequest request,GetAgentListReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getAllAgentList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.getAllAgentList(req); + } + + @HttpApiDoc(value = "/api/bench/agent/getApplyList", apiName = "获取申请记录列表", method = MiApiRequestMethod.POST, description = "获取申请记录列表") + @RequestMapping(value = "/getApplyList", method = RequestMethod.POST) + public Result getApplyList( + HttpServletRequest request, GetApplyListReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getApplyList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.getApplyList(req); + } + + @HttpApiDoc(value = "/api/bench/agent/getOrgList", apiName = "获取部门组织列表", method = MiApiRequestMethod.POST, description = "获取部门组织列表") + @RequestMapping(value = "/getOrgList", method = RequestMethod.POST) + public Result> getOrgList( + HttpServletRequest request, String orgName) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getOrgList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.getOrgList(orgName); + } + + @HttpApiDoc(value = "/api/bench/agent/getAllAvailableAgentList", apiName = "获取全部可选压测机列表详情", method = MiApiRequestMethod.POST, description = "获取全部可选压测机列表详情") + @RequestMapping(value = "/getAllAvailableAgentList", method = RequestMethod.POST) + public Result> getAllAvailableAgentList( + HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.获取全部可选压测机列表详情] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.getAllAvailableAgentList(); + } + + @HttpApiDoc(value = "/api/bench/agent/applyAgent", apiName = "批量申请压测机", method = MiApiRequestMethod.POST, description = "申请压测机") + @RequestMapping(value = "/applyAgent", method = RequestMethod.POST) + public Result applyAgent( + HttpServletRequest request, + @RequestBody AgentApplyReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.applyAgent] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.setApplier(account.getUsername()); + return agentService.applyAgent(req); + } + + @HttpApiDoc(value = "/api/bench/agent/approveApply", apiName = "通过压测机申请", method = MiApiRequestMethod.POST, description = "通过压测机申请") + @RequestMapping(value = "/approveApply", method = RequestMethod.POST) + public Result approveApply( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "applyID", required = true, description = "申请记录id", defaultValue = "66") + Integer applyID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.approveApply] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.approveApply(applyID); + } + + @HttpApiDoc(value = "/api/bench/agent/refuseApply", apiName = "拒绝压测机申请", method = MiApiRequestMethod.POST, description = "拒绝压测机申请") + @RequestMapping(value = "/refuseApply", method = RequestMethod.POST) + public Result refuseApply( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "applyID", required = true, description = "申请记录id", defaultValue = "66") + Integer applyID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.refuseApply] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.refuseApply(applyID); + } + + @HttpApiDoc(value = "/api/bench/agent/tenantForAgent", apiName = "给压测机打租户", method = MiApiRequestMethod.POST, description = "给压测机打租户") + @RequestMapping(value = "/tenantForAgent", method = RequestMethod.POST) + public Result tenantForAgent( + HttpServletRequest request, + TenantForAgentReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.tenantForAgent] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.tenantForAgent(req); + } + + @HttpApiDoc(value = "/api/bench/agent/applyAgentDomain", apiName = "批量绑定压测机域名", method = MiApiRequestMethod.POST, description = "批量绑定压测机域名") + @RequestMapping(value = "/applyAgentDomain", method = RequestMethod.POST) + public Result applyAgentDomain( + HttpServletRequest request, + @RequestBody List req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.applyAgentDomain] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.forEach(domainApplyReq -> domainApplyReq.setApplier(account.getUsername())); + return agentService.applyAgentDomain(req); + } + + @HttpApiDoc(value = "/api/bench/agent/applyAgentDomainByRate", apiName = "根据比例批量绑定压测机域名", method = MiApiRequestMethod.POST, description = "根据比例批量绑定压测机域名") + @RequestMapping(value = "/applyAgentDomainByRate", method = RequestMethod.POST) + public Result applyAgentDomainByRate( + HttpServletRequest request, + @RequestBody DomainApplyByRateReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.applyAgentDomainByRate] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.setApplier(account.getUsername()); + return agentService.applyAgentDomainByRate(req); + } + + @HttpApiDoc(value = "/api/bench/agent/getDomainApplyList", apiName = "获取域名绑定申请记录列表", method = MiApiRequestMethod.POST, description = "获取域名绑定申请记录列表") + @RequestMapping(value = "/getDomainApplyList", method = RequestMethod.POST) + public Result getDomainApplyList( + HttpServletRequest request, @RequestBody GetApplyListReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getDomainApplyList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.getDomainApplyList(req); + } + + @HttpApiDoc(value = "/api/bench/agent/approveDomainApply", apiName = "通过域名绑定申请", method = MiApiRequestMethod.POST, description = "通过压测机申请") + @RequestMapping(value = "/approveDomainApply", method = RequestMethod.POST) + public Result approveDomainApply( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "applyID", required = true, description = "申请记录id", defaultValue = "66") + Integer applyID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.approveDomainApply] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.approveDomainApply(applyID); + } + + @HttpApiDoc(value = "/api/bench/agent/refuseDomainApply", apiName = "拒绝域名绑定申请", method = MiApiRequestMethod.POST, description = "拒绝压测机申请") + @RequestMapping(value = "/refuseDomainApply", method = RequestMethod.POST) + public Result refuseDomainApply( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "applyID", required = true, description = "申请记录id", defaultValue = "66") + Integer applyID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.refuseDomainApply] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.refuseDomainApply(applyID); + } + + @HttpApiDoc(value = "/api/bench/agent/hostForAgent", apiName = "直接给一台压测机绑定域名", method = MiApiRequestMethod.POST, description = "直接给一台压测机绑定域名") + @RequestMapping(value = "/hostForAgent", method = RequestMethod.POST) + public Result hostForAgent( + HttpServletRequest request, + @RequestBody HostForAgentReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.hostForAgent] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.hostForAgent(req); + } + + @HttpApiDoc(value = "/api/bench/agent/delHostForAgents", apiName = "批量删除压测机某个域名绑定", method = MiApiRequestMethod.POST, description = "批量删除压测机某个域名绑定") + @RequestMapping(value = "/delHostForAgents", method = RequestMethod.POST) + public Result delHostForAgents( + HttpServletRequest request, + @RequestBody DelHostForAgentsReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.delHostForAgents] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return agentService.delHostForAgents(req); + } + + @HttpApiDoc(value = "/api/bench/agent/getAgentHostsFile", apiName = "获取某台机器hosts文件内容", method = MiApiRequestMethod.POST, description = "获取某台机器hosts文件内容") + @RequestMapping(value = "/getAgentHostsFile", method = RequestMethod.POST) + public Result getAgentHostsFile( + HttpServletRequest request, + @RequestBody LoadHostsFileReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.getDomainApplyList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + if (req.getAgentIp().isEmpty()){ + return Result.success(""); + } + return agentService.getAgentHostsFile(req); + } + + @HttpApiDoc(value = "/api/bench/agent/syncDomainConf", apiName = "同步发压机域名绑定配置", method = MiApiRequestMethod.POST, description = "同步发压机域名绑定配置") + @RequestMapping(value = "/syncDomainConf", method = RequestMethod.POST) + public Result syncDomainConf( + HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[AgentController.syncDomainConf] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return agentService.syncDomainConf(); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/BenchMonitorController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/BenchMonitorController.java new file mode 100644 index 000000000..e59102760 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/BenchMonitorController.java @@ -0,0 +1,80 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.scene.SceneTaskAppsBo; +import run.mone.mimeter.dashboard.bo.agent.AgentMonitorBo; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.BenchMonitorService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +@Slf4j +@RestController +@RequestMapping(value = "/api/bench/monitor") +@HttpApiModule(value = "BenchMonitorController", apiController = BenchMonitorController.class) +public class BenchMonitorController { + + @Autowired + private LoginService loginService; + + @Autowired + private BenchMonitorService monitorService; + + /** + * 获取某次场景压测关联的应用列表 + * + * @param request + * @return + */ + @HttpApiDoc(value = "/api/bench/monitor/getAppListByReportID", apiName = "获取某次场景压测关联的应用列表", method = MiApiRequestMethod.POST, description = "获取某次场景压测关联的应用列表") + @RequestMapping(value = "/getAppListByReportID", method = RequestMethod.POST) + public Result getAppListByReportID( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneID",required = true,description = "场景id",defaultValue = "111") + Integer sceneID, + @HttpApiDocClassDefine(value = "reportID",required = true,description = "报告id",defaultValue = "dsas134") + String reportID, + @HttpApiDocClassDefine(value = "realTime",required = true,description = "是否实时",defaultValue = "dsas134") + Boolean realTime + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.getAppListByTaskFlag] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return monitorService.getAppListByReportID(sceneID,reportID,realTime); + } + + /** + * 获取报告下的压测机数据 + * + * @param request + * @return + */ + @HttpApiDoc(value = "/api/bench/monitor/getAgentInfosByReport", apiName = "获取报告下的压测机数据", method = MiApiRequestMethod.POST, description = "获取报告下的压测机数据") + @RequestMapping(value = "/getAgentInfosByReport", method = RequestMethod.POST) + public Result getAgentInfosByReport( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "reportID",required = true,description = "报告id",defaultValue = "dsas134") + String reportID, + @HttpApiDocClassDefine(value = "realTime",required = true,description = "是否实时",defaultValue = "dsas134") + Boolean realTime + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.getAgentInfoByReport] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return monitorService.getAgentInfosByReport(reportID,realTime); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/DatasetController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/DatasetController.java new file mode 100644 index 000000000..0fb457452 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/DatasetController.java @@ -0,0 +1,260 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.*; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.exception.CommonException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import run.mone.mimeter.dashboard.service.DatasetService; +import run.mone.mimeter.dashboard.service.impl.LoginService; +import run.mone.mimeter.dashboard.service.impl.UploadService; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Objects; + +import static run.mone.mimeter.dashboard.exception.CommonError.InvalidParamError; + +@Slf4j +@RestController +@RequestMapping("/api/bench/dataset") +@HttpApiModule(value = "DatasetController", apiController = DatasetController.class) +public class DatasetController { + + @Autowired + private LoginService loginService; + + @Autowired + private UploadService uploadService; + + @Autowired + private DatasetService datasetService; + + + @HttpApiDoc(apiName = "数据源新增", value = "/api/bench/dataset/new", method = MiApiRequestMethod.POST, description = "数据源新增") + @RequestMapping(value = "/new", method = RequestMethod.POST) + public Result newDataset(HttpServletRequest request, + @RequestBody DatasetDto param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.newDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.setCreator(account.getUsername()); + param.setUpdater(account.getUsername()); + param.setTenant(account.getTenant()); + log.info("[DatasetController.newDataset] param: {}", param); + return datasetService.newDataset(param); + } + + @HttpApiDoc(apiName = "数据源批量新增", value = "/api/bench/dataset/multiNew", method = MiApiRequestMethod.POST, description = "数据源批量新增") + @RequestMapping(value = "/multiNew", method = RequestMethod.POST) + public Result> multiNewDataset(HttpServletRequest request, + @RequestBody List param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.multiNewDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.forEach(it -> { + it.setCreator(account.getUsername()); + it.setUpdater(account.getUsername()); + it.setTenant(account.getTenant()); + }); + + log.info("[DatasetController.multiNewDataset] param: {}", param); + return datasetService.multiNewDataset(param); + } + + @HttpApiDoc(apiName = "数据源更新", value = "/api/bench/dataset/update", method = MiApiRequestMethod.POST, description = "数据源更新") + @RequestMapping(value = "/update", method = RequestMethod.POST) + public Result updateDataset(HttpServletRequest request, + @RequestBody DatasetDto param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.updateDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.setUpdater(account.getUsername()); + param.setTenant(account.getTenant()); + + log.info("[DatasetController.updateDataset] param: {}", param); + return datasetService.updateDataset(param); + } + + @HttpApiDoc(apiName = "数据源批量更新", value = "/api/bench/dataset/multiUpdate", method = MiApiRequestMethod.POST, description = "数据源批量更新") + @RequestMapping(value = "/multiUpdate", method = RequestMethod.POST) + public Result multiUpdateDataset(HttpServletRequest request, + @RequestBody List param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.multiUpdateDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.forEach(it -> { + it.setUpdater(account.getUsername()); + it.setTenant(account.getTenant()); + }); + + log.info("[DatasetController.multiUpdateDataset] param: {}", param); + return datasetService.multiUpdateDataset(param); + } + + @HttpApiDoc(apiName = "数据源列表", value = "/api/bench/dataset/list", method = MiApiRequestMethod.POST, description = "数据源列表") + @RequestMapping(value = "/list", method = RequestMethod.POST) + public Result getDatasetList(HttpServletRequest request, + @RequestBody GetDatasetListReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.getDatasetList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.getDatasetList] param: {}", param); + if (param == null) { + return Result.fail(InvalidParamError); + } + param.setTenant(account.getTenant()); + return datasetService.getDatasetList(param); + } + + @HttpApiDoc(apiName = "根据数据源ids获取参数列表", value = "/api/bench/dataset/getParamDataByIds", method = MiApiRequestMethod.POST, description = "根据数据源ids获取参数列表") + @RequestMapping(value = "/getParamDataByIds", method = RequestMethod.POST) + public Result> getParamDataByIds(HttpServletRequest request, + @RequestBody List ids) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.getParamDataByIds] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.getParamDataByIds] param: {}", ids); + if (ids == null) { + return Result.fail(InvalidParamError); + } + return datasetService.getParamDataByIds(ids); + } + + @HttpApiDoc(apiName = "数据源删除", value = "/api/bench/dataset/del", method = MiApiRequestMethod.DELETE, description = "数据源删除") + @RequestMapping(value = "/del", method = RequestMethod.DELETE) + public Result delDataset(HttpServletRequest request, + @RequestParam("id") int id) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.delDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.delDataset] param: {}", id); + return datasetService.delDataset(id); + } + + @HttpApiDoc(apiName = "数据源批量删除", value = "/api/bench/dataset/multiDel", method = MiApiRequestMethod.POST, description = "数据源批量删除") + @RequestMapping(value = "/multiDel", method = RequestMethod.POST) + public Result multiDelDataset(HttpServletRequest request, + @RequestBody List ids) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.multiDelDataset] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.multiDelDataset] param: {}", ids); + return datasetService.multiDelDataset(ids); + } + + @HttpApiDoc(apiName = "获取数据源详情", value = "/api/bench/dataset/detail", method = MiApiRequestMethod.GET, description = "获取数据源详情") + @RequestMapping(value = "/detail", method = RequestMethod.GET) + public Result detail(HttpServletRequest request, + @RequestParam("id") int id) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.detail] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.detail] param: {}", id); + return datasetService.getDatasetById(id); + } + + @HttpApiDoc(apiName = "上传文件数据源", value = "/api/bench/dataset/upload", method = MiApiRequestMethod.POST, description = "上传文件数据源") + @RequestMapping(value="/upload", method = RequestMethod.POST) + public Result upload(HttpServletRequest request, + @RequestParam("file") MultipartFile file) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.upload] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + if (file.isEmpty()) { + throw new CommonException(CommonError.EmptyFileError); + } + return uploadService.save(file); + } + + @HttpApiDoc(apiName = "预览文件", value = "/api/bench/dataset/file/preview", method = MiApiRequestMethod.POST, description = "预览文件") + @RequestMapping(value="/file/preview", method = RequestMethod.POST) + public Result filePreview(HttpServletRequest request, + @RequestParam("id") int id) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.filePreview] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.filePreview] id: {}", id); + return datasetService.filePreview(id); + } + + @HttpApiDoc(apiName = "添加使用场景", value = "/api/bench/dataset/bindScene", method = MiApiRequestMethod.POST, description = "添加使用场景") + @RequestMapping(value="/bindScene", method = RequestMethod.POST) + public Result bindScene(HttpServletRequest request, + @RequestBody DatasetSceneRelationDto datasetSceneRelationDto) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.bindScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.bindScene] param: {}", datasetSceneRelationDto); + return datasetService.bindScene(datasetSceneRelationDto.getDatasetId(), datasetSceneRelationDto.getSceneId()); + } + + @HttpApiDoc(apiName = "解绑场景", value = "/api/bench/dataset/unbindScene", method = MiApiRequestMethod.POST, description = "解绑场景") + @RequestMapping(value="/unbindScene", method = RequestMethod.POST) + public Result unbindScene(HttpServletRequest request, + @RequestBody DatasetSceneRelationDto datasetSceneRelationDto) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.unbindScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.unbindScene] param: {}", datasetSceneRelationDto); + return datasetService.unbindScene(datasetSceneRelationDto.getDatasetId(), datasetSceneRelationDto.getSceneId()); + } + + @HttpApiDoc(apiName = "场景编辑--文件数据源详情", value = "/api/bench/dataset/sceneFileDetail", method = MiApiRequestMethod.POST, description = "场景编辑--文件数据源详情") + @RequestMapping(value="/sceneFileDetail", method = RequestMethod.POST) + public Result sceneFileDetail(HttpServletRequest request, + @RequestParam("sceneId") int sceneId) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[DatasetController.sceneFileDetail] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[DatasetController.sceneFileDetail] id: {}", sceneId); + return datasetService.sceneFileDetail(sceneId); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/EsLogController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/EsLogController.java new file mode 100644 index 000000000..0b235d0fd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/EsLogController.java @@ -0,0 +1,48 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.common.PagedResp; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.*; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.EsLogService; +import run.mone.mimeter.dashboard.service.impl.LoginService; +import run.mone.mimeter.dashboard.common.ApiConsts; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Slf4j +@RestController +@RequestMapping(ApiConsts.API_PREFIX + ApiConsts.API_STAT_ROUTE) +@HttpApiModule(value = "ApiStatController", apiController = EsLogController.class) +public class EsLogController { + + @Autowired + private LoginService loginService; + + @Autowired + private EsLogService esLogService; + + @HttpApiDoc(value = ApiConsts.API_PREFIX + ApiConsts.API_STAT_ROUTE + ApiConsts.LOG_ROUTE + ApiConsts.GENERAL_LIST_ENDPOINT, apiName = "搜索压测api采样日志", + method = MiApiRequestMethod.POST, description = "搜索压测api采样日志") + @PostMapping(ApiConsts.LOG_ROUTE + ApiConsts.GENERAL_LIST_ENDPOINT) + public Result>> searchApiLogs(HttpServletRequest request, + @RequestBody SearchApiLogReq searchApiLogReq) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + String logPrefix = "[ApiStatController]"; + log.warn(logPrefix + "searchApiLogs current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return esLogService.searchApiLogs(searchApiLogReq); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OpenApiController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OpenApiController.java new file mode 100644 index 000000000..85cd4c25e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OpenApiController.java @@ -0,0 +1,35 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.CreateSceneDTO; +import run.mone.mimeter.dashboard.bo.scene.SceneDTO; +import run.mone.mimeter.dashboard.common.SceneSource; +import run.mone.mimeter.dashboard.service.SceneService; + +@Slf4j +@RestController +@RequestMapping("/api/bench/agent/openapi") +@HttpApiModule(value = "OpenApiController", apiController = OpenApiController.class) +public class OpenApiController { + + @Autowired + private SceneService sceneService; + + @HttpApiDoc(value = "/api/bench/agent/openapi/createScene", apiName = "批量绑定压测机域名", method = MiApiRequestMethod.POST, description = "创建场景的openapi") + @RequestMapping(value = "/createScene", method = RequestMethod.POST) + public Result createScene( + @RequestBody CreateSceneDTO createSceneReq) { + createSceneReq.setSceneSource(SceneSource.OPEN_API.code); + createSceneReq.setTenant("open_api"); + return sceneService.newScene(createSceneReq, "open_api"); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OperationLogController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OperationLogController.java new file mode 100644 index 000000000..bb61d98c5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/OperationLogController.java @@ -0,0 +1,53 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.operationlog.GetOperationLogListReq; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogList; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.OperationLogService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +import static run.mone.mimeter.dashboard.exception.CommonError.InvalidParamError; + +@Slf4j +@RestController +@RequestMapping("/api/bench/operationlog") +@HttpApiModule(value = "OperationLogController", apiController = OperationLogController.class) +public class OperationLogController { + + @Autowired + private LoginService loginService; + + @Autowired + private OperationLogService operationLogService; + + + @HttpApiDoc(apiName = "操作记录列表", value = "/api/bench/operationlog/list", method = MiApiRequestMethod.POST, description = "操作记录列表") + @RequestMapping(value = "/list", method = RequestMethod.POST) + public Result getOperationLogList(HttpServletRequest request, + @RequestBody GetOperationLogListReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[OperationLogController.getOperationLogList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[OperationLogController.getOperationLogList] param: {}", param); + if (param == null) { + return Result.fail(InvalidParamError); + } + return operationLogService.getOperationLogList(param); + } + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/ReportInfoController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/ReportInfoController.java new file mode 100644 index 000000000..c9aebadf0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/ReportInfoController.java @@ -0,0 +1,120 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.common.PagedResp; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; +import run.mone.mimeter.dashboard.bo.report.RmReportReq; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.ReportInfoService; +import run.mone.mimeter.dashboard.service.SceneService; +import run.mone.mimeter.dashboard.service.SceneSnapshotService; +import run.mone.mimeter.dashboard.service.impl.LoginService; +import run.mone.mimeter.dashboard.common.ApiConsts; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import static run.mone.mimeter.dashboard.bo.common.Constants.DEFAULT_API_TIMEOUT; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +@Slf4j +@RestController +@RequestMapping(ApiConsts.API_PREFIX + ApiConsts.REPORT_INFO_ROUTE) +@HttpApiModule(value = "ReportInfoController", apiController = ReportInfoController.class) +public class ReportInfoController { + + @Autowired + private LoginService loginService; + + @Autowired + private ReportInfoService reportInfoService; + + @Autowired + private SceneService sceneService; + + @Autowired + private SceneSnapshotService sceneSnapshotService; + + private final String logPrefix = "[ReportInfoController]"; + + @HttpApiDoc(value = ApiConsts.API_PREFIX + ApiConsts.REPORT_INFO_ROUTE + ApiConsts.GENERAL_LIST_ENDPOINT, apiName = "获取压测报告列表", + method = MiApiRequestMethod.GET, description = "获取压测报告列表") + @GetMapping(ApiConsts.GENERAL_LIST_ENDPOINT) + public Result>> listReports(HttpServletRequest request, + @HttpApiDocClassDefine("keyword") + @RequestParam(required = false) String keyword, + @HttpApiDocClassDefine("pageNo") + @RequestParam(required = false) Integer pageNo, + @HttpApiDocClassDefine("pageSize") + @RequestParam(required = false) Integer pageSize) + throws ExecutionException, InterruptedException, TimeoutException { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn(this.logPrefix + "newScene current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + CompletableFuture>> cf1 = CompletableFuture.supplyAsync( + () -> this.reportInfoService.listReports(account.getTenant(), keyword, pageNo, pageSize) + ); + CompletableFuture> cf2 = CompletableFuture.supplyAsync( + () -> this.reportInfoService.countReports(account.getTenant(), keyword, pageNo, pageSize) + ); + CompletableFuture.allOf(cf1, cf2).get(DEFAULT_API_TIMEOUT, TimeUnit.MILLISECONDS); + List reportList = cf1.get().getData(); + PagedResp> resp = new PagedResp<>(); + + resp.setTotal(cf2.get().getData()); + resp.setData(reportList); + return Result.success(resp); + } + + @HttpApiDoc(value = ApiConsts.API_PREFIX + ApiConsts.REPORT_INFO_ROUTE + ApiConsts.GENERAL_DETAILS_ENDPOINT, apiName = "获取压测报告详情", + method = MiApiRequestMethod.GET, description = "获取压测报告详情") + @GetMapping(ApiConsts.GENERAL_DETAILS_ENDPOINT) + public Result reportDetails(HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneId") + @RequestParam(required = false) Long sceneId, + @HttpApiDocClassDefine(value = "reportId", required = true) + @RequestParam String reportId) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn(this.logPrefix + "reportDetails current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + ReportInfoBo report = this.reportInfoService.getReportDetails(sceneId, reportId).getData(); + ReportInfoBo obj = new ReportInfoBo(); + BeanUtils.copyProperties(report, obj); + return Result.success(obj); + } + + @HttpApiDoc(value = ApiConsts.API_PREFIX + ApiConsts.REPORT_INFO_ROUTE + ApiConsts.GENERAL_DELETE_ENDPOINT, apiName = "删除压测报告", + method = MiApiRequestMethod.DELETE, description = "删除压测报告") + @RequestMapping(value = "/delete", method = RequestMethod.POST) + public Result removeReports(HttpServletRequest request, + @RequestBody RmReportReq rmReportReq) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn(this.logPrefix + "removeReports current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return this.reportInfoService.removeReports(rmReportReq.getReportIds()); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneApiController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneApiController.java new file mode 100644 index 000000000..c9b498258 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneApiController.java @@ -0,0 +1,123 @@ +package run.mone.mimeter.dashboard.controller; + +import com.alibaba.nacos.api.exception.NacosException; +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.DubboService; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.DefaultSceneInfo; +import run.mone.mimeter.dashboard.bo.sceneapi.GetApiDetailReq; +import run.mone.mimeter.dashboard.bo.sceneapi.GetDubboServiceReq; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.SceneApiService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@Slf4j +@RestController +@RequestMapping("/api/bench/sceneApi") +@HttpApiModule(value = "SceneApiController", apiController = SceneApiController.class) +public class SceneApiController { + + @Autowired + private LoginService loginService; + + @Autowired + private SceneApiService sceneApiService; + + @HttpApiDoc(value = "/api/bench/sceneApi/searchApiFromMiApi", apiName = "模糊搜索mi-api中的接口", method = MiApiRequestMethod.POST, description = "根据keyword模糊搜索mi-api中的接口") + @RequestMapping(value = "/searchApiFromMiApi", method = RequestMethod.POST) + public Result searchApiFromMiApi( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "keyword", required = true, description = "关键字", defaultValue = "getUser") + String keyword, + @HttpApiDocClassDefine(value = "apiProtocol", required = true, description = "接口协议类型 1:http 3:dubbo", defaultValue = "3") + Integer apiProtocol + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneApiController.searchApiFromMiApi] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + if (Objects.isNull(keyword)) { + keyword = ""; + } + return sceneApiService.searchApiFromMiApi(keyword, apiProtocol); + } + + @HttpApiDoc(value = "/api/bench/sceneApi/getSceneBasicInfoFromApiID", apiName = "通过mi-api接口id获取场景基本默认数据", method = MiApiRequestMethod.POST, description = "通过mi-api接口id获取场景基本默认数据") + @RequestMapping(value = "/getSceneBasicInfoFromApiID", method = RequestMethod.POST) + public Result getSceneBasicInfoFromApiID( + HttpServletRequest request, + GetApiDetailReq getApiDetailReq) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneApiController.getSceneBasicInfoFromApiID] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneApiService.getSceneBasicInfoFromApiID(getApiDetailReq); + } + + @HttpApiDoc(value = "/api/bench/sceneApi/getApiDetailFromMiApi", apiName = "获取mi-api中的接口详情", method = MiApiRequestMethod.POST, description = "根据id获取mi-api中的接口详情") + @RequestMapping(value = "/getApiDetailFromMiApi", method = RequestMethod.POST) + public Result getApiDetailFromMiApi( + HttpServletRequest request, + GetApiDetailReq getApiDetailReq + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneApiController.getApiDetailFromMiApi] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneApiService.getApiDetailFromMiApi(getApiDetailReq); + } + + /** + * 根据服务名大致搜索nacos上的服务列表可搜dubbo服务 + * + * @return + * @throws IOException + */ + @HttpApiDoc(value = "/api/bench/sceneApi/loadDubboApiServices", apiName = "搜索dubbo接口", method = MiApiRequestMethod.POST, description = "根据服务名大致搜索nacos上的服务列表可搜dubbo服务") + @ResponseBody + @RequestMapping(value = "/loadDubboApiServices", method = RequestMethod.POST) + public Result> loadDubboApiServices(GetDubboServiceReq req) throws IOException { + return sceneApiService.loadDubboApiServices(req.getServiceName(), req.getEnv()); + } + + /** + * 根据服务名获取方法列表 + * + * @return + * @throws IOException + */ + @HttpApiDoc(value = "/api/bench/sceneApi/getServiceMethod", apiName = "根据服务名获取方法列表", method = MiApiRequestMethod.POST, description = "根据服务名获取方法列表") + @ResponseBody + @RequestMapping(value = "/getServiceMethod", method = RequestMethod.POST) + public Result> getServiceMethod(GetDubboServiceReq req) throws IOException, NacosException { + return sceneApiService.getServiceMethod(req.getServiceName(), req.getEnv()); + } + + @HttpApiDoc(value = "/api/bench/sceneApi/getUrlById", apiName = "根据apiId获取url", + method = MiApiRequestMethod.POST, description = "根据apiId获取url") + @RequestMapping(value = "/getUrlById", method = RequestMethod.POST) + public Result getUrlById(HttpServletRequest request, Integer apiId) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("getUrlById current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneApiService.getApiUrlById(apiId); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneController.java new file mode 100644 index 000000000..c71199207 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneController.java @@ -0,0 +1,180 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.SceneParamData; +import run.mone.mimeter.dashboard.bo.scene.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.scenegroup.GetSceneGroupListReq; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupList; +import run.mone.mimeter.dashboard.common.SceneSource; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.SceneService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Objects; + +@Slf4j +@RestController +@RequestMapping("/api/bench/scene") +@HttpApiModule(value = "SceneController", apiController = SceneController.class) +public class SceneController { + + @Autowired + private LoginService loginService; + + @Autowired + private SceneService sceneService; + + @HttpApiDoc(value = "/api/bench/scene/newScene", apiName = "新增压测场景", method = MiApiRequestMethod.POST, description = "新增压测场景") + @RequestMapping(value = "/newScene", method = RequestMethod.POST) + public Result newScene( + HttpServletRequest request, + @RequestBody CreateSceneDTO createSceneReq) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.newScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + createSceneReq.setSceneSource(SceneSource.CONSOLE.code); + createSceneReq.setTenant(account.getTenant()); + try { + return sceneService.newScene(createSceneReq, account.getUsername()); + } catch (Exception e) { + return Result.fail(CommonError.InvalidParamError); + } + } + + @HttpApiDoc(value = "/api/bench/scene/deleteScene", apiName = "删除压测场景", method = MiApiRequestMethod.POST, description = "根据ID删除压测场景") + @RequestMapping(value = "/deleteScene", method = RequestMethod.POST) + public Result deleteScene( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneID", required = true, description = "场景ID", defaultValue = "66") + Integer sceneID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.newScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + //todo 租户权限校验 + + try { + return sceneService.delScene(sceneID, account.getUsername()); + } catch (Exception e) { + log.warn("[SceneController.newScene] error :{}",e.getMessage()); + return Result.fail(CommonError.InvalidParamError); + } + } + + @HttpApiDoc(value = "/api/bench/scene/editScene", apiName = "编辑压测场景", method = MiApiRequestMethod.POST, description = "编辑压测场景") + @RequestMapping(value = "/editScene", method = RequestMethod.POST) + public Result editScene( + HttpServletRequest request, + @RequestBody EditSceneDTO editSceneReq) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.editScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + editSceneReq.setTenant(account.getTenant()); + editSceneReq.setSceneSource(SceneSource.CONSOLE.code); + try { + return sceneService.editScene(editSceneReq, account.getUsername()); + } catch (Exception e) { + log.warn("[SceneController.editScene] error :{}",e.getMessage()); + return Result.fail(CommonError.InvalidParamError); + } + } + + @HttpApiDoc(value = "/api/bench/scene/getSceneByID", apiName = "获取压测场景详情", method = MiApiRequestMethod.GET, description = "根据ID获取压测场景") + @RequestMapping(value = "/getSceneByID", method = RequestMethod.GET) + public Result getSceneByID( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneID", required = true, description = "场景ID", defaultValue = "66") + Integer sceneID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.newScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + try { + return sceneService.getSceneByID(sceneID,false); + } catch (Exception e) { + log.warn("[SceneController.getSceneByID] error :{}",e); + return Result.fail(CommonError.InvalidParamError); + } + } + + @HttpApiDoc(value = "/api/bench/scene/getSceneList", apiName = "获取压测场景列表", method = MiApiRequestMethod.POST, description = "获取压测场景列表") + @RequestMapping(value = "/getSceneList", method = RequestMethod.POST) + public Result getSceneList(GetSceneListReq req,HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.getSceneList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.setTenant(account.getTenant()); + return sceneService.getSceneList(req); + } + + @HttpApiDoc(value = "/api/bench/scene/getSceneListByIds", apiName = "根据id列表获取压测场景列表", method = MiApiRequestMethod.POST, description = "根据id列表获取压测场景列表") + @RequestMapping(value = "/getSceneListByIds", method = RequestMethod.POST) + public Result> getSceneListByIds(@RequestBody GetSceneListByIdsReq req,HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.getSceneListByIds] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneService.getSceneListByIds(req); + } + + @HttpApiDoc(value = "/api/bench/scene/getSceneListByGroup", apiName = "获取压测场景分组列表", method = MiApiRequestMethod.POST, description = "获取压测场景分组列表") + @RequestMapping(value = "/getSceneListByGroup", method = RequestMethod.POST) + public Result getSceneListByGroup(GetSceneGroupListReq req, HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.getSceneListByGroup] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.setTenant(account.getTenant()); + return sceneService.getSceneListByGroup(req); + } + + @HttpApiDoc(value = "/api/bench/scene/searchSceneByKeyword", apiName = "按关键字搜索场景", method = MiApiRequestMethod.POST, description = "按关键字搜索场景") + @RequestMapping(value = "/searchSceneByKeyword", method = RequestMethod.POST) + public Result searchSceneByKeyword(GetSceneListReq req,HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.newScene] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + req.setTenant(account.getTenant()); + try { + return sceneService.getSceneListByKeyword(req); + } catch (Exception e) { + log.warn("[SceneController.searchSceneByKeyword] error :{}",e.getMessage()); + return Result.fail(CommonError.InvalidParamError); } + } + + @HttpApiDoc(value = "/api/bench/scene/getSceneParamData", apiName = "获取压测场景参数数据", method = MiApiRequestMethod.GET, description = "获取压测场景参数数据,目前支持全局参数") + @RequestMapping(value = "/getSceneParamData", method = RequestMethod.POST) + public Result getSceneDataset( + @HttpApiDocClassDefine(value = "场景id",required = true,description = "所属场景id",defaultValue = "66") + Integer sceneId, HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.getSceneParamData] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneService.getSceneParamData(sceneId); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneGroupController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneGroupController.java new file mode 100644 index 000000000..a4ece8621 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneGroupController.java @@ -0,0 +1,75 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupDTO; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.SceneGroupService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +@Slf4j +@RestController +@RequestMapping("/api/bench/scene") +@HttpApiModule(value = "SceneGroupController", apiController = SceneGroupController.class) +public class SceneGroupController { + + @Autowired + private LoginService loginService; + + @Autowired + private SceneGroupService sceneGroupService; + + @HttpApiDoc(value = "/api/bench/scene/newSceneGroup", apiName = "新增场景分组", method = MiApiRequestMethod.POST, description = "新增场景分组") + @RequestMapping(value = "/newSceneGroup", method = RequestMethod.POST) + public Result newSceneGroup( + HttpServletRequest request, + @RequestBody SceneGroupDTO sceneGroupReq) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.newSceneGroup] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + sceneGroupReq.setTenant(account.getTenant()); + return sceneGroupService.newSceneGroup(sceneGroupReq, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/scene/deleteSceneGroup", apiName = "删除压测场景分组", method = MiApiRequestMethod.POST, description = "根据ID删除压测场景") + @RequestMapping(value = "/deleteSceneGroup", method = RequestMethod.POST) + public Result deleteSceneGroup( + HttpServletRequest request ,@RequestBody SceneGroupDTO sceneGroupReq){ + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.deleteSceneGroup] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return sceneGroupService.delSceneGroup(sceneGroupReq, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/scene/editSceneGroup", apiName = "编辑压测场景分组信息", method = MiApiRequestMethod.POST, description = "编辑压测场景") + @RequestMapping(value = "/editSceneGroup", method = RequestMethod.POST) + public Result editSceneGroup( + HttpServletRequest request, + @RequestBody SceneGroupDTO sceneGroupReq) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SceneController.editSceneGroup] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return sceneGroupService.editSceneGroup(sceneGroupReq, account.getUsername()); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneSnapshotController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneSnapshotController.java new file mode 100644 index 000000000..e667ab7ef --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SceneSnapshotController.java @@ -0,0 +1,71 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.SceneSnapshotBo; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.SceneService; +import run.mone.mimeter.dashboard.service.SceneSnapshotService; +import run.mone.mimeter.dashboard.service.impl.LoginService; +import run.mone.mimeter.dashboard.common.ApiConsts; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/23 + */ +@Slf4j +@RestController +@RequestMapping(ApiConsts.API_PREFIX + ApiConsts.SCENE_SNAPSHOT_ROUTE) +@HttpApiModule(value = "SceneSnapshotController", apiController = SceneSnapshotController.class) +public class SceneSnapshotController { + + @Autowired + private LoginService loginService; + + @Autowired + private SceneSnapshotService sceneSnapshotService; + + @Autowired + private SceneService sceneService; + + private final String logPrefix = "[SceneSnapshotController]"; + + @HttpApiDoc(value = ApiConsts.API_PREFIX + ApiConsts.SCENE_SNAPSHOT_ROUTE + ApiConsts.GENERAL_DETAILS_ENDPOINT, apiName = "获取压测场景快照", + method = MiApiRequestMethod.GET, description = "获取压测场景快照") + @GetMapping(ApiConsts.GENERAL_DETAILS_ENDPOINT) + public Result snapshotDetails(HttpServletRequest request, + @HttpApiDocClassDefine(value = "snapshotId", required = true) + @RequestParam String snapshotId) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn(this.logPrefix + "snapshotDetails current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return this.sceneSnapshotService.getSceneSnapshotById(snapshotId); + } + + @GetMapping("/scene") + public Result getByScene(HttpServletRequest request, + @RequestParam Long sceneId) { + SessionAccount account = this.loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn(this.logPrefix + "getByScene current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + return this.sceneSnapshotService.getSceneSnapshotByScene(sceneId); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SlaController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SlaController.java new file mode 100644 index 000000000..d1e2c4c03 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/SlaController.java @@ -0,0 +1,208 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.common.CommonEnum; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.sla.GetSlaListReq; +import run.mone.mimeter.dashboard.bo.sla.PerRuleItem; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; +import run.mone.mimeter.dashboard.bo.sla.SlaList; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.SlaService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +import static run.mone.mimeter.dashboard.bo.sla.DegreeEnum.*; +import static run.mone.mimeter.dashboard.bo.sla.SlaBusinessGroupEnum.InternetGame; +import static run.mone.mimeter.dashboard.bo.sla.SlaBusinessGroupEnum.InternetService; +import static run.mone.mimeter.dashboard.bo.sla.SlaRuleItemEnum.*; +import static run.mone.mimeter.dashboard.bo.sla.SlaRuleItemTypeEnum.BusinessMetrics; +import static run.mone.mimeter.dashboard.bo.sla.SlaRuleItemTypeEnum.MonitorMetrics; +import static run.mone.mimeter.dashboard.exception.CommonError.InvalidParamError; + + +@Slf4j +@RestController +@RequestMapping("/api/bench/sla") +@HttpApiModule(value = "SlaController", apiController = SlaController.class) +public class SlaController { + + @Autowired + private LoginService loginService; + + @Autowired + private SlaService slaService; + + + @HttpApiDoc(apiName = "sla新增", value = "/api/bench/sla/new", method = MiApiRequestMethod.POST, description = "sla新增") + @RequestMapping(value = "/new", method = RequestMethod.POST) + public Result newSla(HttpServletRequest request, + @RequestBody SlaDto param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.newSla] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.setCreator(account.getUsername()); + param.setUpdater(account.getUsername()); + + log.info("[SlaController.newSla] param: {}", param); + return slaService.newSla(param); + } + + @HttpApiDoc(apiName = "sla更新", value = "/api/bench/sla/update", method = MiApiRequestMethod.POST, description = "sla更新") + @RequestMapping(value = "/update", method = RequestMethod.POST) + public Result updateSla(HttpServletRequest request, + @RequestBody SlaDto param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.updateSla] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + param.setUpdater(account.getUsername()); + + log.info("[SlaController.updateSla] param: {}", param); + return slaService.updateSla(param); + } + + @HttpApiDoc(apiName = "sla列表", value = "/api/bench/sla/list", method = MiApiRequestMethod.POST, description = "sla列表") + @RequestMapping(value = "/list", method = RequestMethod.POST) + public Result getSlaList(HttpServletRequest request, + @RequestBody GetSlaListReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.getSlaList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[SlaController.getSlaList] param: {}", param); + if (param == null) { + return Result.fail(InvalidParamError); + } + return slaService.getSlaList(param); + } + + @HttpApiDoc(apiName = "sla删除", value = "/api/bench/sla/del", method = MiApiRequestMethod.DELETE, description = "sla删除") + @RequestMapping(value = "/del", method = RequestMethod.DELETE) + public Result delSla(HttpServletRequest request, + @RequestParam("id") int id) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.delSla] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[SlaController.delSla] param: {}", id); + return slaService.delSla(id); + } + + @HttpApiDoc(apiName = "sla批量删除", value = "/api/bench/sla/multiDel", method = MiApiRequestMethod.POST, description = "sla批量删除") + @RequestMapping(value = "/multiDel", method = RequestMethod.POST) + public Result multiDelSla(HttpServletRequest request, + @RequestBody List ids) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.multiDelSla] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[SlaController.multiDelSla] param: {}", ids); + return slaService.multiDelSla(ids); + } + + @HttpApiDoc(apiName = "获取sla详情", value = "/api/bench/sla/detail", method = MiApiRequestMethod.GET, description = "获取sla详情") + @RequestMapping(value = "/detail", method = RequestMethod.GET) + public Result detail(HttpServletRequest request, + @RequestParam("id") int id) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.detail] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + log.info("[SlaController.detail] param: {}", id); + return slaService.getSlaById(id); + } + + @HttpApiDoc(apiName = "sla业务分类枚举", value = "/api/bench/sla/businessgroup/list", method = MiApiRequestMethod.GET, description = "sla业务分类枚举") + @RequestMapping(value = "/businessgroup/list", method = RequestMethod.GET) + public Result> businessGroupList(HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.businessGroupList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + List list = Arrays.asList( + new CommonEnum(InternetService.businessGroupCname, InternetService.businessGroupName), + new CommonEnum(InternetGame.businessGroupCname, InternetGame.businessGroupName) + ); + return Result.success(list); + } + + @HttpApiDoc(apiName = "sla指标敏感程度枚举", value = "/api/bench/sla/degree/list", method = MiApiRequestMethod.GET, description = "sla指标敏感程度枚举") + @RequestMapping(value = "/degree/list", method = RequestMethod.GET) + public Result> degreeList(HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.degreeList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + List list = Arrays.asList( + new CommonEnum(Sensitive.code, Sensitive.degreeCname), + new CommonEnum(Tolerable.code, Tolerable.degreeCname), + new CommonEnum(NotSensitive.code, NotSensitive.degreeCname) + ); + return Result.success(list); + } + + @HttpApiDoc(apiName = "sla指标枚举", value = "/api/bench/sla/ruleItem/list", method = MiApiRequestMethod.GET, description = "sla指标枚举") + @RequestMapping(value = "/ruleItem/list", method = RequestMethod.GET) + public Result> ruleItemList(HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.ruleItemList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + List ruleItemList = new ArrayList<>(); + + PerRuleItem businessMetrics = new PerRuleItem(); + businessMetrics.setRuleItemTypeCname(BusinessMetrics.ruleItemTypeCname); + businessMetrics.setRuleItemTypeName(BusinessMetrics.ruleItemTypeName); + List businessMetricsList = Arrays.asList( + new CommonEnum(SuccessRate.ruleItemCname, SuccessRate.ruleItemName, SuccessRate.unit), + new CommonEnum(P99ResponseTime.ruleItemCname, P99ResponseTime.ruleItemName, P99ResponseTime.unit), + new CommonEnum(AvgResponseTime.ruleItemCname, AvgResponseTime.ruleItemName, AvgResponseTime.unit), + new CommonEnum(RequestPerSecond.ruleItemCname, RequestPerSecond.ruleItemName, RequestPerSecond.unit) + ); + businessMetrics.setRuleList(businessMetricsList); + ruleItemList.add(businessMetrics); + + PerRuleItem monitorMetrics = new PerRuleItem(); + monitorMetrics.setRuleItemTypeCname(MonitorMetrics.ruleItemTypeCname); + monitorMetrics.setRuleItemTypeName(MonitorMetrics.ruleItemTypeName); + List monitorMetricsList = Arrays.asList( + new CommonEnum(CpuUtilization.ruleItemCname, CpuUtilization.ruleItemName, CpuUtilization.unit), + new CommonEnum(MemoryUtilization.ruleItemCname, MemoryUtilization.ruleItemName, MemoryUtilization.unit), + new CommonEnum(Load5Average.ruleItemCname, Load5Average.ruleItemName, Load5Average.unit), + new CommonEnum(Load5Max.ruleItemCname, Load5Max.ruleItemName, Load5Max.unit), + new CommonEnum(DropConnectionAverage.ruleItemCname, DropConnectionAverage.ruleItemName, DropConnectionAverage.unit), + new CommonEnum(DropConnectionMax.ruleItemCname, DropConnectionMax.ruleItemName, DropConnectionMax.unit) + ); + monitorMetrics.setRuleList(monitorMetricsList); + ruleItemList.add(monitorMetrics); + + return Result.success(ruleItemList); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TaskController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TaskController.java new file mode 100644 index 000000000..66ed6a9a1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TaskController.java @@ -0,0 +1,219 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiDocClassDefine; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import run.mone.mimeter.dashboard.bo.ChangeQpsReq; +import run.mone.mimeter.dashboard.bo.DubboSceneDebugResult; +import run.mone.mimeter.dashboard.bo.HttpSceneDebugResult; +import run.mone.mimeter.dashboard.bo.SubmitTaskRes; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.task.DebugSceneApiInfoReq; +import run.mone.mimeter.dashboard.bo.task.SceneRpsRateReq; +import run.mone.mimeter.dashboard.bo.task.TaskDTO; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.TaskService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Objects; +import java.util.TreeMap; + +@Slf4j +@RestController +@RequestMapping(value = "/api/bench/task") +@HttpApiModule(value = "TaskController", apiController = TaskController.class) +public class TaskController { + + @Autowired + private LoginService loginService; + + @Autowired + private TaskService taskService; + + /** + * 单接口测试任务 + * + */ + @HttpApiDoc(value = "/api/bench/task/submitSingleApiDebugTask", apiName = "提交执行单接口测试任务", method = MiApiRequestMethod.POST, description = "提交接口测试执行任务") + @RequestMapping(value = "/submitSingleApiDebugTask", method = RequestMethod.POST) + public Result submitSingleApiDebugTask( + HttpServletRequest request, + @RequestBody DebugSceneApiInfoReq apiInfoReq + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.submitSingleApiDebugTask] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + TaskDTO taskDTO = new TaskDTO(); + taskDTO.setSubmitTaskType(Constants.SINGLE_API_DEBUG); + taskDTO.setApiInfo(apiInfoReq); + taskDTO.setTenant(account.getTenant()); + return taskService.submitTask(taskDTO, account.getUsername()); + } + + /** + * 执行场景调试任务 + * + * @param request + * @param + * @return + */ + @HttpApiDoc(value = "/api/bench/task/submitSceneDebugTask", apiName = "执行场景调试任务", method = MiApiRequestMethod.POST, description = "执行场景调试任务") + @RequestMapping(value = "/submitSceneDebugTask", method = RequestMethod.POST) + public Result submitSceneDebugTask( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneID", description = "场景id", required = true, defaultValue = "234") + Integer sceneID + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.submitSceneDebugTask] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + TaskDTO taskDTO = new TaskDTO(); + taskDTO.setSceneId(sceneID); + taskDTO.setSubmitTaskType(Constants.SCENE_DEBUG); + taskDTO.setTenant(account.getTenant()); + + return taskService.submitTask(taskDTO, account.getUsername()); + } + + /** + * 执行场景压测任务 + * + * @param request + * @param + * @return + */ + @HttpApiDoc(value = "/api/bench/task/submitSceneBenchTask", apiName = "执行场景压测任务", method = MiApiRequestMethod.POST, description = "执行场景压测任务") + @RequestMapping(value = "/submitSceneBenchTask", method = RequestMethod.POST) + public Result submitSceneBenchTask( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "sceneID", description = "场景id", required = true, defaultValue = "234") + Integer sceneID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.submitSceneBenchTask] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + TaskDTO taskDTO = new TaskDTO(); + taskDTO.setSceneId(sceneID); + taskDTO.setSubmitTaskType(Constants.SCENE_BENCH); + taskDTO.setTenant(account.getTenant()); + + return taskService.submitTask(taskDTO, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/task/stopTask", apiName = "停止任务", method = MiApiRequestMethod.POST, description = "停止任务") + @RequestMapping(value = "/stopTask", method = RequestMethod.POST) + public Result stopTask( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "type", required = true, description = "基于哪个id停止任务 0:报告id 1:场景", defaultValue = "1") + Integer type, + @HttpApiDocClassDefine(value = "sceneID", required = true, description = "场景ID", defaultValue = "66") + Integer sceneID, + @HttpApiDocClassDefine(value = "reportID", required = true, description = "报告ID", defaultValue = "66") + String reportID + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.stopTask] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + TaskDTO taskDTO = new TaskDTO(); + taskDTO.setReportId(reportID); + taskDTO.setSceneId(sceneID); + taskDTO.setTenant(account.getTenant()); + + return taskService.stopTask(type,taskDTO, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/task/manualUpdateRps", apiName = "手动调节链路rps", method = MiApiRequestMethod.POST, description = "手动调节链路rps") + @RequestMapping(value = "/manualUpdateRps", method = RequestMethod.POST) + public Result manualUpdateRps( + HttpServletRequest request, + @RequestBody ChangeQpsReq req + ) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.stopTask] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return taskService.manualUpdateRps(req); + } + + @HttpApiDoc(value = "/api/bench/task/manualUpdateSceneRpsRate", apiName = "实时手动调节整个场景发压比例", method = MiApiRequestMethod.POST, description = "手动调节链路rps") + @RequestMapping(value = "/manualUpdateSceneRpsRate", method = RequestMethod.POST) + public Result manualUpdateSceneRpsRate( + HttpServletRequest request, + @RequestBody SceneRpsRateReq req){ + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.manualUpdateSceneRpsRate] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return taskService.manualUpdateSceneRpsRate(req); + } + + @HttpApiDoc(value = "/api/bench/task/getHttpSceneDebugResultByTaskId", apiName = "获取场景调试结果数据", method = MiApiRequestMethod.POST, description = "获取场景调试结果数据") + @RequestMapping(value = "/getHttpSceneDebugResultByTaskId", method = RequestMethod.POST) + public Result>> getSceneDebugResultByTaskId( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "reportID", required = true, description = "该任务id", defaultValue = "66") + String reportID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.getSceneDebugResultByTaskId] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return taskService.getHttpSceneDebugResultByTaskId(reportID, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/task/getDubboSceneDebugResultByTaskId", apiName = "获取场景调试结果数据", method = MiApiRequestMethod.POST, description = "获取场景调试结果数据") + @RequestMapping(value = "/getDubboSceneDebugResultByTaskId", method = RequestMethod.POST) + public Result>> getDubboSceneDebugResultByTaskId( + HttpServletRequest request, + @HttpApiDocClassDefine(value = "reportID", required = true, description = "该任务id", defaultValue = "66") + String reportID) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.getDubboSceneDebugResultByTaskId] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser); + } + + return taskService.getDubboSceneDebugResultByTaskId(reportID, account.getUsername()); + } + + @HttpApiDoc(value = "/api/bench/task/stream", apiName = "连接实时压测", method = MiApiRequestMethod.GET, description = "连接实时压测") + @RequestMapping(value = "/stream", method = RequestMethod.GET, produces = {MediaType.TEXT_EVENT_STREAM_VALUE}) + public SseEmitter stream(HttpServletRequest request, + HttpServletResponse response, + @HttpApiDocClassDefine(value = "reportId", required = true) + @RequestParam String reportId) throws IllegalAccessException { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TaskController.stream] current user not have valid account info in session"); + throw new IllegalAccessException("用户未登录"); + } + response.addHeader("X-Accel-Buffering", "no"); + response.addHeader("Cache-Control","false"); + return this.taskService.stream(reportId, account.getUsername()); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficController.java new file mode 100644 index 000000000..2341b0bad --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficController.java @@ -0,0 +1,74 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.Result; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.traffic.GetTrafficReq; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.traffic.TrafficList; +import com.xiaomi.youpin.tesla.traffic.recording.api.service.TrafficDubboService; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + + +@Slf4j +@RestController +@RequestMapping("/api/bench/traffic") +@HttpApiModule(value = "TrafficController", apiController = TrafficController.class) +public class TrafficController { + + @Autowired + private LoginService loginService; + + @DubboReference(group = "${ref.traffic.service.group}", interfaceClass = TrafficDubboService.class, check = false,timeout = 3000) + private TrafficDubboService trafficDubboService; + + @HttpApiDoc(apiName = "流量列表", value = "/api/bench/traffic/list", method = MiApiRequestMethod.POST, description = "流量列表") + @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) + public Result getTrafficList(HttpServletRequest request, + @RequestBody GetTrafficReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficController.getTrafficList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + log.info("[TrafficController.getTrafficList] param: {}", param); + try { + return trafficDubboService.getTrafficList(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "流量删除", value = "/api/bench/traffic/del", method = MiApiRequestMethod.POST, description = "流量删除") + @RequestMapping(value = "/del", method = {RequestMethod.GET, RequestMethod.POST}) + public Result delTraffic(HttpServletRequest request, + @RequestBody GetTrafficReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficController.delTraffic] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + log.info("[TrafficController.delTraffic] param: {}", param); + try { + return trafficDubboService.delTraffic(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficRecordController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficRecordController.java new file mode 100644 index 000000000..4e8a9e5ac --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/TrafficRecordController.java @@ -0,0 +1,237 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import com.xiaomi.youpin.gateway.manager.bo.openApi.GatewayApiInfoList; +import com.xiaomi.youpin.gateway.manager.bo.openApi.GetGatewayApiInfoListReq; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.CommonEnum; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.Result; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.recording.GetRecordingConfigListReq; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.recording.RecordingConfig; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.recording.RecordingConfigList; +import com.xiaomi.youpin.tesla.traffic.recording.api.bo.recording.RecordingConfigReq; +import com.xiaomi.youpin.tesla.traffic.recording.api.service.RecordingDubboService; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import run.mone.mimeter.dashboard.bo.traffic.record.GetGwApiInfoListReq; +import run.mone.mimeter.dashboard.common.SessionAccount; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.impl.GatewayService; +import run.mone.mimeter.dashboard.service.impl.LoginService; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Objects; + + +@Slf4j +@RestController +@RequestMapping("/api/bench/trafficRecord") +@HttpApiModule(value = "TrafficRecordController", apiController = TrafficRecordController.class) +public class TrafficRecordController { + + @Autowired + private LoginService loginService; + + @Value("${server.env}") + private String env; + + @DubboReference(group = "${ref.traffic.service.group}", interfaceClass = RecordingDubboService.class, check = false,timeout = 3000) + private RecordingDubboService recordingDubboService; + + @Autowired + private GatewayService gatewayService; + + @HttpApiDoc(apiName = "网关流量录制---配置列表", value = "/api/bench/trafficRecord/gateway/config/list", method = MiApiRequestMethod.POST, description = "网关流量录制---配置列表") + @RequestMapping(value = "/gateway/config/list", method = {RequestMethod.GET, RequestMethod.POST}) + public Result getGatewayRecordingConfigList(HttpServletRequest request, + @RequestBody GetRecordingConfigListReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.getGatewayRecordingConfigList] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + log.info("[TrafficRecordController.getGatewayRecordingConfigList] param: {}", param); + try { + return recordingDubboService.getRecordingConfigList(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---新增配置", value = "/api/bench/trafficRecord/gateway/config/new", method = MiApiRequestMethod.POST, description = "网关流量录制---新增配置") + @RequestMapping(value = "/gateway/config/new", method = {RequestMethod.POST}) + public Result newGatewayRecordingConfig(HttpServletRequest request, + @RequestBody RecordingConfig param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.newGatewayRecordingConfig] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + param.setCreator(account.getUsername()); + param.setUpdater(account.getUsername()); + + log.info("[TrafficRecordController.newGatewayRecordingConfig] param: {}", param); + try { + return recordingDubboService.newRecordingConfig(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---更新配置", value = "/api/bench/trafficRecord/gateway/config/update", method = MiApiRequestMethod.POST, description = "网关流量录制---更新配置") + @RequestMapping(value = "/gateway/config/update", method = {RequestMethod.POST}) + public Result updateGatewayRecordingConfig(HttpServletRequest request, + @RequestBody RecordingConfig param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.updateGatewayRecordingConfig] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + param.setUpdater(account.getUsername()); + + log.info("[TrafficRecordController.updateGatewayRecordingConfig] param: {}", param); + try { + return recordingDubboService.updateRecordingConfig(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---删除配置", value = "/api/bench/trafficRecord/gateway/config/delete", method = MiApiRequestMethod.POST, description = "网关流量录制---删除配置") + @RequestMapping(value = "/gateway/config/delete", method = {RequestMethod.POST}) + public Result deleteGatewayRecordingConfig(HttpServletRequest request, + @RequestBody RecordingConfigReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.deleteGatewayRecordingConfig] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + param.setUser(account.getUsername()); + + log.info("[TrafficRecordController.deleteGatewayRecordingConfig] param: {}", param); + try { + return recordingDubboService.deleteRecordingConfig(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---配置详情", value = "/api/bench/trafficRecord/gateway/config/detail", method = MiApiRequestMethod.POST, description = "网关流量录制---配置详情") + @RequestMapping(value = "/gateway/config/detail", method = {RequestMethod.POST}) + public Result gatewayRecordingConfigDetail(HttpServletRequest request, + @RequestBody RecordingConfigReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.gatewayRecordingConfigDetail] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + log.info("[TrafficRecordController.gatewayRecordingConfigDetail] param: {}", param); + try { + return recordingDubboService.recordingConfigDetail(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---开始录制", value = "/api/bench/trafficRecord/gateway/config/start", method = MiApiRequestMethod.POST, description = "网关流量录制---开始录制") + @RequestMapping(value = "/gateway/config/start", method = {RequestMethod.POST}) + public Result startGatewayRecording(HttpServletRequest request, + @RequestBody RecordingConfigReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.startGatewayRecording] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + param.setUser(account.getUsername()); + log.info("[TrafficRecordController.startGatewayRecording] param: {}", param); + try { + return recordingDubboService.startRecording(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---停止录制", value = "/api/bench/trafficRecord/gateway/config/stop", method = MiApiRequestMethod.POST, description = "网关流量录制---停止录制") + @RequestMapping(value = "/gateway/config/stop", method = {RequestMethod.POST}) + public Result stopGatewayRecording(HttpServletRequest request, + @RequestBody RecordingConfigReq param) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.stopGatewayRecording] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + param.setUser(account.getUsername()); + log.info("[TrafficRecordController.stopGatewayRecording] param: {}", param); + try { + return recordingDubboService.stopRecording(param); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---获取网关环境枚举", value = "/api/bench/trafficRecord/gateway/envTypes", method = MiApiRequestMethod.GET, description = "网关流量录制---获取网关环境枚举") + @RequestMapping(value = "/gateway/envTypes", method = {RequestMethod.GET}) + public Result> getGatewayEnvTypes(HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.getGatewayEnvTypes] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + try { + return recordingDubboService.getGatewayEnvTypes(env); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + + @HttpApiDoc(apiName = "网关流量录制---网关接口列表", value = "/api/bench/trafficRecord/gateway/apiInfoList", method = MiApiRequestMethod.POST, description = "网关流量录制---网关接口列表") + @RequestMapping(value = "/gateway/apiInfoList", method = {RequestMethod.POST}) + public run.mone.mimeter.dashboard.bo.common.Result getGatewayApiInfoList(HttpServletRequest request, + @RequestBody GetGwApiInfoListReq req) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[SlaController.newSla] current user not have valid account info in session"); + return run.mone.mimeter.dashboard.bo.common.Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + try { + GetGatewayApiInfoListReq req1 = new GetGatewayApiInfoListReq(); + BeanUtils.copyProperties(req, req1); + return gatewayService.getGatewayApiInfoList(req1, account.getName(), req.getEnv()); + } catch (Exception e) { + return run.mone.mimeter.dashboard.bo.common.Result.fail(-1, e.getMessage()); + } + } + + + @HttpApiDoc(apiName = "流量录制---获取录制策略枚举", value = "/api/bench/trafficRecord/recordingStrategys", method = MiApiRequestMethod.GET, description = "流量录制---获取录制策略枚举") + @RequestMapping(value = "/recordingStrategys", method = {RequestMethod.GET}) + public Result> getRecordingStrategys(HttpServletRequest request) { + SessionAccount account = loginService.getAccountFromSession(request); + if (Objects.isNull(account)) { + log.warn("[TrafficRecordController.getRecordingStrategys] current user not have valid account info in session"); + return Result.fail(CommonError.UnknownUser.code, CommonError.UnknownUser.message); + } + + try { + return recordingDubboService.getRecordingStrategys(); + } catch (Exception e) { + return Result.fail(e.getMessage()); + } + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/UserController.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/UserController.java new file mode 100644 index 000000000..2b6ea6468 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/java/run/mone/mimeter/dashboard/controller/UserController.java @@ -0,0 +1,56 @@ +package run.mone.mimeter.dashboard.controller; + +import com.xiaomi.mone.http.docs.annotations.HttpApiDoc; +import com.xiaomi.mone.http.docs.annotations.HttpApiModule; +import com.xiaomi.mone.http.docs.annotations.MiApiRequestMethod; +import com.xiaomi.mone.tpc.login.util.UserUtil; +import com.xiaomi.mone.tpc.login.vo.AuthUserVo; +import com.xiaomi.youpin.gateway.manager.bo.user.UserInfoVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import run.mone.mimeter.dashboard.bo.UserInfo; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.service.impl.UserV1Service; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +@Slf4j +@RestController +@RequestMapping("/api/bench/user") +@HttpApiModule(value = "UserController", apiController = UserController.class) +public class UserController { + + @Autowired + UserV1Service userService; + + @ResponseBody + @RequestMapping("/getUserInfo") + @HttpApiDoc(value = "/api/bench/user/getUserInfo", apiName = "获取用户信息", method = MiApiRequestMethod.POST, description = "获取用户信息") + public Result userInfo(HttpServletRequest request) { + try { + return Result.success(userService.getUserInfo()); + } catch (Exception e) { + log.error("UserController.userInfo", e); + return Result.fail(CommonError.UnknownError); + } + } + + @RequestMapping(value = "/getAllPartnerList", method = RequestMethod.GET) + @HttpApiDoc(value = "/api/bench/user/getAllPartnerList", apiName = "获取用户列表", method = MiApiRequestMethod.POST, description = "获取用户列表") + public Result> getAllPartnerList(@RequestParam("username") String username, + HttpServletRequest request, + HttpServletResponse response) throws IOException { + if (username.length() < 3) { + return Result.fail(-1, "请输入三个以上字母搜索"); + } + AuthUserVo userVo = UserUtil.getUser(); + List accounts = userService.qryUserList(username, null, userVo); + return Result.success(accounts); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/application.properties b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/application.properties new file mode 100644 index 000000000..abae2b873 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/application.properties @@ -0,0 +1,55 @@ +#server +spring.application.name=mimeter-dashboard +server.type=${server.type} +server.port=${server.port} +server.env=${server.env} +server.debug=true +server.connection-timeout=1000 +is_local=${is_local} +is.online=@is.online@ + +server.cas.ignoreUrl=${server.cas.ignoreUrl} +cas.inner.auth=${cas.inner.auth} + +banner.charset=UTF-8 +server.tomcat.uri-encoding=UTF-8 +spring.http.encoding.charset=UTF-8 +spring.http.encoding.enabled=true +spring.http.encoding.force=true +spring.messages.encoding=UTF-8 +spring.servlet.multipart.max-file-size=512MB + +spring.datasource.driverClassName=com.mysql.jdbc.Driver +spring.datasource.default.initialPoolSize=10 +spring.datasource.default.maxPoolSize=20 +spring.datasource.default.minialPoolSize=10 + +dubbo.group=${dubbo.group} +dubbo.version=${dubbo.version} +dubbo.protocol.id=${dubbo.protocol.id} +dubbo.protocol.name=${dubbo.protocol.name} +dubbo.protocol.port=${dubbo.protocol.port} +nacos.config.addrs=${nacos.config.addrs} +nacos.config.data.id=${nacos.config.data.id} + +ref.miapi.service.group=${ref.miapi.service.group} +ref.miapi.service.version=${ref.miapi.service.version} +ref.traffic.service.group=${ref.traffic.service.group} +ref.gateway.service.group.staging=${ref.gateway.service.group.staging} +ref.gateway.service.group.intranet=${ref.gateway.service.group.intranet} +ref.gateway.service.group.online=${ref.gateway.service.group.online} +ref.hera.service.group=${ref.hera.service.group} +ref.k8s.service.group=${ref.k8s.service.group} +mimeter.monitor.dubbo.group=${mimeter.monitor.dubbo.group} +ref.tpc.service.group=${ref.tpc.service.group} + +es.address=${es.address} +es.user=${es.user} +es.pwd=${es.pwd} +es.index.apilog=${es.index.apilog} +es.type.apilog=${es.type.apilog} + +upload.save.base=${upload.save.base} +log.path=${log.path} + +app.nacos=${app.nacos} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/dev.properties b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/dev.properties new file mode 100644 index 000000000..ee7ca2b83 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/dev.properties @@ -0,0 +1,47 @@ +#server +spring.application.name=mimeter-dashboard +server.type=staging +server.env=staging +server.port=8081 +server.debug=true +server.connection-timeout=1000 + +is_local=true +is.online=false + +server.cas.ignoreUrl=/* +server.cas.loginUrl= +server.cas.logoutUrl= +token.parse.url= +cas.inner.auth=true + +dubbo.group=staging +dubbo.version=1.0 +dubbo.protocol.id=dubbo +dubbo.protocol.name=dubbo +dubbo.protocol.port=-1 +dubbo.registry.address=nacos://127.0.0.1:80 +nacos.config.addrs=127.0.0.1:80 +nacos.config.data.id=mibench_dashboard_config + +ref.miapi.service.group=staging +ref.miapi.service.version=1.0 +ref.traffic.service.group=staging +ref.gateway.service.group.staging= +ref.gateway.service.group.intranet=intranet +ref.gateway.service.group.online= +ref.hera.service.group=staging +ref.k8s.service.group=test +mimeter.monitor.dubbo.group= +ref.tpc.service.group=staging + +es.address=127.0.0.1:80 +es.user=test +es.pwd=test +es.index.apilog=zgq_common_staging_yace +es.type.apilog=_doc + + +log.path=/tmp/ +upload.save.base=/mimeter/dataset/ +bench.api_manager_url=http://127.0.0.1:8080 diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/opensource.properties b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/opensource.properties new file mode 100644 index 000000000..4097ed590 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/config/opensource.properties @@ -0,0 +1,41 @@ +#server +spring.application.name=mimeter-dashboard +server.type=staging +server.env=staging +server.port=8081 +server.debug=true +server.connection-timeout=1000 + +is_local=false +is.online=false + +server.cas.ignoreUrl=/OpenApi/* +cas.inner.auth=false + +dubbo.group=staging +dubbo.version=1.0 +dubbo.protocol.id=dubbo +dubbo.protocol.name=dubbo +dubbo.protocol.port=-1 +nacos.config.addrs=nacos:80 +nacos.config.data.id=mimeter_dashboard_open + +ref.miapi.service.group=staging +ref.miapi.service.version=1.0 +ref.traffic.service.group=staging +ref.gateway.service.group.staging=staging +ref.gateway.service.group.intranet=intranet +ref.gateway.service.group.online= +ref.hera.service.group=staging +ref.k8s.service.group=test +mimeter.monitor.dubbo.group= +ref.tpc.service.group=staging-open + +es.address=elasticsearch:9200 +es.user= +es.pwd= +es.index.apilog=zgq_common_staging_yace +es.type.apilog=_doc + +log.path=/home/work/log +upload.save.base=/mimeter/dataset/ diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/dubbo.properties b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/dubbo.properties new file mode 100644 index 000000000..a4be96c97 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/dubbo.properties @@ -0,0 +1 @@ +dubbo.trace.log.path=/home/work/log/dubbo/mimeter-dashboard_ diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/generatorConfig.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/generatorConfig.xml new file mode 100644 index 000000000..b2da93c93 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/generatorConfig.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/logback.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/logback.xml new file mode 100644 index 000000000..6e9b47828 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/logback.xml @@ -0,0 +1,59 @@ + + + + + + + + + ${log.path}/mimeter-dashboard/server.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/mimeter-dashboard/server.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + + + 0 + 60000 + + + + + + ${log.path}/mimeter-dashboard/error.log + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + ${log.path}/mimeter-dashboard/error.log.%d{yyyy-MM-dd-HH} + ${MAX_HISTORY} + + + ERROR + ACCEPT + DENY + + + + + + %d|%-5level|%X{trace_id}|%thread|%logger{40}|%msg%n + + + + + + + + + + + + + + + diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentApplyInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentApplyInfoMapper.xml new file mode 100644 index 000000000..36c61a1a0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentApplyInfoMapper.xml @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, apply_user, apply_org_id, apply_org_name, agent_ip, agent_hostname, apply_status, + ctime + + + + + delete from agent_apply_info + where id = #{id,jdbcType=INTEGER} + + + delete from agent_apply_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into agent_apply_info (apply_user, apply_org_id, apply_org_name, + agent_ip, agent_hostname, apply_status, + ctime) + values (#{applyUser,jdbcType=VARCHAR}, #{applyOrgId,jdbcType=VARCHAR}, #{applyOrgName,jdbcType=VARCHAR}, + #{agentIp,jdbcType=VARCHAR}, #{agentHostname,jdbcType=VARCHAR}, #{applyStatus,jdbcType=INTEGER}, + #{ctime,jdbcType=BIGINT}) + + + + SELECT LAST_INSERT_ID() + + insert into agent_apply_info + + + apply_user, + + + apply_org_id, + + + apply_org_name, + + + agent_ip, + + + agent_hostname, + + + apply_status, + + + ctime, + + + + + #{applyUser,jdbcType=VARCHAR}, + + + #{applyOrgId,jdbcType=VARCHAR}, + + + #{applyOrgName,jdbcType=VARCHAR}, + + + #{agentIp,jdbcType=VARCHAR}, + + + #{agentHostname,jdbcType=VARCHAR}, + + + #{applyStatus,jdbcType=INTEGER}, + + + #{ctime,jdbcType=BIGINT}, + + + + + + update agent_apply_info + + + id = #{record.id,jdbcType=INTEGER}, + + + apply_user = #{record.applyUser,jdbcType=VARCHAR}, + + + apply_org_id = #{record.applyOrgId,jdbcType=VARCHAR}, + + + apply_org_name = #{record.applyOrgName,jdbcType=VARCHAR}, + + + agent_ip = #{record.agentIp,jdbcType=VARCHAR}, + + + agent_hostname = #{record.agentHostname,jdbcType=VARCHAR}, + + + apply_status = #{record.applyStatus,jdbcType=INTEGER}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + + + + + + update agent_apply_info + set id = #{record.id,jdbcType=INTEGER}, + apply_user = #{record.applyUser,jdbcType=VARCHAR}, + apply_org_id = #{record.applyOrgId,jdbcType=VARCHAR}, + apply_org_name = #{record.applyOrgName,jdbcType=VARCHAR}, + agent_ip = #{record.agentIp,jdbcType=VARCHAR}, + agent_hostname = #{record.agentHostname,jdbcType=VARCHAR}, + apply_status = #{record.applyStatus,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT} + + + + + + update agent_apply_info + + + apply_user = #{applyUser,jdbcType=VARCHAR}, + + + apply_org_id = #{applyOrgId,jdbcType=VARCHAR}, + + + apply_org_name = #{applyOrgName,jdbcType=VARCHAR}, + + + agent_ip = #{agentIp,jdbcType=VARCHAR}, + + + agent_hostname = #{agentHostname,jdbcType=VARCHAR}, + + + apply_status = #{applyStatus,jdbcType=INTEGER}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update agent_apply_info + set apply_user = #{applyUser,jdbcType=VARCHAR}, + apply_org_id = #{applyOrgId,jdbcType=VARCHAR}, + apply_org_name = #{applyOrgName,jdbcType=VARCHAR}, + agent_ip = #{agentIp,jdbcType=VARCHAR}, + agent_hostname = #{agentHostname,jdbcType=VARCHAR}, + apply_status = #{applyStatus,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + insert into agent_apply_info + (apply_user, apply_org_id, apply_org_name, agent_ip, agent_hostname, apply_status, + ctime) + values + + (#{item.applyUser,jdbcType=VARCHAR}, #{item.applyOrgId,jdbcType=VARCHAR}, #{item.applyOrgName,jdbcType=VARCHAR}, + #{item.agentIp,jdbcType=VARCHAR}, #{item.agentHostname,jdbcType=VARCHAR}, #{item.applyStatus,jdbcType=INTEGER}, + #{item.ctime,jdbcType=BIGINT}) + + + + insert into agent_apply_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.applyUser,jdbcType=VARCHAR} + + + #{item.applyOrgId,jdbcType=VARCHAR} + + + #{item.applyOrgName,jdbcType=VARCHAR} + + + #{item.agentIp,jdbcType=VARCHAR} + + + #{item.agentHostname,jdbcType=VARCHAR} + + + #{item.applyStatus,jdbcType=INTEGER} + + + #{item.ctime,jdbcType=BIGINT} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentInfoMapper.xml new file mode 100644 index 000000000..816a56a56 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/AgentInfoMapper.xml @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, server_name, ip, port, cpu, mem, use_cpu, use_mem, hostname, client_desc, ctime, + utime, enable, node_ip, tenant, tenant_cn + + + domain_conf + + + + + + delete from agent_info + where id = #{id,jdbcType=INTEGER} + + + delete from agent_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into agent_info (server_name, ip, port, + cpu, mem, use_cpu, use_mem, + hostname, client_desc, ctime, + utime, enable, node_ip, tenant, + tenant_cn, domain_conf) + values (#{serverName,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, + #{cpu,jdbcType=INTEGER}, #{mem,jdbcType=BIGINT}, #{useCpu,jdbcType=INTEGER}, #{useMem,jdbcType=BIGINT}, + #{hostname,jdbcType=VARCHAR}, #{clientDesc,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, + #{utime,jdbcType=BIGINT}, #{enable,jdbcType=BIT}, #{nodeIp,jdbcType=VARCHAR}, #{tenant,jdbcType=VARCHAR}, + #{tenantCn,jdbcType=VARCHAR}, #{domainConf,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into agent_info + + + server_name, + + + ip, + + + port, + + + cpu, + + + mem, + + + use_cpu, + + + use_mem, + + + hostname, + + + client_desc, + + + ctime, + + + utime, + + + enable, + + + node_ip, + + + tenant, + + + tenant_cn, + + + domain_conf, + + + + + #{serverName,jdbcType=VARCHAR}, + + + #{ip,jdbcType=VARCHAR}, + + + #{port,jdbcType=INTEGER}, + + + #{cpu,jdbcType=INTEGER}, + + + #{mem,jdbcType=BIGINT}, + + + #{useCpu,jdbcType=INTEGER}, + + + #{useMem,jdbcType=BIGINT}, + + + #{hostname,jdbcType=VARCHAR}, + + + #{clientDesc,jdbcType=VARCHAR}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{enable,jdbcType=BIT}, + + + #{nodeIp,jdbcType=VARCHAR}, + + + #{tenant,jdbcType=VARCHAR}, + + + #{tenantCn,jdbcType=VARCHAR}, + + + #{domainConf,jdbcType=LONGVARCHAR}, + + + + + + update agent_info + + + id = #{record.id,jdbcType=INTEGER}, + + + server_name = #{record.serverName,jdbcType=VARCHAR}, + + + ip = #{record.ip,jdbcType=VARCHAR}, + + + port = #{record.port,jdbcType=INTEGER}, + + + cpu = #{record.cpu,jdbcType=INTEGER}, + + + mem = #{record.mem,jdbcType=BIGINT}, + + + use_cpu = #{record.useCpu,jdbcType=INTEGER}, + + + use_mem = #{record.useMem,jdbcType=BIGINT}, + + + hostname = #{record.hostname,jdbcType=VARCHAR}, + + + client_desc = #{record.clientDesc,jdbcType=VARCHAR}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + enable = #{record.enable,jdbcType=BIT}, + + + node_ip = #{record.nodeIp,jdbcType=VARCHAR}, + + + tenant = #{record.tenant,jdbcType=VARCHAR}, + + + tenant_cn = #{record.tenantCn,jdbcType=VARCHAR}, + + + domain_conf = #{record.domainConf,jdbcType=LONGVARCHAR}, + + + + + + + + update agent_info + set id = #{record.id,jdbcType=INTEGER}, + server_name = #{record.serverName,jdbcType=VARCHAR}, + ip = #{record.ip,jdbcType=VARCHAR}, + port = #{record.port,jdbcType=INTEGER}, + cpu = #{record.cpu,jdbcType=INTEGER}, + mem = #{record.mem,jdbcType=BIGINT}, + use_cpu = #{record.useCpu,jdbcType=INTEGER}, + use_mem = #{record.useMem,jdbcType=BIGINT}, + hostname = #{record.hostname,jdbcType=VARCHAR}, + client_desc = #{record.clientDesc,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + enable = #{record.enable,jdbcType=BIT}, + node_ip = #{record.nodeIp,jdbcType=VARCHAR}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + tenant_cn = #{record.tenantCn,jdbcType=VARCHAR}, + domain_conf = #{record.domainConf,jdbcType=LONGVARCHAR} + + + + + + update agent_info + set id = #{record.id,jdbcType=INTEGER}, + server_name = #{record.serverName,jdbcType=VARCHAR}, + ip = #{record.ip,jdbcType=VARCHAR}, + port = #{record.port,jdbcType=INTEGER}, + cpu = #{record.cpu,jdbcType=INTEGER}, + mem = #{record.mem,jdbcType=BIGINT}, + use_cpu = #{record.useCpu,jdbcType=INTEGER}, + use_mem = #{record.useMem,jdbcType=BIGINT}, + hostname = #{record.hostname,jdbcType=VARCHAR}, + client_desc = #{record.clientDesc,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + enable = #{record.enable,jdbcType=BIT}, + node_ip = #{record.nodeIp,jdbcType=VARCHAR}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + tenant_cn = #{record.tenantCn,jdbcType=VARCHAR} + + + + + + update agent_info + + + server_name = #{serverName,jdbcType=VARCHAR}, + + + ip = #{ip,jdbcType=VARCHAR}, + + + port = #{port,jdbcType=INTEGER}, + + + cpu = #{cpu,jdbcType=INTEGER}, + + + mem = #{mem,jdbcType=BIGINT}, + + + use_cpu = #{useCpu,jdbcType=INTEGER}, + + + use_mem = #{useMem,jdbcType=BIGINT}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + client_desc = #{clientDesc,jdbcType=VARCHAR}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + enable = #{enable,jdbcType=BIT}, + + + node_ip = #{nodeIp,jdbcType=VARCHAR}, + + + tenant = #{tenant,jdbcType=VARCHAR}, + + + tenant_cn = #{tenantCn,jdbcType=VARCHAR}, + + + domain_conf = #{domainConf,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update agent_info + set server_name = #{serverName,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + port = #{port,jdbcType=INTEGER}, + cpu = #{cpu,jdbcType=INTEGER}, + mem = #{mem,jdbcType=BIGINT}, + use_cpu = #{useCpu,jdbcType=INTEGER}, + use_mem = #{useMem,jdbcType=BIGINT}, + hostname = #{hostname,jdbcType=VARCHAR}, + client_desc = #{clientDesc,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + enable = #{enable,jdbcType=BIT}, + node_ip = #{nodeIp,jdbcType=VARCHAR}, + tenant = #{tenant,jdbcType=VARCHAR}, + tenant_cn = #{tenantCn,jdbcType=VARCHAR}, + domain_conf = #{domainConf,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update agent_info + set server_name = #{serverName,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + port = #{port,jdbcType=INTEGER}, + cpu = #{cpu,jdbcType=INTEGER}, + mem = #{mem,jdbcType=BIGINT}, + use_cpu = #{useCpu,jdbcType=INTEGER}, + use_mem = #{useMem,jdbcType=BIGINT}, + hostname = #{hostname,jdbcType=VARCHAR}, + client_desc = #{clientDesc,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + enable = #{enable,jdbcType=BIT}, + node_ip = #{nodeIp,jdbcType=VARCHAR}, + tenant = #{tenant,jdbcType=VARCHAR}, + tenant_cn = #{tenantCn,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + insert into agent_info + (server_name, ip, port, cpu, mem, use_cpu, use_mem, hostname, client_desc, ctime, + utime, enable, node_ip, tenant, tenant_cn, domain_conf) + values + + (#{item.serverName,jdbcType=VARCHAR}, #{item.ip,jdbcType=VARCHAR}, #{item.port,jdbcType=INTEGER}, + #{item.cpu,jdbcType=INTEGER}, #{item.mem,jdbcType=BIGINT}, #{item.useCpu,jdbcType=INTEGER}, + #{item.useMem,jdbcType=BIGINT}, #{item.hostname,jdbcType=VARCHAR}, #{item.clientDesc,jdbcType=VARCHAR}, + #{item.ctime,jdbcType=BIGINT}, #{item.utime,jdbcType=BIGINT}, #{item.enable,jdbcType=BIT}, + #{item.nodeIp,jdbcType=VARCHAR}, #{item.tenant,jdbcType=VARCHAR}, #{item.tenantCn,jdbcType=VARCHAR}, + #{item.domainConf,jdbcType=LONGVARCHAR}) + + + + insert into agent_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.serverName,jdbcType=VARCHAR} + + + #{item.ip,jdbcType=VARCHAR} + + + #{item.port,jdbcType=INTEGER} + + + #{item.cpu,jdbcType=INTEGER} + + + #{item.mem,jdbcType=BIGINT} + + + #{item.useCpu,jdbcType=INTEGER} + + + #{item.useMem,jdbcType=BIGINT} + + + #{item.hostname,jdbcType=VARCHAR} + + + #{item.clientDesc,jdbcType=VARCHAR} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.enable,jdbcType=BIT} + + + #{item.nodeIp,jdbcType=VARCHAR} + + + #{item.tenant,jdbcType=VARCHAR} + + + #{item.tenantCn,jdbcType=VARCHAR} + + + #{item.domainConf,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/CheckPointInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/CheckPointInfoMapper.xml new file mode 100644 index 000000000..6a787b293 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/CheckPointInfoMapper.xml @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, check_type, check_obj, check_condition + + + check_content + + + + + + delete from checkpoint_info + where id = #{id,jdbcType=INTEGER} + + + delete from checkpoint_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into checkpoint_info (check_type, check_obj, check_condition, + check_content) + values (#{checkType,jdbcType=INTEGER}, #{checkObj,jdbcType=VARCHAR}, #{checkCondition,jdbcType=INTEGER}, + #{checkContent,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into checkpoint_info + + + check_type, + + + check_obj, + + + check_condition, + + + check_content, + + + + + #{checkType,jdbcType=INTEGER}, + + + #{checkObj,jdbcType=VARCHAR}, + + + #{checkCondition,jdbcType=INTEGER}, + + + #{checkContent,jdbcType=LONGVARCHAR}, + + + + + + update checkpoint_info + + + id = #{record.id,jdbcType=INTEGER}, + + + check_type = #{record.checkType,jdbcType=INTEGER}, + + + check_obj = #{record.checkObj,jdbcType=VARCHAR}, + + + check_condition = #{record.checkCondition,jdbcType=INTEGER}, + + + check_content = #{record.checkContent,jdbcType=LONGVARCHAR}, + + + + + + + + update checkpoint_info + set id = #{record.id,jdbcType=INTEGER}, + check_type = #{record.checkType,jdbcType=INTEGER}, + check_obj = #{record.checkObj,jdbcType=VARCHAR}, + check_condition = #{record.checkCondition,jdbcType=INTEGER}, + check_content = #{record.checkContent,jdbcType=LONGVARCHAR} + + + + + + update checkpoint_info + set id = #{record.id,jdbcType=INTEGER}, + check_type = #{record.checkType,jdbcType=INTEGER}, + check_obj = #{record.checkObj,jdbcType=VARCHAR}, + check_condition = #{record.checkCondition,jdbcType=INTEGER} + + + + + + update checkpoint_info + + + check_type = #{checkType,jdbcType=INTEGER}, + + + check_obj = #{checkObj,jdbcType=VARCHAR}, + + + check_condition = #{checkCondition,jdbcType=INTEGER}, + + + check_content = #{checkContent,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update checkpoint_info + set check_type = #{checkType,jdbcType=INTEGER}, + check_obj = #{checkObj,jdbcType=VARCHAR}, + check_condition = #{checkCondition,jdbcType=INTEGER}, + check_content = #{checkContent,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update checkpoint_info + set check_type = #{checkType,jdbcType=INTEGER}, + check_obj = #{checkObj,jdbcType=VARCHAR}, + check_condition = #{checkCondition,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + + insert into checkpoint_info + (check_type, check_obj, check_condition, check_content) + values + + (#{item.checkType,jdbcType=INTEGER}, #{item.checkObj,jdbcType=VARCHAR}, #{item.checkCondition,jdbcType=INTEGER}, + #{item.checkContent,jdbcType=LONGVARCHAR}) + + + + insert into checkpoint_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.checkType,jdbcType=INTEGER} + + + #{item.checkObj,jdbcType=VARCHAR} + + + #{item.checkCondition,jdbcType=INTEGER} + + + #{item.checkContent,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetMapper.xml new file mode 100644 index 000000000..539236646 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetMapper.xml @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, note, type, default_param_name, ignore_first_row, file_name, file_url, + file_ks_key, file_rows, file_size, interface_url, traffic_record_id, ctime, utime, + creator, updater, tenant + + + preview_file_rows, header + + + + + + delete from dataset + where id = #{id,jdbcType=INTEGER} + + + delete from dataset + + + + + + + SELECT LAST_INSERT_ID() + + insert into dataset (name, note, type, + default_param_name, ignore_first_row, file_name, + file_url, file_ks_key, file_rows, + file_size, interface_url, traffic_record_id, + ctime, utime, creator, + updater, tenant, preview_file_rows, + header) + values (#{name,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, + #{defaultParamName,jdbcType=VARCHAR}, #{ignoreFirstRow,jdbcType=INTEGER}, #{fileName,jdbcType=VARCHAR}, + #{fileUrl,jdbcType=VARCHAR}, #{fileKsKey,jdbcType=VARCHAR}, #{fileRows,jdbcType=BIGINT}, + #{fileSize,jdbcType=BIGINT}, #{interfaceUrl,jdbcType=VARCHAR}, #{trafficRecordId,jdbcType=INTEGER}, + #{ctime,jdbcType=BIGINT}, #{utime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, + #{updater,jdbcType=VARCHAR}, #{tenant,jdbcType=VARCHAR}, #{previewFileRows,jdbcType=LONGVARCHAR}, + #{header,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into dataset + + + name, + + + note, + + + type, + + + default_param_name, + + + ignore_first_row, + + + file_name, + + + file_url, + + + file_ks_key, + + + file_rows, + + + file_size, + + + interface_url, + + + traffic_record_id, + + + ctime, + + + utime, + + + creator, + + + updater, + + + tenant, + + + preview_file_rows, + + + header, + + + + + #{name,jdbcType=VARCHAR}, + + + #{note,jdbcType=VARCHAR}, + + + #{type,jdbcType=INTEGER}, + + + #{defaultParamName,jdbcType=VARCHAR}, + + + #{ignoreFirstRow,jdbcType=INTEGER}, + + + #{fileName,jdbcType=VARCHAR}, + + + #{fileUrl,jdbcType=VARCHAR}, + + + #{fileKsKey,jdbcType=VARCHAR}, + + + #{fileRows,jdbcType=BIGINT}, + + + #{fileSize,jdbcType=BIGINT}, + + + #{interfaceUrl,jdbcType=VARCHAR}, + + + #{trafficRecordId,jdbcType=INTEGER}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{creator,jdbcType=VARCHAR}, + + + #{updater,jdbcType=VARCHAR}, + + + #{tenant,jdbcType=VARCHAR}, + + + #{previewFileRows,jdbcType=LONGVARCHAR}, + + + #{header,jdbcType=LONGVARCHAR}, + + + + + + update dataset + + + id = #{record.id,jdbcType=INTEGER}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + note = #{record.note,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=INTEGER}, + + + default_param_name = #{record.defaultParamName,jdbcType=VARCHAR}, + + + ignore_first_row = #{record.ignoreFirstRow,jdbcType=INTEGER}, + + + file_name = #{record.fileName,jdbcType=VARCHAR}, + + + file_url = #{record.fileUrl,jdbcType=VARCHAR}, + + + file_ks_key = #{record.fileKsKey,jdbcType=VARCHAR}, + + + file_rows = #{record.fileRows,jdbcType=BIGINT}, + + + file_size = #{record.fileSize,jdbcType=BIGINT}, + + + interface_url = #{record.interfaceUrl,jdbcType=VARCHAR}, + + + traffic_record_id = #{record.trafficRecordId,jdbcType=INTEGER}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + updater = #{record.updater,jdbcType=VARCHAR}, + + + tenant = #{record.tenant,jdbcType=VARCHAR}, + + + preview_file_rows = #{record.previewFileRows,jdbcType=LONGVARCHAR}, + + + header = #{record.header,jdbcType=LONGVARCHAR}, + + + + + + + + update dataset + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + note = #{record.note,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=INTEGER}, + default_param_name = #{record.defaultParamName,jdbcType=VARCHAR}, + ignore_first_row = #{record.ignoreFirstRow,jdbcType=INTEGER}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + file_url = #{record.fileUrl,jdbcType=VARCHAR}, + file_ks_key = #{record.fileKsKey,jdbcType=VARCHAR}, + file_rows = #{record.fileRows,jdbcType=BIGINT}, + file_size = #{record.fileSize,jdbcType=BIGINT}, + interface_url = #{record.interfaceUrl,jdbcType=VARCHAR}, + traffic_record_id = #{record.trafficRecordId,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + updater = #{record.updater,jdbcType=VARCHAR}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + preview_file_rows = #{record.previewFileRows,jdbcType=LONGVARCHAR}, + header = #{record.header,jdbcType=LONGVARCHAR} + + + + + + update dataset + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + note = #{record.note,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=INTEGER}, + default_param_name = #{record.defaultParamName,jdbcType=VARCHAR}, + ignore_first_row = #{record.ignoreFirstRow,jdbcType=INTEGER}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + file_url = #{record.fileUrl,jdbcType=VARCHAR}, + file_ks_key = #{record.fileKsKey,jdbcType=VARCHAR}, + file_rows = #{record.fileRows,jdbcType=BIGINT}, + file_size = #{record.fileSize,jdbcType=BIGINT}, + interface_url = #{record.interfaceUrl,jdbcType=VARCHAR}, + traffic_record_id = #{record.trafficRecordId,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + updater = #{record.updater,jdbcType=VARCHAR}, + tenant = #{record.tenant,jdbcType=VARCHAR} + + + + + + update dataset + + + name = #{name,jdbcType=VARCHAR}, + + + note = #{note,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=INTEGER}, + + + default_param_name = #{defaultParamName,jdbcType=VARCHAR}, + + + ignore_first_row = #{ignoreFirstRow,jdbcType=INTEGER}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + file_url = #{fileUrl,jdbcType=VARCHAR}, + + + file_ks_key = #{fileKsKey,jdbcType=VARCHAR}, + + + file_rows = #{fileRows,jdbcType=BIGINT}, + + + file_size = #{fileSize,jdbcType=BIGINT}, + + + interface_url = #{interfaceUrl,jdbcType=VARCHAR}, + + + traffic_record_id = #{trafficRecordId,jdbcType=INTEGER}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + tenant = #{tenant,jdbcType=VARCHAR}, + + + preview_file_rows = #{previewFileRows,jdbcType=LONGVARCHAR}, + + + header = #{header,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update dataset + set name = #{name,jdbcType=VARCHAR}, + note = #{note,jdbcType=VARCHAR}, + type = #{type,jdbcType=INTEGER}, + default_param_name = #{defaultParamName,jdbcType=VARCHAR}, + ignore_first_row = #{ignoreFirstRow,jdbcType=INTEGER}, + file_name = #{fileName,jdbcType=VARCHAR}, + file_url = #{fileUrl,jdbcType=VARCHAR}, + file_ks_key = #{fileKsKey,jdbcType=VARCHAR}, + file_rows = #{fileRows,jdbcType=BIGINT}, + file_size = #{fileSize,jdbcType=BIGINT}, + interface_url = #{interfaceUrl,jdbcType=VARCHAR}, + traffic_record_id = #{trafficRecordId,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + updater = #{updater,jdbcType=VARCHAR}, + tenant = #{tenant,jdbcType=VARCHAR}, + preview_file_rows = #{previewFileRows,jdbcType=LONGVARCHAR}, + header = #{header,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update dataset + set name = #{name,jdbcType=VARCHAR}, + note = #{note,jdbcType=VARCHAR}, + type = #{type,jdbcType=INTEGER}, + default_param_name = #{defaultParamName,jdbcType=VARCHAR}, + ignore_first_row = #{ignoreFirstRow,jdbcType=INTEGER}, + file_name = #{fileName,jdbcType=VARCHAR}, + file_url = #{fileUrl,jdbcType=VARCHAR}, + file_ks_key = #{fileKsKey,jdbcType=VARCHAR}, + file_rows = #{fileRows,jdbcType=BIGINT}, + file_size = #{fileSize,jdbcType=BIGINT}, + interface_url = #{interfaceUrl,jdbcType=VARCHAR}, + traffic_record_id = #{trafficRecordId,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + updater = #{updater,jdbcType=VARCHAR}, + tenant = #{tenant,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + insert into dataset + (name, note, type, default_param_name, ignore_first_row, file_name, file_url, file_ks_key, + file_rows, file_size, interface_url, traffic_record_id, ctime, utime, creator, + updater, tenant, preview_file_rows, header) + values + + (#{item.name,jdbcType=VARCHAR}, #{item.note,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER}, + #{item.defaultParamName,jdbcType=VARCHAR}, #{item.ignoreFirstRow,jdbcType=INTEGER}, + #{item.fileName,jdbcType=VARCHAR}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.fileKsKey,jdbcType=VARCHAR}, + #{item.fileRows,jdbcType=BIGINT}, #{item.fileSize,jdbcType=BIGINT}, #{item.interfaceUrl,jdbcType=VARCHAR}, + #{item.trafficRecordId,jdbcType=INTEGER}, #{item.ctime,jdbcType=BIGINT}, #{item.utime,jdbcType=BIGINT}, + #{item.creator,jdbcType=VARCHAR}, #{item.updater,jdbcType=VARCHAR}, #{item.tenant,jdbcType=VARCHAR}, + #{item.previewFileRows,jdbcType=LONGVARCHAR}, #{item.header,jdbcType=LONGVARCHAR} + ) + + + + insert into dataset ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.name,jdbcType=VARCHAR} + + + #{item.note,jdbcType=VARCHAR} + + + #{item.type,jdbcType=INTEGER} + + + #{item.defaultParamName,jdbcType=VARCHAR} + + + #{item.ignoreFirstRow,jdbcType=INTEGER} + + + #{item.fileName,jdbcType=VARCHAR} + + + #{item.fileUrl,jdbcType=VARCHAR} + + + #{item.fileKsKey,jdbcType=VARCHAR} + + + #{item.fileRows,jdbcType=BIGINT} + + + #{item.fileSize,jdbcType=BIGINT} + + + #{item.interfaceUrl,jdbcType=VARCHAR} + + + #{item.trafficRecordId,jdbcType=INTEGER} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.updater,jdbcType=VARCHAR} + + + #{item.tenant,jdbcType=VARCHAR} + + + #{item.previewFileRows,jdbcType=LONGVARCHAR} + + + #{item.header,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetSceneRelationMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetSceneRelationMapper.xml new file mode 100644 index 000000000..b2712c7b4 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DatasetSceneRelationMapper.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, dataset_id, scene_id, ctime, utime, creator, updater, enable + + + + + delete from dataset_scene_relation + where id = #{id,jdbcType=INTEGER} + + + delete from dataset_scene_relation + + + + + + + SELECT LAST_INSERT_ID() + + insert into dataset_scene_relation (dataset_id, scene_id, ctime, + utime, creator, updater, + enable) + values (#{datasetId,jdbcType=INTEGER}, #{sceneId,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT}, + #{utime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, #{updater,jdbcType=VARCHAR}, + #{enable,jdbcType=BIT}) + + + + SELECT LAST_INSERT_ID() + + insert into dataset_scene_relation + + + dataset_id, + + + scene_id, + + + ctime, + + + utime, + + + creator, + + + updater, + + + enable, + + + + + #{datasetId,jdbcType=INTEGER}, + + + #{sceneId,jdbcType=INTEGER}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{creator,jdbcType=VARCHAR}, + + + #{updater,jdbcType=VARCHAR}, + + + #{enable,jdbcType=BIT}, + + + + + + update dataset_scene_relation + + + id = #{record.id,jdbcType=INTEGER}, + + + dataset_id = #{record.datasetId,jdbcType=INTEGER}, + + + scene_id = #{record.sceneId,jdbcType=INTEGER}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + updater = #{record.updater,jdbcType=VARCHAR}, + + + enable = #{record.enable,jdbcType=BIT}, + + + + + + + + update dataset_scene_relation + set id = #{record.id,jdbcType=INTEGER}, + dataset_id = #{record.datasetId,jdbcType=INTEGER}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + updater = #{record.updater,jdbcType=VARCHAR}, + enable = #{record.enable,jdbcType=BIT} + + + + + + update dataset_scene_relation + + + dataset_id = #{datasetId,jdbcType=INTEGER}, + + + scene_id = #{sceneId,jdbcType=INTEGER}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + enable = #{enable,jdbcType=BIT}, + + + where id = #{id,jdbcType=INTEGER} + + + update dataset_scene_relation + set dataset_id = #{datasetId,jdbcType=INTEGER}, + scene_id = #{sceneId,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + updater = #{updater,jdbcType=VARCHAR}, + enable = #{enable,jdbcType=BIT} + where id = #{id,jdbcType=INTEGER} + + + insert into dataset_scene_relation + (dataset_id, scene_id, ctime, utime, creator, updater, enable) + values + + (#{item.datasetId,jdbcType=INTEGER}, #{item.sceneId,jdbcType=INTEGER}, #{item.ctime,jdbcType=BIGINT}, + #{item.utime,jdbcType=BIGINT}, #{item.creator,jdbcType=VARCHAR}, #{item.updater,jdbcType=VARCHAR}, + #{item.enable,jdbcType=BIT}) + + + + insert into dataset_scene_relation ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.datasetId,jdbcType=INTEGER} + + + #{item.sceneId,jdbcType=INTEGER} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.updater,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DomainApplyInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DomainApplyInfoMapper.xml new file mode 100644 index 000000000..fe483ed74 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/DomainApplyInfoMapper.xml @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, apply_user, domain, ip, apply_status, ctime + + + agent_ip_list + + + + + + delete from domain_apply_info + where id = #{id,jdbcType=INTEGER} + + + delete from domain_apply_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into domain_apply_info (apply_user, domain, ip, + apply_status, ctime, agent_ip_list + ) + values (#{applyUser,jdbcType=VARCHAR}, #{domain,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, + #{applyStatus,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT}, #{agentIpList,jdbcType=LONGVARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into domain_apply_info + + + apply_user, + + + domain, + + + ip, + + + apply_status, + + + ctime, + + + agent_ip_list, + + + + + #{applyUser,jdbcType=VARCHAR}, + + + #{domain,jdbcType=VARCHAR}, + + + #{ip,jdbcType=VARCHAR}, + + + #{applyStatus,jdbcType=INTEGER}, + + + #{ctime,jdbcType=BIGINT}, + + + #{agentIpList,jdbcType=LONGVARCHAR}, + + + + + + update domain_apply_info + + + id = #{record.id,jdbcType=INTEGER}, + + + apply_user = #{record.applyUser,jdbcType=VARCHAR}, + + + domain = #{record.domain,jdbcType=VARCHAR}, + + + ip = #{record.ip,jdbcType=VARCHAR}, + + + apply_status = #{record.applyStatus,jdbcType=INTEGER}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + agent_ip_list = #{record.agentIpList,jdbcType=LONGVARCHAR}, + + + + + + + + update domain_apply_info + set id = #{record.id,jdbcType=INTEGER}, + apply_user = #{record.applyUser,jdbcType=VARCHAR}, + domain = #{record.domain,jdbcType=VARCHAR}, + ip = #{record.ip,jdbcType=VARCHAR}, + apply_status = #{record.applyStatus,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + agent_ip_list = #{record.agentIpList,jdbcType=LONGVARCHAR} + + + + + + update domain_apply_info + set id = #{record.id,jdbcType=INTEGER}, + apply_user = #{record.applyUser,jdbcType=VARCHAR}, + domain = #{record.domain,jdbcType=VARCHAR}, + ip = #{record.ip,jdbcType=VARCHAR}, + apply_status = #{record.applyStatus,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT} + + + + + + update domain_apply_info + + + apply_user = #{applyUser,jdbcType=VARCHAR}, + + + domain = #{domain,jdbcType=VARCHAR}, + + + ip = #{ip,jdbcType=VARCHAR}, + + + apply_status = #{applyStatus,jdbcType=INTEGER}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + agent_ip_list = #{agentIpList,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update domain_apply_info + set apply_user = #{applyUser,jdbcType=VARCHAR}, + domain = #{domain,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + apply_status = #{applyStatus,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + agent_ip_list = #{agentIpList,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update domain_apply_info + set apply_user = #{applyUser,jdbcType=VARCHAR}, + domain = #{domain,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + apply_status = #{applyStatus,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + insert into domain_apply_info + (apply_user, domain, ip, apply_status, ctime, agent_ip_list) + values + + (#{item.applyUser,jdbcType=VARCHAR}, #{item.domain,jdbcType=VARCHAR}, #{item.ip,jdbcType=VARCHAR}, + #{item.applyStatus,jdbcType=INTEGER}, #{item.ctime,jdbcType=BIGINT}, #{item.agentIpList,jdbcType=LONGVARCHAR} + ) + + + + insert into domain_apply_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.applyUser,jdbcType=VARCHAR} + + + #{item.domain,jdbcType=VARCHAR} + + + #{item.ip,jdbcType=VARCHAR} + + + #{item.applyStatus,jdbcType=INTEGER} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.agentIpList,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/MibenchTaskMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/MibenchTaskMapper.xml new file mode 100644 index 000000000..bdde7090b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/MibenchTaskMapper.xml @@ -0,0 +1,894 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, qps, origin_qps, max_qps, scene_id, serial_link_id, scene_api_id, time, agent_num, + finish_agent_num, ctime, utime, state, version, success_num, failure_num, task_type, + parent_task_id, report_id, req_param_type, ok, connect_task_num, debug_rt, debug_size, + bench_mode, increase_mode, increase_percent + + + debug_result, debug_result_header, request_params, debug_trigger_cp, debug_trigger_filter_condition, + debug_req_headers, debug_url + + + + + + delete from mibench_task + where id = #{id,jdbcType=INTEGER} + + + delete from mibench_task + + + + + + + SELECT LAST_INSERT_ID() + + insert into mibench_task (qps, origin_qps, max_qps, + scene_id, serial_link_id, scene_api_id, + time, agent_num, finish_agent_num, + ctime, utime, state, + version, success_num, failure_num, + task_type, parent_task_id, report_id, + req_param_type, ok, connect_task_num, + debug_rt, debug_size, bench_mode, + increase_mode, increase_percent, debug_result, + debug_result_header, request_params, + debug_trigger_cp, debug_trigger_filter_condition, + debug_req_headers, debug_url) + values (#{qps,jdbcType=INTEGER}, #{originQps,jdbcType=INTEGER}, #{maxQps,jdbcType=INTEGER}, + #{sceneId,jdbcType=INTEGER}, #{serialLinkId,jdbcType=INTEGER}, #{sceneApiId,jdbcType=INTEGER}, + #{time,jdbcType=INTEGER}, #{agentNum,jdbcType=INTEGER}, #{finishAgentNum,jdbcType=INTEGER}, + #{ctime,jdbcType=BIGINT}, #{utime,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}, + #{version,jdbcType=INTEGER}, #{successNum,jdbcType=BIGINT}, #{failureNum,jdbcType=BIGINT}, + #{taskType,jdbcType=INTEGER}, #{parentTaskId,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR}, + #{reqParamType,jdbcType=INTEGER}, #{ok,jdbcType=BIT}, #{connectTaskNum,jdbcType=INTEGER}, + #{debugRt,jdbcType=INTEGER}, #{debugSize,jdbcType=INTEGER}, #{benchMode,jdbcType=INTEGER}, + #{increaseMode,jdbcType=INTEGER}, #{increasePercent,jdbcType=INTEGER}, #{debugResult,jdbcType=LONGVARCHAR}, + #{debugResultHeader,jdbcType=LONGVARCHAR}, #{requestParams,jdbcType=LONGVARCHAR}, + #{debugTriggerCp,jdbcType=LONGVARCHAR}, #{debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + #{debugReqHeaders,jdbcType=LONGVARCHAR}, #{debugUrl,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into mibench_task + + + qps, + + + origin_qps, + + + max_qps, + + + scene_id, + + + serial_link_id, + + + scene_api_id, + + + time, + + + agent_num, + + + finish_agent_num, + + + ctime, + + + utime, + + + state, + + + version, + + + success_num, + + + failure_num, + + + task_type, + + + parent_task_id, + + + report_id, + + + req_param_type, + + + ok, + + + connect_task_num, + + + debug_rt, + + + debug_size, + + + bench_mode, + + + increase_mode, + + + increase_percent, + + + debug_result, + + + debug_result_header, + + + request_params, + + + debug_trigger_cp, + + + debug_trigger_filter_condition, + + + debug_req_headers, + + + debug_url, + + + + + #{qps,jdbcType=INTEGER}, + + + #{originQps,jdbcType=INTEGER}, + + + #{maxQps,jdbcType=INTEGER}, + + + #{sceneId,jdbcType=INTEGER}, + + + #{serialLinkId,jdbcType=INTEGER}, + + + #{sceneApiId,jdbcType=INTEGER}, + + + #{time,jdbcType=INTEGER}, + + + #{agentNum,jdbcType=INTEGER}, + + + #{finishAgentNum,jdbcType=INTEGER}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{state,jdbcType=INTEGER}, + + + #{version,jdbcType=INTEGER}, + + + #{successNum,jdbcType=BIGINT}, + + + #{failureNum,jdbcType=BIGINT}, + + + #{taskType,jdbcType=INTEGER}, + + + #{parentTaskId,jdbcType=INTEGER}, + + + #{reportId,jdbcType=VARCHAR}, + + + #{reqParamType,jdbcType=INTEGER}, + + + #{ok,jdbcType=BIT}, + + + #{connectTaskNum,jdbcType=INTEGER}, + + + #{debugRt,jdbcType=INTEGER}, + + + #{debugSize,jdbcType=INTEGER}, + + + #{benchMode,jdbcType=INTEGER}, + + + #{increaseMode,jdbcType=INTEGER}, + + + #{increasePercent,jdbcType=INTEGER}, + + + #{debugResult,jdbcType=LONGVARCHAR}, + + + #{debugResultHeader,jdbcType=LONGVARCHAR}, + + + #{requestParams,jdbcType=LONGVARCHAR}, + + + #{debugTriggerCp,jdbcType=LONGVARCHAR}, + + + #{debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + + + #{debugReqHeaders,jdbcType=LONGVARCHAR}, + + + #{debugUrl,jdbcType=LONGVARCHAR}, + + + + + + update mibench_task + + + id = #{record.id,jdbcType=INTEGER}, + + + qps = #{record.qps,jdbcType=INTEGER}, + + + origin_qps = #{record.originQps,jdbcType=INTEGER}, + + + max_qps = #{record.maxQps,jdbcType=INTEGER}, + + + scene_id = #{record.sceneId,jdbcType=INTEGER}, + + + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER}, + + + scene_api_id = #{record.sceneApiId,jdbcType=INTEGER}, + + + time = #{record.time,jdbcType=INTEGER}, + + + agent_num = #{record.agentNum,jdbcType=INTEGER}, + + + finish_agent_num = #{record.finishAgentNum,jdbcType=INTEGER}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + state = #{record.state,jdbcType=INTEGER}, + + + version = #{record.version,jdbcType=INTEGER}, + + + success_num = #{record.successNum,jdbcType=BIGINT}, + + + failure_num = #{record.failureNum,jdbcType=BIGINT}, + + + task_type = #{record.taskType,jdbcType=INTEGER}, + + + parent_task_id = #{record.parentTaskId,jdbcType=INTEGER}, + + + report_id = #{record.reportId,jdbcType=VARCHAR}, + + + req_param_type = #{record.reqParamType,jdbcType=INTEGER}, + + + ok = #{record.ok,jdbcType=BIT}, + + + connect_task_num = #{record.connectTaskNum,jdbcType=INTEGER}, + + + debug_rt = #{record.debugRt,jdbcType=INTEGER}, + + + debug_size = #{record.debugSize,jdbcType=INTEGER}, + + + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + + + increase_mode = #{record.increaseMode,jdbcType=INTEGER}, + + + increase_percent = #{record.increasePercent,jdbcType=INTEGER}, + + + debug_result = #{record.debugResult,jdbcType=LONGVARCHAR}, + + + debug_result_header = #{record.debugResultHeader,jdbcType=LONGVARCHAR}, + + + request_params = #{record.requestParams,jdbcType=LONGVARCHAR}, + + + debug_trigger_cp = #{record.debugTriggerCp,jdbcType=LONGVARCHAR}, + + + debug_trigger_filter_condition = #{record.debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + + + debug_req_headers = #{record.debugReqHeaders,jdbcType=LONGVARCHAR}, + + + debug_url = #{record.debugUrl,jdbcType=LONGVARCHAR}, + + + + + + + + update mibench_task + set id = #{record.id,jdbcType=INTEGER}, + qps = #{record.qps,jdbcType=INTEGER}, + origin_qps = #{record.originQps,jdbcType=INTEGER}, + max_qps = #{record.maxQps,jdbcType=INTEGER}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER}, + scene_api_id = #{record.sceneApiId,jdbcType=INTEGER}, + time = #{record.time,jdbcType=INTEGER}, + agent_num = #{record.agentNum,jdbcType=INTEGER}, + finish_agent_num = #{record.finishAgentNum,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + state = #{record.state,jdbcType=INTEGER}, + version = #{record.version,jdbcType=INTEGER}, + success_num = #{record.successNum,jdbcType=BIGINT}, + failure_num = #{record.failureNum,jdbcType=BIGINT}, + task_type = #{record.taskType,jdbcType=INTEGER}, + parent_task_id = #{record.parentTaskId,jdbcType=INTEGER}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + req_param_type = #{record.reqParamType,jdbcType=INTEGER}, + ok = #{record.ok,jdbcType=BIT}, + connect_task_num = #{record.connectTaskNum,jdbcType=INTEGER}, + debug_rt = #{record.debugRt,jdbcType=INTEGER}, + debug_size = #{record.debugSize,jdbcType=INTEGER}, + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + increase_mode = #{record.increaseMode,jdbcType=INTEGER}, + increase_percent = #{record.increasePercent,jdbcType=INTEGER}, + debug_result = #{record.debugResult,jdbcType=LONGVARCHAR}, + debug_result_header = #{record.debugResultHeader,jdbcType=LONGVARCHAR}, + request_params = #{record.requestParams,jdbcType=LONGVARCHAR}, + debug_trigger_cp = #{record.debugTriggerCp,jdbcType=LONGVARCHAR}, + debug_trigger_filter_condition = #{record.debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + debug_req_headers = #{record.debugReqHeaders,jdbcType=LONGVARCHAR}, + debug_url = #{record.debugUrl,jdbcType=LONGVARCHAR} + + + + + + update mibench_task + set id = #{record.id,jdbcType=INTEGER}, + qps = #{record.qps,jdbcType=INTEGER}, + origin_qps = #{record.originQps,jdbcType=INTEGER}, + max_qps = #{record.maxQps,jdbcType=INTEGER}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER}, + scene_api_id = #{record.sceneApiId,jdbcType=INTEGER}, + time = #{record.time,jdbcType=INTEGER}, + agent_num = #{record.agentNum,jdbcType=INTEGER}, + finish_agent_num = #{record.finishAgentNum,jdbcType=INTEGER}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + state = #{record.state,jdbcType=INTEGER}, + version = #{record.version,jdbcType=INTEGER}, + success_num = #{record.successNum,jdbcType=BIGINT}, + failure_num = #{record.failureNum,jdbcType=BIGINT}, + task_type = #{record.taskType,jdbcType=INTEGER}, + parent_task_id = #{record.parentTaskId,jdbcType=INTEGER}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + req_param_type = #{record.reqParamType,jdbcType=INTEGER}, + ok = #{record.ok,jdbcType=BIT}, + connect_task_num = #{record.connectTaskNum,jdbcType=INTEGER}, + debug_rt = #{record.debugRt,jdbcType=INTEGER}, + debug_size = #{record.debugSize,jdbcType=INTEGER}, + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + increase_mode = #{record.increaseMode,jdbcType=INTEGER}, + increase_percent = #{record.increasePercent,jdbcType=INTEGER} + + + + + + update mibench_task + + + qps = #{qps,jdbcType=INTEGER}, + + + origin_qps = #{originQps,jdbcType=INTEGER}, + + + max_qps = #{maxQps,jdbcType=INTEGER}, + + + scene_id = #{sceneId,jdbcType=INTEGER}, + + + serial_link_id = #{serialLinkId,jdbcType=INTEGER}, + + + scene_api_id = #{sceneApiId,jdbcType=INTEGER}, + + + time = #{time,jdbcType=INTEGER}, + + + agent_num = #{agentNum,jdbcType=INTEGER}, + + + finish_agent_num = #{finishAgentNum,jdbcType=INTEGER}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + state = #{state,jdbcType=INTEGER}, + + + version = #{version,jdbcType=INTEGER}, + + + success_num = #{successNum,jdbcType=BIGINT}, + + + failure_num = #{failureNum,jdbcType=BIGINT}, + + + task_type = #{taskType,jdbcType=INTEGER}, + + + parent_task_id = #{parentTaskId,jdbcType=INTEGER}, + + + report_id = #{reportId,jdbcType=VARCHAR}, + + + req_param_type = #{reqParamType,jdbcType=INTEGER}, + + + ok = #{ok,jdbcType=BIT}, + + + connect_task_num = #{connectTaskNum,jdbcType=INTEGER}, + + + debug_rt = #{debugRt,jdbcType=INTEGER}, + + + debug_size = #{debugSize,jdbcType=INTEGER}, + + + bench_mode = #{benchMode,jdbcType=INTEGER}, + + + increase_mode = #{increaseMode,jdbcType=INTEGER}, + + + increase_percent = #{increasePercent,jdbcType=INTEGER}, + + + debug_result = #{debugResult,jdbcType=LONGVARCHAR}, + + + debug_result_header = #{debugResultHeader,jdbcType=LONGVARCHAR}, + + + request_params = #{requestParams,jdbcType=LONGVARCHAR}, + + + debug_trigger_cp = #{debugTriggerCp,jdbcType=LONGVARCHAR}, + + + debug_trigger_filter_condition = #{debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + + + debug_req_headers = #{debugReqHeaders,jdbcType=LONGVARCHAR}, + + + debug_url = #{debugUrl,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update mibench_task + set qps = #{qps,jdbcType=INTEGER}, + origin_qps = #{originQps,jdbcType=INTEGER}, + max_qps = #{maxQps,jdbcType=INTEGER}, + scene_id = #{sceneId,jdbcType=INTEGER}, + serial_link_id = #{serialLinkId,jdbcType=INTEGER}, + scene_api_id = #{sceneApiId,jdbcType=INTEGER}, + time = #{time,jdbcType=INTEGER}, + agent_num = #{agentNum,jdbcType=INTEGER}, + finish_agent_num = #{finishAgentNum,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + state = #{state,jdbcType=INTEGER}, + version = #{version,jdbcType=INTEGER}, + success_num = #{successNum,jdbcType=BIGINT}, + failure_num = #{failureNum,jdbcType=BIGINT}, + task_type = #{taskType,jdbcType=INTEGER}, + parent_task_id = #{parentTaskId,jdbcType=INTEGER}, + report_id = #{reportId,jdbcType=VARCHAR}, + req_param_type = #{reqParamType,jdbcType=INTEGER}, + ok = #{ok,jdbcType=BIT}, + connect_task_num = #{connectTaskNum,jdbcType=INTEGER}, + debug_rt = #{debugRt,jdbcType=INTEGER}, + debug_size = #{debugSize,jdbcType=INTEGER}, + bench_mode = #{benchMode,jdbcType=INTEGER}, + increase_mode = #{increaseMode,jdbcType=INTEGER}, + increase_percent = #{increasePercent,jdbcType=INTEGER}, + debug_result = #{debugResult,jdbcType=LONGVARCHAR}, + debug_result_header = #{debugResultHeader,jdbcType=LONGVARCHAR}, + request_params = #{requestParams,jdbcType=LONGVARCHAR}, + debug_trigger_cp = #{debugTriggerCp,jdbcType=LONGVARCHAR}, + debug_trigger_filter_condition = #{debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, + debug_req_headers = #{debugReqHeaders,jdbcType=LONGVARCHAR}, + debug_url = #{debugUrl,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update mibench_task + set qps = #{qps,jdbcType=INTEGER}, + origin_qps = #{originQps,jdbcType=INTEGER}, + max_qps = #{maxQps,jdbcType=INTEGER}, + scene_id = #{sceneId,jdbcType=INTEGER}, + serial_link_id = #{serialLinkId,jdbcType=INTEGER}, + scene_api_id = #{sceneApiId,jdbcType=INTEGER}, + time = #{time,jdbcType=INTEGER}, + agent_num = #{agentNum,jdbcType=INTEGER}, + finish_agent_num = #{finishAgentNum,jdbcType=INTEGER}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + state = #{state,jdbcType=INTEGER}, + version = #{version,jdbcType=INTEGER}, + success_num = #{successNum,jdbcType=BIGINT}, + failure_num = #{failureNum,jdbcType=BIGINT}, + task_type = #{taskType,jdbcType=INTEGER}, + parent_task_id = #{parentTaskId,jdbcType=INTEGER}, + report_id = #{reportId,jdbcType=VARCHAR}, + req_param_type = #{reqParamType,jdbcType=INTEGER}, + ok = #{ok,jdbcType=BIT}, + connect_task_num = #{connectTaskNum,jdbcType=INTEGER}, + debug_rt = #{debugRt,jdbcType=INTEGER}, + debug_size = #{debugSize,jdbcType=INTEGER}, + bench_mode = #{benchMode,jdbcType=INTEGER}, + increase_mode = #{increaseMode,jdbcType=INTEGER}, + increase_percent = #{increasePercent,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + + insert into mibench_task + (qps, origin_qps, max_qps, scene_id, serial_link_id, scene_api_id, time, agent_num, + finish_agent_num, ctime, utime, state, version, success_num, failure_num, task_type, + parent_task_id, report_id, req_param_type, ok, connect_task_num, debug_rt, debug_size, + bench_mode, increase_mode, increase_percent, debug_result, debug_result_header, + request_params, debug_trigger_cp, debug_trigger_filter_condition, debug_req_headers, + debug_url) + values + + (#{item.qps,jdbcType=INTEGER}, #{item.originQps,jdbcType=INTEGER}, #{item.maxQps,jdbcType=INTEGER}, + #{item.sceneId,jdbcType=INTEGER}, #{item.serialLinkId,jdbcType=INTEGER}, #{item.sceneApiId,jdbcType=INTEGER}, + #{item.time,jdbcType=INTEGER}, #{item.agentNum,jdbcType=INTEGER}, #{item.finishAgentNum,jdbcType=INTEGER}, + #{item.ctime,jdbcType=BIGINT}, #{item.utime,jdbcType=BIGINT}, #{item.state,jdbcType=INTEGER}, + #{item.version,jdbcType=INTEGER}, #{item.successNum,jdbcType=BIGINT}, #{item.failureNum,jdbcType=BIGINT}, + #{item.taskType,jdbcType=INTEGER}, #{item.parentTaskId,jdbcType=INTEGER}, #{item.reportId,jdbcType=VARCHAR}, + #{item.reqParamType,jdbcType=INTEGER}, #{item.ok,jdbcType=BIT}, #{item.connectTaskNum,jdbcType=INTEGER}, + #{item.debugRt,jdbcType=INTEGER}, #{item.debugSize,jdbcType=INTEGER}, #{item.benchMode,jdbcType=INTEGER}, + #{item.increaseMode,jdbcType=INTEGER}, #{item.increasePercent,jdbcType=INTEGER}, + #{item.debugResult,jdbcType=LONGVARCHAR}, #{item.debugResultHeader,jdbcType=LONGVARCHAR}, + #{item.requestParams,jdbcType=LONGVARCHAR}, #{item.debugTriggerCp,jdbcType=LONGVARCHAR}, + #{item.debugTriggerFilterCondition,jdbcType=LONGVARCHAR}, #{item.debugReqHeaders,jdbcType=LONGVARCHAR}, + #{item.debugUrl,jdbcType=LONGVARCHAR}) + + + + insert into mibench_task ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.qps,jdbcType=INTEGER} + + + #{item.originQps,jdbcType=INTEGER} + + + #{item.maxQps,jdbcType=INTEGER} + + + #{item.sceneId,jdbcType=INTEGER} + + + #{item.serialLinkId,jdbcType=INTEGER} + + + #{item.sceneApiId,jdbcType=INTEGER} + + + #{item.time,jdbcType=INTEGER} + + + #{item.agentNum,jdbcType=INTEGER} + + + #{item.finishAgentNum,jdbcType=INTEGER} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.state,jdbcType=INTEGER} + + + #{item.version,jdbcType=INTEGER} + + + #{item.successNum,jdbcType=BIGINT} + + + #{item.failureNum,jdbcType=BIGINT} + + + #{item.taskType,jdbcType=INTEGER} + + + #{item.parentTaskId,jdbcType=INTEGER} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.reqParamType,jdbcType=INTEGER} + + + #{item.ok,jdbcType=BIT} + + + #{item.connectTaskNum,jdbcType=INTEGER} + + + #{item.debugRt,jdbcType=INTEGER} + + + #{item.debugSize,jdbcType=INTEGER} + + + #{item.benchMode,jdbcType=INTEGER} + + + #{item.increaseMode,jdbcType=INTEGER} + + + #{item.increasePercent,jdbcType=INTEGER} + + + #{item.debugResult,jdbcType=LONGVARCHAR} + + + #{item.debugResultHeader,jdbcType=LONGVARCHAR} + + + #{item.requestParams,jdbcType=LONGVARCHAR} + + + #{item.debugTriggerCp,jdbcType=LONGVARCHAR} + + + #{item.debugTriggerFilterCondition,jdbcType=LONGVARCHAR} + + + #{item.debugReqHeaders,jdbcType=LONGVARCHAR} + + + #{item.debugUrl,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/OperationLogMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/OperationLogMapper.xml new file mode 100644 index 000000000..e2656d23d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/OperationLogMapper.xml @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, report_id, scene_id, type, create_by, create_time, update_time + + + content, support_operation + + + + + + delete from operation_log + where id = #{id,jdbcType=BIGINT} + + + delete from operation_log + + + + + + + SELECT LAST_INSERT_ID() + + insert into operation_log (report_id, scene_id, type, + create_by, create_time, update_time, + content, support_operation) + values (#{reportId,jdbcType=VARCHAR}, #{sceneId,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, + #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, + #{content,jdbcType=LONGVARCHAR}, #{supportOperation,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into operation_log + + + report_id, + + + scene_id, + + + type, + + + create_by, + + + create_time, + + + update_time, + + + content, + + + support_operation, + + + + + #{reportId,jdbcType=VARCHAR}, + + + #{sceneId,jdbcType=INTEGER}, + + + #{type,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{content,jdbcType=LONGVARCHAR}, + + + #{supportOperation,jdbcType=LONGVARCHAR}, + + + + + + update operation_log + + + id = #{record.id,jdbcType=BIGINT}, + + + report_id = #{record.reportId,jdbcType=VARCHAR}, + + + scene_id = #{record.sceneId,jdbcType=INTEGER}, + + + type = #{record.type,jdbcType=INTEGER}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + support_operation = #{record.supportOperation,jdbcType=LONGVARCHAR}, + + + + + + + + update operation_log + set id = #{record.id,jdbcType=BIGINT}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + type = #{record.type,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR}, + support_operation = #{record.supportOperation,jdbcType=LONGVARCHAR} + + + + + + update operation_log + set id = #{record.id,jdbcType=BIGINT}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + type = #{record.type,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update operation_log + + + report_id = #{reportId,jdbcType=VARCHAR}, + + + scene_id = #{sceneId,jdbcType=INTEGER}, + + + type = #{type,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + support_operation = #{supportOperation,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update operation_log + set report_id = #{reportId,jdbcType=VARCHAR}, + scene_id = #{sceneId,jdbcType=INTEGER}, + type = #{type,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR}, + support_operation = #{supportOperation,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update operation_log + set report_id = #{reportId,jdbcType=VARCHAR}, + scene_id = #{sceneId,jdbcType=INTEGER}, + type = #{type,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + + insert into operation_log + (report_id, scene_id, type, create_by, create_time, update_time, content, support_operation + ) + values + + (#{item.reportId,jdbcType=VARCHAR}, #{item.sceneId,jdbcType=INTEGER}, #{item.type,jdbcType=INTEGER}, + #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.content,jdbcType=LONGVARCHAR}, #{item.supportOperation,jdbcType=LONGVARCHAR} + ) + + + + insert into operation_log ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.sceneId,jdbcType=INTEGER} + + + #{item.type,jdbcType=INTEGER} + + + #{item.createBy,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.content,jdbcType=LONGVARCHAR} + + + #{item.supportOperation,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/ReportInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/ReportInfoMapper.xml new file mode 100644 index 000000000..120728ad6 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/ReportInfoMapper.xml @@ -0,0 +1,635 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, scene_id, snapshot_id, report_id, report_name, duration, concurrency, concurrency_max, + create_by, create_time, update_time, status, task_id, file_path, finish_time, tenant + + + agents, extra, sla_event_list, total_stat_analysis_event_list, link_to_dag_id + + + + + + delete from report_info + where id = #{id,jdbcType=BIGINT} + + + delete from report_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into report_info (scene_id, snapshot_id, report_id, + report_name, duration, concurrency, + concurrency_max, create_by, create_time, + update_time, status, task_id, + file_path, finish_time, tenant, + agents, extra, sla_event_list, + total_stat_analysis_event_list, link_to_dag_id + ) + values (#{sceneId,jdbcType=BIGINT}, #{snapshotId,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, + #{reportName,jdbcType=VARCHAR}, #{duration,jdbcType=INTEGER}, #{concurrency,jdbcType=INTEGER}, + #{concurrencyMax,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{taskId,jdbcType=BIGINT}, + #{filePath,jdbcType=VARCHAR}, #{finishTime,jdbcType=BIGINT}, #{tenant,jdbcType=VARCHAR}, + #{agents,jdbcType=LONGVARCHAR}, #{extra,jdbcType=LONGVARCHAR}, #{slaEventList,jdbcType=LONGVARCHAR}, + #{totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, #{linkToDagId,jdbcType=LONGVARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into report_info + + + scene_id, + + + snapshot_id, + + + report_id, + + + report_name, + + + duration, + + + concurrency, + + + concurrency_max, + + + create_by, + + + create_time, + + + update_time, + + + status, + + + task_id, + + + file_path, + + + finish_time, + + + tenant, + + + agents, + + + extra, + + + sla_event_list, + + + total_stat_analysis_event_list, + + + link_to_dag_id, + + + + + #{sceneId,jdbcType=BIGINT}, + + + #{snapshotId,jdbcType=VARCHAR}, + + + #{reportId,jdbcType=VARCHAR}, + + + #{reportName,jdbcType=VARCHAR}, + + + #{duration,jdbcType=INTEGER}, + + + #{concurrency,jdbcType=INTEGER}, + + + #{concurrencyMax,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=INTEGER}, + + + #{taskId,jdbcType=BIGINT}, + + + #{filePath,jdbcType=VARCHAR}, + + + #{finishTime,jdbcType=BIGINT}, + + + #{tenant,jdbcType=VARCHAR}, + + + #{agents,jdbcType=LONGVARCHAR}, + + + #{extra,jdbcType=LONGVARCHAR}, + + + #{slaEventList,jdbcType=LONGVARCHAR}, + + + #{totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, + + + #{linkToDagId,jdbcType=LONGVARCHAR}, + + + + + + update report_info + + + id = #{record.id,jdbcType=BIGINT}, + + + scene_id = #{record.sceneId,jdbcType=BIGINT}, + + + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + + + report_id = #{record.reportId,jdbcType=VARCHAR}, + + + report_name = #{record.reportName,jdbcType=VARCHAR}, + + + duration = #{record.duration,jdbcType=INTEGER}, + + + concurrency = #{record.concurrency,jdbcType=INTEGER}, + + + concurrency_max = #{record.concurrencyMax,jdbcType=INTEGER}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + status = #{record.status,jdbcType=INTEGER}, + + + task_id = #{record.taskId,jdbcType=BIGINT}, + + + file_path = #{record.filePath,jdbcType=VARCHAR}, + + + finish_time = #{record.finishTime,jdbcType=BIGINT}, + + + tenant = #{record.tenant,jdbcType=VARCHAR}, + + + agents = #{record.agents,jdbcType=LONGVARCHAR}, + + + extra = #{record.extra,jdbcType=LONGVARCHAR}, + + + sla_event_list = #{record.slaEventList,jdbcType=LONGVARCHAR}, + + + total_stat_analysis_event_list = #{record.totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, + + + link_to_dag_id = #{record.linkToDagId,jdbcType=LONGVARCHAR}, + + + + + + + + update report_info + set id = #{record.id,jdbcType=BIGINT}, + scene_id = #{record.sceneId,jdbcType=BIGINT}, + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + report_name = #{record.reportName,jdbcType=VARCHAR}, + duration = #{record.duration,jdbcType=INTEGER}, + concurrency = #{record.concurrency,jdbcType=INTEGER}, + concurrency_max = #{record.concurrencyMax,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + status = #{record.status,jdbcType=INTEGER}, + task_id = #{record.taskId,jdbcType=BIGINT}, + file_path = #{record.filePath,jdbcType=VARCHAR}, + finish_time = #{record.finishTime,jdbcType=BIGINT}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + agents = #{record.agents,jdbcType=LONGVARCHAR}, + extra = #{record.extra,jdbcType=LONGVARCHAR}, + sla_event_list = #{record.slaEventList,jdbcType=LONGVARCHAR}, + total_stat_analysis_event_list = #{record.totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, + link_to_dag_id = #{record.linkToDagId,jdbcType=LONGVARCHAR} + + + + + + update report_info + set id = #{record.id,jdbcType=BIGINT}, + scene_id = #{record.sceneId,jdbcType=BIGINT}, + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + report_name = #{record.reportName,jdbcType=VARCHAR}, + duration = #{record.duration,jdbcType=INTEGER}, + concurrency = #{record.concurrency,jdbcType=INTEGER}, + concurrency_max = #{record.concurrencyMax,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + status = #{record.status,jdbcType=INTEGER}, + task_id = #{record.taskId,jdbcType=BIGINT}, + file_path = #{record.filePath,jdbcType=VARCHAR}, + finish_time = #{record.finishTime,jdbcType=BIGINT}, + tenant = #{record.tenant,jdbcType=VARCHAR} + + + + + + update report_info + + + scene_id = #{sceneId,jdbcType=BIGINT}, + + + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + + + report_id = #{reportId,jdbcType=VARCHAR}, + + + report_name = #{reportName,jdbcType=VARCHAR}, + + + duration = #{duration,jdbcType=INTEGER}, + + + concurrency = #{concurrency,jdbcType=INTEGER}, + + + concurrency_max = #{concurrencyMax,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + status = #{status,jdbcType=INTEGER}, + + + task_id = #{taskId,jdbcType=BIGINT}, + + + file_path = #{filePath,jdbcType=VARCHAR}, + + + finish_time = #{finishTime,jdbcType=BIGINT}, + + + tenant = #{tenant,jdbcType=VARCHAR}, + + + agents = #{agents,jdbcType=LONGVARCHAR}, + + + extra = #{extra,jdbcType=LONGVARCHAR}, + + + sla_event_list = #{slaEventList,jdbcType=LONGVARCHAR}, + + + total_stat_analysis_event_list = #{totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, + + + link_to_dag_id = #{linkToDagId,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update report_info + set scene_id = #{sceneId,jdbcType=BIGINT}, + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + report_id = #{reportId,jdbcType=VARCHAR}, + report_name = #{reportName,jdbcType=VARCHAR}, + duration = #{duration,jdbcType=INTEGER}, + concurrency = #{concurrency,jdbcType=INTEGER}, + concurrency_max = #{concurrencyMax,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + status = #{status,jdbcType=INTEGER}, + task_id = #{taskId,jdbcType=BIGINT}, + file_path = #{filePath,jdbcType=VARCHAR}, + finish_time = #{finishTime,jdbcType=BIGINT}, + tenant = #{tenant,jdbcType=VARCHAR}, + agents = #{agents,jdbcType=LONGVARCHAR}, + extra = #{extra,jdbcType=LONGVARCHAR}, + sla_event_list = #{slaEventList,jdbcType=LONGVARCHAR}, + total_stat_analysis_event_list = #{totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, + link_to_dag_id = #{linkToDagId,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update report_info + set scene_id = #{sceneId,jdbcType=BIGINT}, + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + report_id = #{reportId,jdbcType=VARCHAR}, + report_name = #{reportName,jdbcType=VARCHAR}, + duration = #{duration,jdbcType=INTEGER}, + concurrency = #{concurrency,jdbcType=INTEGER}, + concurrency_max = #{concurrencyMax,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + status = #{status,jdbcType=INTEGER}, + task_id = #{taskId,jdbcType=BIGINT}, + file_path = #{filePath,jdbcType=VARCHAR}, + finish_time = #{finishTime,jdbcType=BIGINT}, + tenant = #{tenant,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + + insert into report_info + (scene_id, snapshot_id, report_id, report_name, duration, concurrency, concurrency_max, + create_by, create_time, update_time, status, task_id, file_path, finish_time, tenant, + agents, extra, sla_event_list, total_stat_analysis_event_list, link_to_dag_id) + values + + (#{item.sceneId,jdbcType=BIGINT}, #{item.snapshotId,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, + #{item.reportName,jdbcType=VARCHAR}, #{item.duration,jdbcType=INTEGER}, #{item.concurrency,jdbcType=INTEGER}, + #{item.concurrencyMax,jdbcType=INTEGER}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, #{item.taskId,jdbcType=BIGINT}, + #{item.filePath,jdbcType=VARCHAR}, #{item.finishTime,jdbcType=BIGINT}, #{item.tenant,jdbcType=VARCHAR}, + #{item.agents,jdbcType=LONGVARCHAR}, #{item.extra,jdbcType=LONGVARCHAR}, #{item.slaEventList,jdbcType=LONGVARCHAR}, + #{item.totalStatAnalysisEventList,jdbcType=LONGVARCHAR}, #{item.linkToDagId,jdbcType=LONGVARCHAR} + ) + + + + insert into report_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.sceneId,jdbcType=BIGINT} + + + #{item.snapshotId,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.reportName,jdbcType=VARCHAR} + + + #{item.duration,jdbcType=INTEGER} + + + #{item.concurrency,jdbcType=INTEGER} + + + #{item.concurrencyMax,jdbcType=INTEGER} + + + #{item.createBy,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=TIMESTAMP} + + + #{item.updateTime,jdbcType=TIMESTAMP} + + + #{item.status,jdbcType=INTEGER} + + + #{item.taskId,jdbcType=BIGINT} + + + #{item.filePath,jdbcType=VARCHAR} + + + #{item.finishTime,jdbcType=BIGINT} + + + #{item.tenant,jdbcType=VARCHAR} + + + #{item.agents,jdbcType=LONGVARCHAR} + + + #{item.extra,jdbcType=LONGVARCHAR} + + + #{item.slaEventList,jdbcType=LONGVARCHAR} + + + #{item.totalStatAnalysisEventList,jdbcType=LONGVARCHAR} + + + #{item.linkToDagId,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneApiInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneApiInfoMapper.xml new file mode 100644 index 000000000..10c660044 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneApiInfoMapper.xml @@ -0,0 +1,779 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, scene_id, api_order, api_name, source_type, api_type, request_method, request_timeout, + need_login, token_type, content_type, nacos_type, service_name, method_name, param_type_list, + dubbo_group, dubbo_version, serial_link_id + + + api_url, api_header, request_param_info, output_param_info, request_body, dubbo_param_json, + check_point, filter_condition, api_tsp_auth, api_traffic_info, api_x5_info + + + + + + delete from scene_api_info + where id = #{id,jdbcType=INTEGER} + + + delete from scene_api_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into scene_api_info (scene_id, api_order, api_name, + source_type, api_type, request_method, + request_timeout, need_login, token_type, + content_type, nacos_type, service_name, + method_name, param_type_list, dubbo_group, + dubbo_version, serial_link_id, api_url, + api_header, request_param_info, output_param_info, + request_body, dubbo_param_json, check_point, + filter_condition, api_tsp_auth, api_traffic_info, + api_x5_info) + values (#{sceneId,jdbcType=INTEGER}, #{apiOrder,jdbcType=INTEGER}, #{apiName,jdbcType=VARCHAR}, + #{sourceType,jdbcType=INTEGER}, #{apiType,jdbcType=INTEGER}, #{requestMethod,jdbcType=INTEGER}, + #{requestTimeout,jdbcType=INTEGER}, #{needLogin,jdbcType=BIT}, #{tokenType,jdbcType=INTEGER}, + #{contentType,jdbcType=VARCHAR}, #{nacosType,jdbcType=INTEGER}, #{serviceName,jdbcType=VARCHAR}, + #{methodName,jdbcType=VARCHAR}, #{paramTypeList,jdbcType=VARCHAR}, #{dubboGroup,jdbcType=VARCHAR}, + #{dubboVersion,jdbcType=VARCHAR}, #{serialLinkId,jdbcType=INTEGER}, #{apiUrl,jdbcType=LONGVARCHAR}, + #{apiHeader,jdbcType=LONGVARCHAR}, #{requestParamInfo,jdbcType=LONGVARCHAR}, #{outputParamInfo,jdbcType=LONGVARCHAR}, + #{requestBody,jdbcType=LONGVARCHAR}, #{dubboParamJson,jdbcType=LONGVARCHAR}, #{checkPoint,jdbcType=LONGVARCHAR}, + #{filterCondition,jdbcType=LONGVARCHAR}, #{apiTspAuth,jdbcType=LONGVARCHAR}, #{apiTrafficInfo,jdbcType=LONGVARCHAR}, + #{apiX5Info,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into scene_api_info + + + scene_id, + + + api_order, + + + api_name, + + + source_type, + + + api_type, + + + request_method, + + + request_timeout, + + + need_login, + + + token_type, + + + content_type, + + + nacos_type, + + + service_name, + + + method_name, + + + param_type_list, + + + dubbo_group, + + + dubbo_version, + + + serial_link_id, + + + api_url, + + + api_header, + + + request_param_info, + + + output_param_info, + + + request_body, + + + dubbo_param_json, + + + check_point, + + + filter_condition, + + + api_tsp_auth, + + + api_traffic_info, + + + api_x5_info, + + + + + #{sceneId,jdbcType=INTEGER}, + + + #{apiOrder,jdbcType=INTEGER}, + + + #{apiName,jdbcType=VARCHAR}, + + + #{sourceType,jdbcType=INTEGER}, + + + #{apiType,jdbcType=INTEGER}, + + + #{requestMethod,jdbcType=INTEGER}, + + + #{requestTimeout,jdbcType=INTEGER}, + + + #{needLogin,jdbcType=BIT}, + + + #{tokenType,jdbcType=INTEGER}, + + + #{contentType,jdbcType=VARCHAR}, + + + #{nacosType,jdbcType=INTEGER}, + + + #{serviceName,jdbcType=VARCHAR}, + + + #{methodName,jdbcType=VARCHAR}, + + + #{paramTypeList,jdbcType=VARCHAR}, + + + #{dubboGroup,jdbcType=VARCHAR}, + + + #{dubboVersion,jdbcType=VARCHAR}, + + + #{serialLinkId,jdbcType=INTEGER}, + + + #{apiUrl,jdbcType=LONGVARCHAR}, + + + #{apiHeader,jdbcType=LONGVARCHAR}, + + + #{requestParamInfo,jdbcType=LONGVARCHAR}, + + + #{outputParamInfo,jdbcType=LONGVARCHAR}, + + + #{requestBody,jdbcType=LONGVARCHAR}, + + + #{dubboParamJson,jdbcType=LONGVARCHAR}, + + + #{checkPoint,jdbcType=LONGVARCHAR}, + + + #{filterCondition,jdbcType=LONGVARCHAR}, + + + #{apiTspAuth,jdbcType=LONGVARCHAR}, + + + #{apiTrafficInfo,jdbcType=LONGVARCHAR}, + + + #{apiX5Info,jdbcType=LONGVARCHAR}, + + + + + + update scene_api_info + + + id = #{record.id,jdbcType=INTEGER}, + + + scene_id = #{record.sceneId,jdbcType=INTEGER}, + + + api_order = #{record.apiOrder,jdbcType=INTEGER}, + + + api_name = #{record.apiName,jdbcType=VARCHAR}, + + + source_type = #{record.sourceType,jdbcType=INTEGER}, + + + api_type = #{record.apiType,jdbcType=INTEGER}, + + + request_method = #{record.requestMethod,jdbcType=INTEGER}, + + + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + + + need_login = #{record.needLogin,jdbcType=BIT}, + + + token_type = #{record.tokenType,jdbcType=INTEGER}, + + + content_type = #{record.contentType,jdbcType=VARCHAR}, + + + nacos_type = #{record.nacosType,jdbcType=INTEGER}, + + + service_name = #{record.serviceName,jdbcType=VARCHAR}, + + + method_name = #{record.methodName,jdbcType=VARCHAR}, + + + param_type_list = #{record.paramTypeList,jdbcType=VARCHAR}, + + + dubbo_group = #{record.dubboGroup,jdbcType=VARCHAR}, + + + dubbo_version = #{record.dubboVersion,jdbcType=VARCHAR}, + + + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER}, + + + api_url = #{record.apiUrl,jdbcType=LONGVARCHAR}, + + + api_header = #{record.apiHeader,jdbcType=LONGVARCHAR}, + + + request_param_info = #{record.requestParamInfo,jdbcType=LONGVARCHAR}, + + + output_param_info = #{record.outputParamInfo,jdbcType=LONGVARCHAR}, + + + request_body = #{record.requestBody,jdbcType=LONGVARCHAR}, + + + dubbo_param_json = #{record.dubboParamJson,jdbcType=LONGVARCHAR}, + + + check_point = #{record.checkPoint,jdbcType=LONGVARCHAR}, + + + filter_condition = #{record.filterCondition,jdbcType=LONGVARCHAR}, + + + api_tsp_auth = #{record.apiTspAuth,jdbcType=LONGVARCHAR}, + + + api_traffic_info = #{record.apiTrafficInfo,jdbcType=LONGVARCHAR}, + + + api_x5_info = #{record.apiX5Info,jdbcType=LONGVARCHAR}, + + + + + + + + update scene_api_info + set id = #{record.id,jdbcType=INTEGER}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + api_order = #{record.apiOrder,jdbcType=INTEGER}, + api_name = #{record.apiName,jdbcType=VARCHAR}, + source_type = #{record.sourceType,jdbcType=INTEGER}, + api_type = #{record.apiType,jdbcType=INTEGER}, + request_method = #{record.requestMethod,jdbcType=INTEGER}, + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + need_login = #{record.needLogin,jdbcType=BIT}, + token_type = #{record.tokenType,jdbcType=INTEGER}, + content_type = #{record.contentType,jdbcType=VARCHAR}, + nacos_type = #{record.nacosType,jdbcType=INTEGER}, + service_name = #{record.serviceName,jdbcType=VARCHAR}, + method_name = #{record.methodName,jdbcType=VARCHAR}, + param_type_list = #{record.paramTypeList,jdbcType=VARCHAR}, + dubbo_group = #{record.dubboGroup,jdbcType=VARCHAR}, + dubbo_version = #{record.dubboVersion,jdbcType=VARCHAR}, + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER}, + api_url = #{record.apiUrl,jdbcType=LONGVARCHAR}, + api_header = #{record.apiHeader,jdbcType=LONGVARCHAR}, + request_param_info = #{record.requestParamInfo,jdbcType=LONGVARCHAR}, + output_param_info = #{record.outputParamInfo,jdbcType=LONGVARCHAR}, + request_body = #{record.requestBody,jdbcType=LONGVARCHAR}, + dubbo_param_json = #{record.dubboParamJson,jdbcType=LONGVARCHAR}, + check_point = #{record.checkPoint,jdbcType=LONGVARCHAR}, + filter_condition = #{record.filterCondition,jdbcType=LONGVARCHAR}, + api_tsp_auth = #{record.apiTspAuth,jdbcType=LONGVARCHAR}, + api_traffic_info = #{record.apiTrafficInfo,jdbcType=LONGVARCHAR}, + api_x5_info = #{record.apiX5Info,jdbcType=LONGVARCHAR} + + + + + + update scene_api_info + set id = #{record.id,jdbcType=INTEGER}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + api_order = #{record.apiOrder,jdbcType=INTEGER}, + api_name = #{record.apiName,jdbcType=VARCHAR}, + source_type = #{record.sourceType,jdbcType=INTEGER}, + api_type = #{record.apiType,jdbcType=INTEGER}, + request_method = #{record.requestMethod,jdbcType=INTEGER}, + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + need_login = #{record.needLogin,jdbcType=BIT}, + token_type = #{record.tokenType,jdbcType=INTEGER}, + content_type = #{record.contentType,jdbcType=VARCHAR}, + nacos_type = #{record.nacosType,jdbcType=INTEGER}, + service_name = #{record.serviceName,jdbcType=VARCHAR}, + method_name = #{record.methodName,jdbcType=VARCHAR}, + param_type_list = #{record.paramTypeList,jdbcType=VARCHAR}, + dubbo_group = #{record.dubboGroup,jdbcType=VARCHAR}, + dubbo_version = #{record.dubboVersion,jdbcType=VARCHAR}, + serial_link_id = #{record.serialLinkId,jdbcType=INTEGER} + + + + + + update scene_api_info + + + scene_id = #{sceneId,jdbcType=INTEGER}, + + + api_order = #{apiOrder,jdbcType=INTEGER}, + + + api_name = #{apiName,jdbcType=VARCHAR}, + + + source_type = #{sourceType,jdbcType=INTEGER}, + + + api_type = #{apiType,jdbcType=INTEGER}, + + + request_method = #{requestMethod,jdbcType=INTEGER}, + + + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + + + need_login = #{needLogin,jdbcType=BIT}, + + + token_type = #{tokenType,jdbcType=INTEGER}, + + + content_type = #{contentType,jdbcType=VARCHAR}, + + + nacos_type = #{nacosType,jdbcType=INTEGER}, + + + service_name = #{serviceName,jdbcType=VARCHAR}, + + + method_name = #{methodName,jdbcType=VARCHAR}, + + + param_type_list = #{paramTypeList,jdbcType=VARCHAR}, + + + dubbo_group = #{dubboGroup,jdbcType=VARCHAR}, + + + dubbo_version = #{dubboVersion,jdbcType=VARCHAR}, + + + serial_link_id = #{serialLinkId,jdbcType=INTEGER}, + + + api_url = #{apiUrl,jdbcType=LONGVARCHAR}, + + + api_header = #{apiHeader,jdbcType=LONGVARCHAR}, + + + request_param_info = #{requestParamInfo,jdbcType=LONGVARCHAR}, + + + output_param_info = #{outputParamInfo,jdbcType=LONGVARCHAR}, + + + request_body = #{requestBody,jdbcType=LONGVARCHAR}, + + + dubbo_param_json = #{dubboParamJson,jdbcType=LONGVARCHAR}, + + + check_point = #{checkPoint,jdbcType=LONGVARCHAR}, + + + filter_condition = #{filterCondition,jdbcType=LONGVARCHAR}, + + + api_tsp_auth = #{apiTspAuth,jdbcType=LONGVARCHAR}, + + + api_traffic_info = #{apiTrafficInfo,jdbcType=LONGVARCHAR}, + + + api_x5_info = #{apiX5Info,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update scene_api_info + set scene_id = #{sceneId,jdbcType=INTEGER}, + api_order = #{apiOrder,jdbcType=INTEGER}, + api_name = #{apiName,jdbcType=VARCHAR}, + source_type = #{sourceType,jdbcType=INTEGER}, + api_type = #{apiType,jdbcType=INTEGER}, + request_method = #{requestMethod,jdbcType=INTEGER}, + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + need_login = #{needLogin,jdbcType=BIT}, + token_type = #{tokenType,jdbcType=INTEGER}, + content_type = #{contentType,jdbcType=VARCHAR}, + nacos_type = #{nacosType,jdbcType=INTEGER}, + service_name = #{serviceName,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + param_type_list = #{paramTypeList,jdbcType=VARCHAR}, + dubbo_group = #{dubboGroup,jdbcType=VARCHAR}, + dubbo_version = #{dubboVersion,jdbcType=VARCHAR}, + serial_link_id = #{serialLinkId,jdbcType=INTEGER}, + api_url = #{apiUrl,jdbcType=LONGVARCHAR}, + api_header = #{apiHeader,jdbcType=LONGVARCHAR}, + request_param_info = #{requestParamInfo,jdbcType=LONGVARCHAR}, + output_param_info = #{outputParamInfo,jdbcType=LONGVARCHAR}, + request_body = #{requestBody,jdbcType=LONGVARCHAR}, + dubbo_param_json = #{dubboParamJson,jdbcType=LONGVARCHAR}, + check_point = #{checkPoint,jdbcType=LONGVARCHAR}, + filter_condition = #{filterCondition,jdbcType=LONGVARCHAR}, + api_tsp_auth = #{apiTspAuth,jdbcType=LONGVARCHAR}, + api_traffic_info = #{apiTrafficInfo,jdbcType=LONGVARCHAR}, + api_x5_info = #{apiX5Info,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update scene_api_info + set scene_id = #{sceneId,jdbcType=INTEGER}, + api_order = #{apiOrder,jdbcType=INTEGER}, + api_name = #{apiName,jdbcType=VARCHAR}, + source_type = #{sourceType,jdbcType=INTEGER}, + api_type = #{apiType,jdbcType=INTEGER}, + request_method = #{requestMethod,jdbcType=INTEGER}, + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + need_login = #{needLogin,jdbcType=BIT}, + token_type = #{tokenType,jdbcType=INTEGER}, + content_type = #{contentType,jdbcType=VARCHAR}, + nacos_type = #{nacosType,jdbcType=INTEGER}, + service_name = #{serviceName,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + param_type_list = #{paramTypeList,jdbcType=VARCHAR}, + dubbo_group = #{dubboGroup,jdbcType=VARCHAR}, + dubbo_version = #{dubboVersion,jdbcType=VARCHAR}, + serial_link_id = #{serialLinkId,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + + insert into scene_api_info + (scene_id, api_order, api_name, source_type, api_type, request_method, request_timeout, + need_login, token_type, content_type, nacos_type, service_name, method_name, param_type_list, + dubbo_group, dubbo_version, serial_link_id, api_url, api_header, request_param_info, + output_param_info, request_body, dubbo_param_json, check_point, filter_condition, + api_tsp_auth, api_traffic_info, api_x5_info) + values + + (#{item.sceneId,jdbcType=INTEGER}, #{item.apiOrder,jdbcType=INTEGER}, #{item.apiName,jdbcType=VARCHAR}, + #{item.sourceType,jdbcType=INTEGER}, #{item.apiType,jdbcType=INTEGER}, #{item.requestMethod,jdbcType=INTEGER}, + #{item.requestTimeout,jdbcType=INTEGER}, #{item.needLogin,jdbcType=BIT}, #{item.tokenType,jdbcType=INTEGER}, + #{item.contentType,jdbcType=VARCHAR}, #{item.nacosType,jdbcType=INTEGER}, #{item.serviceName,jdbcType=VARCHAR}, + #{item.methodName,jdbcType=VARCHAR}, #{item.paramTypeList,jdbcType=VARCHAR}, #{item.dubboGroup,jdbcType=VARCHAR}, + #{item.dubboVersion,jdbcType=VARCHAR}, #{item.serialLinkId,jdbcType=INTEGER}, #{item.apiUrl,jdbcType=LONGVARCHAR}, + #{item.apiHeader,jdbcType=LONGVARCHAR}, #{item.requestParamInfo,jdbcType=LONGVARCHAR}, + #{item.outputParamInfo,jdbcType=LONGVARCHAR}, #{item.requestBody,jdbcType=LONGVARCHAR}, + #{item.dubboParamJson,jdbcType=LONGVARCHAR}, #{item.checkPoint,jdbcType=LONGVARCHAR}, + #{item.filterCondition,jdbcType=LONGVARCHAR}, #{item.apiTspAuth,jdbcType=LONGVARCHAR}, + #{item.apiTrafficInfo,jdbcType=LONGVARCHAR}, #{item.apiX5Info,jdbcType=LONGVARCHAR} + ) + + + + insert into scene_api_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.sceneId,jdbcType=INTEGER} + + + #{item.apiOrder,jdbcType=INTEGER} + + + #{item.apiName,jdbcType=VARCHAR} + + + #{item.sourceType,jdbcType=INTEGER} + + + #{item.apiType,jdbcType=INTEGER} + + + #{item.requestMethod,jdbcType=INTEGER} + + + #{item.requestTimeout,jdbcType=INTEGER} + + + #{item.needLogin,jdbcType=BIT} + + + #{item.tokenType,jdbcType=INTEGER} + + + #{item.contentType,jdbcType=VARCHAR} + + + #{item.nacosType,jdbcType=INTEGER} + + + #{item.serviceName,jdbcType=VARCHAR} + + + #{item.methodName,jdbcType=VARCHAR} + + + #{item.paramTypeList,jdbcType=VARCHAR} + + + #{item.dubboGroup,jdbcType=VARCHAR} + + + #{item.dubboVersion,jdbcType=VARCHAR} + + + #{item.serialLinkId,jdbcType=INTEGER} + + + #{item.apiUrl,jdbcType=LONGVARCHAR} + + + #{item.apiHeader,jdbcType=LONGVARCHAR} + + + #{item.requestParamInfo,jdbcType=LONGVARCHAR} + + + #{item.outputParamInfo,jdbcType=LONGVARCHAR} + + + #{item.requestBody,jdbcType=LONGVARCHAR} + + + #{item.dubboParamJson,jdbcType=LONGVARCHAR} + + + #{item.checkPoint,jdbcType=LONGVARCHAR} + + + #{item.filterCondition,jdbcType=LONGVARCHAR} + + + #{item.apiTspAuth,jdbcType=LONGVARCHAR} + + + #{item.apiTrafficInfo,jdbcType=LONGVARCHAR} + + + #{item.apiX5Info,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneGroupMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneGroupMapper.xml new file mode 100644 index 000000000..58c38c59c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneGroupMapper.xml @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, group_name, group_desc, creator, ctime, tenant + + + + + delete from scene_group + where id = #{id,jdbcType=INTEGER} + + + delete from scene_group + + + + + + + SELECT LAST_INSERT_ID() + + insert into scene_group (group_name, group_desc, creator, + ctime, tenant) + values (#{groupName,jdbcType=VARCHAR}, #{groupDesc,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, + #{ctime,jdbcType=BIGINT}, #{tenant,jdbcType=VARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into scene_group + + + group_name, + + + group_desc, + + + creator, + + + ctime, + + + tenant, + + + + + #{groupName,jdbcType=VARCHAR}, + + + #{groupDesc,jdbcType=VARCHAR}, + + + #{creator,jdbcType=VARCHAR}, + + + #{ctime,jdbcType=BIGINT}, + + + #{tenant,jdbcType=VARCHAR}, + + + + + + update scene_group + + + id = #{record.id,jdbcType=INTEGER}, + + + group_name = #{record.groupName,jdbcType=VARCHAR}, + + + group_desc = #{record.groupDesc,jdbcType=VARCHAR}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + tenant = #{record.tenant,jdbcType=VARCHAR}, + + + + + + + + update scene_group + set id = #{record.id,jdbcType=INTEGER}, + group_name = #{record.groupName,jdbcType=VARCHAR}, + group_desc = #{record.groupDesc,jdbcType=VARCHAR}, + creator = #{record.creator,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + tenant = #{record.tenant,jdbcType=VARCHAR} + + + + + + update scene_group + + + group_name = #{groupName,jdbcType=VARCHAR}, + + + group_desc = #{groupDesc,jdbcType=VARCHAR}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + tenant = #{tenant,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update scene_group + set group_name = #{groupName,jdbcType=VARCHAR}, + group_desc = #{groupDesc,jdbcType=VARCHAR}, + creator = #{creator,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + tenant = #{tenant,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + insert into scene_group + (group_name, group_desc, creator, ctime, tenant) + values + + (#{item.groupName,jdbcType=VARCHAR}, #{item.groupDesc,jdbcType=VARCHAR}, #{item.creator,jdbcType=VARCHAR}, + #{item.ctime,jdbcType=BIGINT}, #{item.tenant,jdbcType=VARCHAR}) + + + + insert into scene_group ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.groupName,jdbcType=VARCHAR} + + + #{item.groupDesc,jdbcType=VARCHAR} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.tenant,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneInfoMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneInfoMapper.xml new file mode 100644 index 000000000..3bb45792b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneInfoMapper.xml @@ -0,0 +1,891 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, scene_status, creator, updator, apiNum, remark, scene_type, bench_mode, + Increment_mode, increase_percent, bench_time, max_bench_qps, rps_rate, log_rate, + request_timeout, success_code, ctime, utime, scene_group_id, cur_report_id, scene_env, + tenant, bench_count, scene_source, last_bench_time + + + api_bench_infos, sla, global_header, agent_list, ref_dataset_ids, person_in_charge, + bench_calendar, global_tsp_auth + + + + + + delete from scene_info + where id = #{id,jdbcType=INTEGER} + + + delete from scene_info + + + + + + + SELECT LAST_INSERT_ID() + + insert into scene_info (name, scene_status, creator, + updator, apiNum, remark, + scene_type, bench_mode, Increment_mode, + increase_percent, bench_time, max_bench_qps, + rps_rate, log_rate, request_timeout, + success_code, ctime, utime, + scene_group_id, cur_report_id, scene_env, + tenant, bench_count, scene_source, + last_bench_time, api_bench_infos, sla, + global_header, agent_list, ref_dataset_ids, + person_in_charge, bench_calendar, + global_tsp_auth) + values (#{name,jdbcType=VARCHAR}, #{sceneStatus,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR}, + #{updator,jdbcType=VARCHAR}, #{apinum,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, + #{sceneType,jdbcType=INTEGER}, #{benchMode,jdbcType=INTEGER}, #{incrementMode,jdbcType=INTEGER}, + #{increasePercent,jdbcType=INTEGER}, #{benchTime,jdbcType=INTEGER}, #{maxBenchQps,jdbcType=INTEGER}, + #{rpsRate,jdbcType=INTEGER}, #{logRate,jdbcType=INTEGER}, #{requestTimeout,jdbcType=INTEGER}, + #{successCode,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{utime,jdbcType=BIGINT}, + #{sceneGroupId,jdbcType=INTEGER}, #{curReportId,jdbcType=VARCHAR}, #{sceneEnv,jdbcType=INTEGER}, + #{tenant,jdbcType=VARCHAR}, #{benchCount,jdbcType=INTEGER}, #{sceneSource,jdbcType=INTEGER}, + #{lastBenchTime,jdbcType=BIGINT}, #{apiBenchInfos,jdbcType=LONGVARCHAR}, #{sla,jdbcType=LONGVARCHAR}, + #{globalHeader,jdbcType=LONGVARCHAR}, #{agentList,jdbcType=LONGVARCHAR}, #{refDatasetIds,jdbcType=LONGVARCHAR}, + #{personInCharge,jdbcType=LONGVARCHAR}, #{benchCalendar,jdbcType=LONGVARCHAR}, + #{globalTspAuth,jdbcType=LONGVARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into scene_info + + + name, + + + scene_status, + + + creator, + + + updator, + + + apiNum, + + + remark, + + + scene_type, + + + bench_mode, + + + Increment_mode, + + + increase_percent, + + + bench_time, + + + max_bench_qps, + + + rps_rate, + + + log_rate, + + + request_timeout, + + + success_code, + + + ctime, + + + utime, + + + scene_group_id, + + + cur_report_id, + + + scene_env, + + + tenant, + + + bench_count, + + + scene_source, + + + last_bench_time, + + + api_bench_infos, + + + sla, + + + global_header, + + + agent_list, + + + ref_dataset_ids, + + + person_in_charge, + + + bench_calendar, + + + global_tsp_auth, + + + + + #{name,jdbcType=VARCHAR}, + + + #{sceneStatus,jdbcType=INTEGER}, + + + #{creator,jdbcType=VARCHAR}, + + + #{updator,jdbcType=VARCHAR}, + + + #{apinum,jdbcType=INTEGER}, + + + #{remark,jdbcType=VARCHAR}, + + + #{sceneType,jdbcType=INTEGER}, + + + #{benchMode,jdbcType=INTEGER}, + + + #{incrementMode,jdbcType=INTEGER}, + + + #{increasePercent,jdbcType=INTEGER}, + + + #{benchTime,jdbcType=INTEGER}, + + + #{maxBenchQps,jdbcType=INTEGER}, + + + #{rpsRate,jdbcType=INTEGER}, + + + #{logRate,jdbcType=INTEGER}, + + + #{requestTimeout,jdbcType=INTEGER}, + + + #{successCode,jdbcType=VARCHAR}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{sceneGroupId,jdbcType=INTEGER}, + + + #{curReportId,jdbcType=VARCHAR}, + + + #{sceneEnv,jdbcType=INTEGER}, + + + #{tenant,jdbcType=VARCHAR}, + + + #{benchCount,jdbcType=INTEGER}, + + + #{sceneSource,jdbcType=INTEGER}, + + + #{lastBenchTime,jdbcType=BIGINT}, + + + #{apiBenchInfos,jdbcType=LONGVARCHAR}, + + + #{sla,jdbcType=LONGVARCHAR}, + + + #{globalHeader,jdbcType=LONGVARCHAR}, + + + #{agentList,jdbcType=LONGVARCHAR}, + + + #{refDatasetIds,jdbcType=LONGVARCHAR}, + + + #{personInCharge,jdbcType=LONGVARCHAR}, + + + #{benchCalendar,jdbcType=LONGVARCHAR}, + + + #{globalTspAuth,jdbcType=LONGVARCHAR}, + + + + + + update scene_info + + + id = #{record.id,jdbcType=INTEGER}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + scene_status = #{record.sceneStatus,jdbcType=INTEGER}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + updator = #{record.updator,jdbcType=VARCHAR}, + + + apiNum = #{record.apinum,jdbcType=INTEGER}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + scene_type = #{record.sceneType,jdbcType=INTEGER}, + + + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + + + Increment_mode = #{record.incrementMode,jdbcType=INTEGER}, + + + increase_percent = #{record.increasePercent,jdbcType=INTEGER}, + + + bench_time = #{record.benchTime,jdbcType=INTEGER}, + + + max_bench_qps = #{record.maxBenchQps,jdbcType=INTEGER}, + + + rps_rate = #{record.rpsRate,jdbcType=INTEGER}, + + + log_rate = #{record.logRate,jdbcType=INTEGER}, + + + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + + + success_code = #{record.successCode,jdbcType=VARCHAR}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + scene_group_id = #{record.sceneGroupId,jdbcType=INTEGER}, + + + cur_report_id = #{record.curReportId,jdbcType=VARCHAR}, + + + scene_env = #{record.sceneEnv,jdbcType=INTEGER}, + + + tenant = #{record.tenant,jdbcType=VARCHAR}, + + + bench_count = #{record.benchCount,jdbcType=INTEGER}, + + + scene_source = #{record.sceneSource,jdbcType=INTEGER}, + + + last_bench_time = #{record.lastBenchTime,jdbcType=BIGINT}, + + + api_bench_infos = #{record.apiBenchInfos,jdbcType=LONGVARCHAR}, + + + sla = #{record.sla,jdbcType=LONGVARCHAR}, + + + global_header = #{record.globalHeader,jdbcType=LONGVARCHAR}, + + + agent_list = #{record.agentList,jdbcType=LONGVARCHAR}, + + + ref_dataset_ids = #{record.refDatasetIds,jdbcType=LONGVARCHAR}, + + + person_in_charge = #{record.personInCharge,jdbcType=LONGVARCHAR}, + + + bench_calendar = #{record.benchCalendar,jdbcType=LONGVARCHAR}, + + + global_tsp_auth = #{record.globalTspAuth,jdbcType=LONGVARCHAR}, + + + + + + + + update scene_info + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + scene_status = #{record.sceneStatus,jdbcType=INTEGER}, + creator = #{record.creator,jdbcType=VARCHAR}, + updator = #{record.updator,jdbcType=VARCHAR}, + apiNum = #{record.apinum,jdbcType=INTEGER}, + remark = #{record.remark,jdbcType=VARCHAR}, + scene_type = #{record.sceneType,jdbcType=INTEGER}, + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + Increment_mode = #{record.incrementMode,jdbcType=INTEGER}, + increase_percent = #{record.increasePercent,jdbcType=INTEGER}, + bench_time = #{record.benchTime,jdbcType=INTEGER}, + max_bench_qps = #{record.maxBenchQps,jdbcType=INTEGER}, + rps_rate = #{record.rpsRate,jdbcType=INTEGER}, + log_rate = #{record.logRate,jdbcType=INTEGER}, + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + success_code = #{record.successCode,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + scene_group_id = #{record.sceneGroupId,jdbcType=INTEGER}, + cur_report_id = #{record.curReportId,jdbcType=VARCHAR}, + scene_env = #{record.sceneEnv,jdbcType=INTEGER}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + bench_count = #{record.benchCount,jdbcType=INTEGER}, + scene_source = #{record.sceneSource,jdbcType=INTEGER}, + last_bench_time = #{record.lastBenchTime,jdbcType=BIGINT}, + api_bench_infos = #{record.apiBenchInfos,jdbcType=LONGVARCHAR}, + sla = #{record.sla,jdbcType=LONGVARCHAR}, + global_header = #{record.globalHeader,jdbcType=LONGVARCHAR}, + agent_list = #{record.agentList,jdbcType=LONGVARCHAR}, + ref_dataset_ids = #{record.refDatasetIds,jdbcType=LONGVARCHAR}, + person_in_charge = #{record.personInCharge,jdbcType=LONGVARCHAR}, + bench_calendar = #{record.benchCalendar,jdbcType=LONGVARCHAR}, + global_tsp_auth = #{record.globalTspAuth,jdbcType=LONGVARCHAR} + + + + + + update scene_info + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + scene_status = #{record.sceneStatus,jdbcType=INTEGER}, + creator = #{record.creator,jdbcType=VARCHAR}, + updator = #{record.updator,jdbcType=VARCHAR}, + apiNum = #{record.apinum,jdbcType=INTEGER}, + remark = #{record.remark,jdbcType=VARCHAR}, + scene_type = #{record.sceneType,jdbcType=INTEGER}, + bench_mode = #{record.benchMode,jdbcType=INTEGER}, + Increment_mode = #{record.incrementMode,jdbcType=INTEGER}, + increase_percent = #{record.increasePercent,jdbcType=INTEGER}, + bench_time = #{record.benchTime,jdbcType=INTEGER}, + max_bench_qps = #{record.maxBenchQps,jdbcType=INTEGER}, + rps_rate = #{record.rpsRate,jdbcType=INTEGER}, + log_rate = #{record.logRate,jdbcType=INTEGER}, + request_timeout = #{record.requestTimeout,jdbcType=INTEGER}, + success_code = #{record.successCode,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + scene_group_id = #{record.sceneGroupId,jdbcType=INTEGER}, + cur_report_id = #{record.curReportId,jdbcType=VARCHAR}, + scene_env = #{record.sceneEnv,jdbcType=INTEGER}, + tenant = #{record.tenant,jdbcType=VARCHAR}, + bench_count = #{record.benchCount,jdbcType=INTEGER}, + scene_source = #{record.sceneSource,jdbcType=INTEGER}, + last_bench_time = #{record.lastBenchTime,jdbcType=BIGINT} + + + + + + update scene_info + + + name = #{name,jdbcType=VARCHAR}, + + + scene_status = #{sceneStatus,jdbcType=INTEGER}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + updator = #{updator,jdbcType=VARCHAR}, + + + apiNum = #{apinum,jdbcType=INTEGER}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + scene_type = #{sceneType,jdbcType=INTEGER}, + + + bench_mode = #{benchMode,jdbcType=INTEGER}, + + + Increment_mode = #{incrementMode,jdbcType=INTEGER}, + + + increase_percent = #{increasePercent,jdbcType=INTEGER}, + + + bench_time = #{benchTime,jdbcType=INTEGER}, + + + max_bench_qps = #{maxBenchQps,jdbcType=INTEGER}, + + + rps_rate = #{rpsRate,jdbcType=INTEGER}, + + + log_rate = #{logRate,jdbcType=INTEGER}, + + + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + + + success_code = #{successCode,jdbcType=VARCHAR}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + scene_group_id = #{sceneGroupId,jdbcType=INTEGER}, + + + cur_report_id = #{curReportId,jdbcType=VARCHAR}, + + + scene_env = #{sceneEnv,jdbcType=INTEGER}, + + + tenant = #{tenant,jdbcType=VARCHAR}, + + + bench_count = #{benchCount,jdbcType=INTEGER}, + + + scene_source = #{sceneSource,jdbcType=INTEGER}, + + + last_bench_time = #{lastBenchTime,jdbcType=BIGINT}, + + + api_bench_infos = #{apiBenchInfos,jdbcType=LONGVARCHAR}, + + + sla = #{sla,jdbcType=LONGVARCHAR}, + + + global_header = #{globalHeader,jdbcType=LONGVARCHAR}, + + + agent_list = #{agentList,jdbcType=LONGVARCHAR}, + + + ref_dataset_ids = #{refDatasetIds,jdbcType=LONGVARCHAR}, + + + person_in_charge = #{personInCharge,jdbcType=LONGVARCHAR}, + + + bench_calendar = #{benchCalendar,jdbcType=LONGVARCHAR}, + + + global_tsp_auth = #{globalTspAuth,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update scene_info + set name = #{name,jdbcType=VARCHAR}, + scene_status = #{sceneStatus,jdbcType=INTEGER}, + creator = #{creator,jdbcType=VARCHAR}, + updator = #{updator,jdbcType=VARCHAR}, + apiNum = #{apinum,jdbcType=INTEGER}, + remark = #{remark,jdbcType=VARCHAR}, + scene_type = #{sceneType,jdbcType=INTEGER}, + bench_mode = #{benchMode,jdbcType=INTEGER}, + Increment_mode = #{incrementMode,jdbcType=INTEGER}, + increase_percent = #{increasePercent,jdbcType=INTEGER}, + bench_time = #{benchTime,jdbcType=INTEGER}, + max_bench_qps = #{maxBenchQps,jdbcType=INTEGER}, + rps_rate = #{rpsRate,jdbcType=INTEGER}, + log_rate = #{logRate,jdbcType=INTEGER}, + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + success_code = #{successCode,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + scene_group_id = #{sceneGroupId,jdbcType=INTEGER}, + cur_report_id = #{curReportId,jdbcType=VARCHAR}, + scene_env = #{sceneEnv,jdbcType=INTEGER}, + tenant = #{tenant,jdbcType=VARCHAR}, + bench_count = #{benchCount,jdbcType=INTEGER}, + scene_source = #{sceneSource,jdbcType=INTEGER}, + last_bench_time = #{lastBenchTime,jdbcType=BIGINT}, + api_bench_infos = #{apiBenchInfos,jdbcType=LONGVARCHAR}, + sla = #{sla,jdbcType=LONGVARCHAR}, + global_header = #{globalHeader,jdbcType=LONGVARCHAR}, + agent_list = #{agentList,jdbcType=LONGVARCHAR}, + ref_dataset_ids = #{refDatasetIds,jdbcType=LONGVARCHAR}, + person_in_charge = #{personInCharge,jdbcType=LONGVARCHAR}, + bench_calendar = #{benchCalendar,jdbcType=LONGVARCHAR}, + global_tsp_auth = #{globalTspAuth,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update scene_info + set name = #{name,jdbcType=VARCHAR}, + scene_status = #{sceneStatus,jdbcType=INTEGER}, + creator = #{creator,jdbcType=VARCHAR}, + updator = #{updator,jdbcType=VARCHAR}, + apiNum = #{apinum,jdbcType=INTEGER}, + remark = #{remark,jdbcType=VARCHAR}, + scene_type = #{sceneType,jdbcType=INTEGER}, + bench_mode = #{benchMode,jdbcType=INTEGER}, + Increment_mode = #{incrementMode,jdbcType=INTEGER}, + increase_percent = #{increasePercent,jdbcType=INTEGER}, + bench_time = #{benchTime,jdbcType=INTEGER}, + max_bench_qps = #{maxBenchQps,jdbcType=INTEGER}, + rps_rate = #{rpsRate,jdbcType=INTEGER}, + log_rate = #{logRate,jdbcType=INTEGER}, + request_timeout = #{requestTimeout,jdbcType=INTEGER}, + success_code = #{successCode,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + scene_group_id = #{sceneGroupId,jdbcType=INTEGER}, + cur_report_id = #{curReportId,jdbcType=VARCHAR}, + scene_env = #{sceneEnv,jdbcType=INTEGER}, + tenant = #{tenant,jdbcType=VARCHAR}, + bench_count = #{benchCount,jdbcType=INTEGER}, + scene_source = #{sceneSource,jdbcType=INTEGER}, + last_bench_time = #{lastBenchTime,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + insert into scene_info + (name, scene_status, creator, updator, apiNum, remark, scene_type, bench_mode, Increment_mode, + increase_percent, bench_time, max_bench_qps, rps_rate, log_rate, request_timeout, + success_code, ctime, utime, scene_group_id, cur_report_id, scene_env, tenant, bench_count, + scene_source, last_bench_time, api_bench_infos, sla, global_header, agent_list, + ref_dataset_ids, person_in_charge, bench_calendar, global_tsp_auth) + values + + (#{item.name,jdbcType=VARCHAR}, #{item.sceneStatus,jdbcType=INTEGER}, #{item.creator,jdbcType=VARCHAR}, + #{item.updator,jdbcType=VARCHAR}, #{item.apinum,jdbcType=INTEGER}, #{item.remark,jdbcType=VARCHAR}, + #{item.sceneType,jdbcType=INTEGER}, #{item.benchMode,jdbcType=INTEGER}, #{item.incrementMode,jdbcType=INTEGER}, + #{item.increasePercent,jdbcType=INTEGER}, #{item.benchTime,jdbcType=INTEGER}, #{item.maxBenchQps,jdbcType=INTEGER}, + #{item.rpsRate,jdbcType=INTEGER}, #{item.logRate,jdbcType=INTEGER}, #{item.requestTimeout,jdbcType=INTEGER}, + #{item.successCode,jdbcType=VARCHAR}, #{item.ctime,jdbcType=BIGINT}, #{item.utime,jdbcType=BIGINT}, + #{item.sceneGroupId,jdbcType=INTEGER}, #{item.curReportId,jdbcType=VARCHAR}, #{item.sceneEnv,jdbcType=INTEGER}, + #{item.tenant,jdbcType=VARCHAR}, #{item.benchCount,jdbcType=INTEGER}, #{item.sceneSource,jdbcType=INTEGER}, + #{item.lastBenchTime,jdbcType=BIGINT}, #{item.apiBenchInfos,jdbcType=LONGVARCHAR}, + #{item.sla,jdbcType=LONGVARCHAR}, #{item.globalHeader,jdbcType=LONGVARCHAR}, #{item.agentList,jdbcType=LONGVARCHAR}, + #{item.refDatasetIds,jdbcType=LONGVARCHAR}, #{item.personInCharge,jdbcType=LONGVARCHAR}, + #{item.benchCalendar,jdbcType=LONGVARCHAR}, #{item.globalTspAuth,jdbcType=LONGVARCHAR} + ) + + + + insert into scene_info ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.name,jdbcType=VARCHAR} + + + #{item.sceneStatus,jdbcType=INTEGER} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.updator,jdbcType=VARCHAR} + + + #{item.apinum,jdbcType=INTEGER} + + + #{item.remark,jdbcType=VARCHAR} + + + #{item.sceneType,jdbcType=INTEGER} + + + #{item.benchMode,jdbcType=INTEGER} + + + #{item.incrementMode,jdbcType=INTEGER} + + + #{item.increasePercent,jdbcType=INTEGER} + + + #{item.benchTime,jdbcType=INTEGER} + + + #{item.maxBenchQps,jdbcType=INTEGER} + + + #{item.rpsRate,jdbcType=INTEGER} + + + #{item.logRate,jdbcType=INTEGER} + + + #{item.requestTimeout,jdbcType=INTEGER} + + + #{item.successCode,jdbcType=VARCHAR} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.sceneGroupId,jdbcType=INTEGER} + + + #{item.curReportId,jdbcType=VARCHAR} + + + #{item.sceneEnv,jdbcType=INTEGER} + + + #{item.tenant,jdbcType=VARCHAR} + + + #{item.benchCount,jdbcType=INTEGER} + + + #{item.sceneSource,jdbcType=INTEGER} + + + #{item.lastBenchTime,jdbcType=BIGINT} + + + #{item.apiBenchInfos,jdbcType=LONGVARCHAR} + + + #{item.sla,jdbcType=LONGVARCHAR} + + + #{item.globalHeader,jdbcType=LONGVARCHAR} + + + #{item.agentList,jdbcType=LONGVARCHAR} + + + #{item.refDatasetIds,jdbcType=LONGVARCHAR} + + + #{item.personInCharge,jdbcType=LONGVARCHAR} + + + #{item.benchCalendar,jdbcType=LONGVARCHAR} + + + #{item.globalTspAuth,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneSnapshotMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneSnapshotMapper.xml new file mode 100644 index 000000000..ab2357986 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SceneSnapshotMapper.xml @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, scene_id, snapshot_id, create_time, update_time, create_by, version, md5, type + + + scene + + + + + + delete from scene_snapshot + where id = #{id,jdbcType=BIGINT} + + + delete from scene_snapshot + + + + + + + SELECT LAST_INSERT_ID() + + insert into scene_snapshot (scene_id, snapshot_id, create_time, + update_time, create_by, version, + md5, type, scene + ) + values (#{sceneId,jdbcType=BIGINT}, #{snapshotId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, + #{md5,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{scene,jdbcType=LONGVARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into scene_snapshot + + + scene_id, + + + snapshot_id, + + + create_time, + + + update_time, + + + create_by, + + + version, + + + md5, + + + type, + + + scene, + + + + + #{sceneId,jdbcType=BIGINT}, + + + #{snapshotId,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{version,jdbcType=INTEGER}, + + + #{md5,jdbcType=VARCHAR}, + + + #{type,jdbcType=INTEGER}, + + + #{scene,jdbcType=LONGVARCHAR}, + + + + + + update scene_snapshot + + + id = #{record.id,jdbcType=BIGINT}, + + + scene_id = #{record.sceneId,jdbcType=BIGINT}, + + + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + version = #{record.version,jdbcType=INTEGER}, + + + md5 = #{record.md5,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=INTEGER}, + + + scene = #{record.scene,jdbcType=LONGVARCHAR}, + + + + + + + + update scene_snapshot + set id = #{record.id,jdbcType=BIGINT}, + scene_id = #{record.sceneId,jdbcType=BIGINT}, + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + version = #{record.version,jdbcType=INTEGER}, + md5 = #{record.md5,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=INTEGER}, + scene = #{record.scene,jdbcType=LONGVARCHAR} + + + + + + update scene_snapshot + set id = #{record.id,jdbcType=BIGINT}, + scene_id = #{record.sceneId,jdbcType=BIGINT}, + snapshot_id = #{record.snapshotId,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + version = #{record.version,jdbcType=INTEGER}, + md5 = #{record.md5,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=INTEGER} + + + + + + update scene_snapshot + + + scene_id = #{sceneId,jdbcType=BIGINT}, + + + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + version = #{version,jdbcType=INTEGER}, + + + md5 = #{md5,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=INTEGER}, + + + scene = #{scene,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update scene_snapshot + set scene_id = #{sceneId,jdbcType=BIGINT}, + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + create_by = #{createBy,jdbcType=VARCHAR}, + version = #{version,jdbcType=INTEGER}, + md5 = #{md5,jdbcType=VARCHAR}, + type = #{type,jdbcType=INTEGER}, + scene = #{scene,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update scene_snapshot + set scene_id = #{sceneId,jdbcType=BIGINT}, + snapshot_id = #{snapshotId,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + create_by = #{createBy,jdbcType=VARCHAR}, + version = #{version,jdbcType=INTEGER}, + md5 = #{md5,jdbcType=VARCHAR}, + type = #{type,jdbcType=INTEGER} + where id = #{id,jdbcType=BIGINT} + + + insert into scene_snapshot + (scene_id, snapshot_id, create_time, update_time, create_by, version, md5, type, + scene) + values + + (#{item.sceneId,jdbcType=BIGINT}, #{item.snapshotId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR}, #{item.version,jdbcType=INTEGER}, + #{item.md5,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER}, #{item.scene,jdbcType=LONGVARCHAR} + ) + + + + insert into scene_snapshot ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.sceneId,jdbcType=BIGINT} + + + #{item.snapshotId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=TIMESTAMP} + + + #{item.updateTime,jdbcType=TIMESTAMP} + + + #{item.createBy,jdbcType=VARCHAR} + + + #{item.version,jdbcType=INTEGER} + + + #{item.md5,jdbcType=VARCHAR} + + + #{item.type,jdbcType=INTEGER} + + + #{item.scene,jdbcType=LONGVARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SerialLinkMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SerialLinkMapper.xml new file mode 100644 index 000000000..999f8167e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SerialLinkMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, scene_id, enable + + + + + delete from serial_link + where id = #{id,jdbcType=INTEGER} + + + delete from serial_link + + + + + + + SELECT LAST_INSERT_ID() + + insert into serial_link (name, scene_id, enable + ) + values (#{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=INTEGER}, #{enable,jdbcType=BIT} + ) + + + + SELECT LAST_INSERT_ID() + + insert into serial_link + + + name, + + + scene_id, + + + enable, + + + + + #{name,jdbcType=VARCHAR}, + + + #{sceneId,jdbcType=INTEGER}, + + + #{enable,jdbcType=BIT}, + + + + + + update serial_link + + + id = #{record.id,jdbcType=INTEGER}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + scene_id = #{record.sceneId,jdbcType=INTEGER}, + + + enable = #{record.enable,jdbcType=BIT}, + + + + + + + + update serial_link + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + scene_id = #{record.sceneId,jdbcType=INTEGER}, + enable = #{record.enable,jdbcType=BIT} + + + + + + update serial_link + + + name = #{name,jdbcType=VARCHAR}, + + + scene_id = #{sceneId,jdbcType=INTEGER}, + + + enable = #{enable,jdbcType=BIT}, + + + where id = #{id,jdbcType=INTEGER} + + + update serial_link + set name = #{name,jdbcType=VARCHAR}, + scene_id = #{sceneId,jdbcType=INTEGER}, + enable = #{enable,jdbcType=BIT} + where id = #{id,jdbcType=INTEGER} + + + insert into serial_link + (name, scene_id, enable) + values + + (#{item.name,jdbcType=VARCHAR}, #{item.sceneId,jdbcType=INTEGER}, #{item.enable,jdbcType=BIT} + ) + + + + insert into serial_link ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.name,jdbcType=VARCHAR} + + + #{item.sceneId,jdbcType=INTEGER} + + + #{item.enable,jdbcType=BIT} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaMapper.xml new file mode 100644 index 000000000..31de2d7ee --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaMapper.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, note, business_group, ctime, utime, creator, updater + + + + + delete from sla + where id = #{id,jdbcType=INTEGER} + + + delete from sla + + + + + + + SELECT LAST_INSERT_ID() + + insert into sla (name, note, business_group, + ctime, utime, creator, + updater) + values (#{name,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{businessGroup,jdbcType=VARCHAR}, + #{ctime,jdbcType=BIGINT}, #{utime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, + #{updater,jdbcType=VARCHAR}) + + + + SELECT LAST_INSERT_ID() + + insert into sla + + + name, + + + note, + + + business_group, + + + ctime, + + + utime, + + + creator, + + + updater, + + + + + #{name,jdbcType=VARCHAR}, + + + #{note,jdbcType=VARCHAR}, + + + #{businessGroup,jdbcType=VARCHAR}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{creator,jdbcType=VARCHAR}, + + + #{updater,jdbcType=VARCHAR}, + + + + + + update sla + + + id = #{record.id,jdbcType=INTEGER}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + note = #{record.note,jdbcType=VARCHAR}, + + + business_group = #{record.businessGroup,jdbcType=VARCHAR}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + updater = #{record.updater,jdbcType=VARCHAR}, + + + + + + + + update sla + set id = #{record.id,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + note = #{record.note,jdbcType=VARCHAR}, + business_group = #{record.businessGroup,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + updater = #{record.updater,jdbcType=VARCHAR} + + + + + + update sla + + + name = #{name,jdbcType=VARCHAR}, + + + note = #{note,jdbcType=VARCHAR}, + + + business_group = #{businessGroup,jdbcType=VARCHAR}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update sla + set name = #{name,jdbcType=VARCHAR}, + note = #{note,jdbcType=VARCHAR}, + business_group = #{businessGroup,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + updater = #{updater,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + insert into sla + (name, note, business_group, ctime, utime, creator, updater) + values + + (#{item.name,jdbcType=VARCHAR}, #{item.note,jdbcType=VARCHAR}, #{item.businessGroup,jdbcType=VARCHAR}, + #{item.ctime,jdbcType=BIGINT}, #{item.utime,jdbcType=BIGINT}, #{item.creator,jdbcType=VARCHAR}, + #{item.updater,jdbcType=VARCHAR}) + + + + insert into sla ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.name,jdbcType=VARCHAR} + + + #{item.note,jdbcType=VARCHAR} + + + #{item.businessGroup,jdbcType=VARCHAR} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.updater,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaRuleMapper.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaRuleMapper.xml new file mode 100644 index 000000000..f573f80f8 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/mapper/SlaRuleMapper.xml @@ -0,0 +1,401 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, sla_id, name, rule_item_type, rule_item, compare_condition, compare_value, degree, + action_level, ctime, utime, creator, updater + + + + + delete from sla_rule + where id = #{id,jdbcType=INTEGER} + + + delete from sla_rule + + + + + + + SELECT LAST_INSERT_ID() + + insert into sla_rule (sla_id, name, rule_item_type, + rule_item, compare_condition, compare_value, + degree, action_level, ctime, + utime, creator, updater + ) + values (#{slaId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{ruleItemType,jdbcType=VARCHAR}, + #{ruleItem,jdbcType=VARCHAR}, #{compareCondition,jdbcType=VARCHAR}, #{compareValue,jdbcType=INTEGER}, + #{degree,jdbcType=INTEGER}, #{actionLevel,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, + #{utime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, #{updater,jdbcType=VARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into sla_rule + + + sla_id, + + + name, + + + rule_item_type, + + + rule_item, + + + compare_condition, + + + compare_value, + + + degree, + + + action_level, + + + ctime, + + + utime, + + + creator, + + + updater, + + + + + #{slaId,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{ruleItemType,jdbcType=VARCHAR}, + + + #{ruleItem,jdbcType=VARCHAR}, + + + #{compareCondition,jdbcType=VARCHAR}, + + + #{compareValue,jdbcType=INTEGER}, + + + #{degree,jdbcType=INTEGER}, + + + #{actionLevel,jdbcType=VARCHAR}, + + + #{ctime,jdbcType=BIGINT}, + + + #{utime,jdbcType=BIGINT}, + + + #{creator,jdbcType=VARCHAR}, + + + #{updater,jdbcType=VARCHAR}, + + + + + + update sla_rule + + + id = #{record.id,jdbcType=INTEGER}, + + + sla_id = #{record.slaId,jdbcType=INTEGER}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + rule_item_type = #{record.ruleItemType,jdbcType=VARCHAR}, + + + rule_item = #{record.ruleItem,jdbcType=VARCHAR}, + + + compare_condition = #{record.compareCondition,jdbcType=VARCHAR}, + + + compare_value = #{record.compareValue,jdbcType=INTEGER}, + + + degree = #{record.degree,jdbcType=INTEGER}, + + + action_level = #{record.actionLevel,jdbcType=VARCHAR}, + + + ctime = #{record.ctime,jdbcType=BIGINT}, + + + utime = #{record.utime,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + updater = #{record.updater,jdbcType=VARCHAR}, + + + + + + + + update sla_rule + set id = #{record.id,jdbcType=INTEGER}, + sla_id = #{record.slaId,jdbcType=INTEGER}, + name = #{record.name,jdbcType=VARCHAR}, + rule_item_type = #{record.ruleItemType,jdbcType=VARCHAR}, + rule_item = #{record.ruleItem,jdbcType=VARCHAR}, + compare_condition = #{record.compareCondition,jdbcType=VARCHAR}, + compare_value = #{record.compareValue,jdbcType=INTEGER}, + degree = #{record.degree,jdbcType=INTEGER}, + action_level = #{record.actionLevel,jdbcType=VARCHAR}, + ctime = #{record.ctime,jdbcType=BIGINT}, + utime = #{record.utime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + updater = #{record.updater,jdbcType=VARCHAR} + + + + + + update sla_rule + + + sla_id = #{slaId,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + rule_item_type = #{ruleItemType,jdbcType=VARCHAR}, + + + rule_item = #{ruleItem,jdbcType=VARCHAR}, + + + compare_condition = #{compareCondition,jdbcType=VARCHAR}, + + + compare_value = #{compareValue,jdbcType=INTEGER}, + + + degree = #{degree,jdbcType=INTEGER}, + + + action_level = #{actionLevel,jdbcType=VARCHAR}, + + + ctime = #{ctime,jdbcType=BIGINT}, + + + utime = #{utime,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update sla_rule + set sla_id = #{slaId,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + rule_item_type = #{ruleItemType,jdbcType=VARCHAR}, + rule_item = #{ruleItem,jdbcType=VARCHAR}, + compare_condition = #{compareCondition,jdbcType=VARCHAR}, + compare_value = #{compareValue,jdbcType=INTEGER}, + degree = #{degree,jdbcType=INTEGER}, + action_level = #{actionLevel,jdbcType=VARCHAR}, + ctime = #{ctime,jdbcType=BIGINT}, + utime = #{utime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + updater = #{updater,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + insert into sla_rule + (sla_id, name, rule_item_type, rule_item, compare_condition, compare_value, degree, + action_level, ctime, utime, creator, updater) + values + + (#{item.slaId,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR}, #{item.ruleItemType,jdbcType=VARCHAR}, + #{item.ruleItem,jdbcType=VARCHAR}, #{item.compareCondition,jdbcType=VARCHAR}, #{item.compareValue,jdbcType=INTEGER}, + #{item.degree,jdbcType=INTEGER}, #{item.actionLevel,jdbcType=VARCHAR}, #{item.ctime,jdbcType=BIGINT}, + #{item.utime,jdbcType=BIGINT}, #{item.creator,jdbcType=VARCHAR}, #{item.updater,jdbcType=VARCHAR} + ) + + + + insert into sla_rule ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.slaId,jdbcType=INTEGER} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.ruleItemType,jdbcType=VARCHAR} + + + #{item.ruleItem,jdbcType=VARCHAR} + + + #{item.compareCondition,jdbcType=VARCHAR} + + + #{item.compareValue,jdbcType=INTEGER} + + + #{item.degree,jdbcType=INTEGER} + + + #{item.actionLevel,jdbcType=VARCHAR} + + + #{item.ctime,jdbcType=BIGINT} + + + #{item.utime,jdbcType=BIGINT} + + + #{item.creator,jdbcType=VARCHAR} + + + #{item.updater,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/sql/init.sql b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/sql/init.sql new file mode 100644 index 000000000..922b1480b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/main/resources/sql/init.sql @@ -0,0 +1,325 @@ +-- table: 数据源 -- +CREATE TABLE `agent_apply_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '唯一id', + `apply_user` varchar(255) NOT NULL DEFAULT '' COMMENT '申请人', + `apply_org_id` varchar(255) NOT NULL DEFAULT '' COMMENT '申请人组织id', + `apply_org_name` varchar(255) NOT NULL DEFAULT '' COMMENT '申请人组织中文名', + `agent_ip` varchar(255) NOT NULL DEFAULT '' COMMENT '申请的发压机ip', + `agent_hostname` varchar(255) NOT NULL DEFAULT '' COMMENT '申请的发压机的hostname', + `apply_status` int(11) NOT NULL DEFAULT '0' COMMENT '申请状态 0:待审核 1:审核完成', + `ctime` bigint(64) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001 COMMENT='压测机申请记录表'; + +CREATE TABLE `agent_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '压测机id', + `server_name` varchar(255) DEFAULT NULL COMMENT '服务名', + `ip` varchar(255) NOT NULL COMMENT '压测机ip', + `port` int(32) DEFAULT NULL COMMENT '压测机端口', + `cpu` int(32) DEFAULT NULL COMMENT '压测机总cpu', + `mem` bigint(64) DEFAULT NULL COMMENT '压测机总内存', + `use_cpu` int(32) DEFAULT NULL COMMENT '已使用的cpu数', + `use_mem` bigint(20) DEFAULT NULL COMMENT '已使用的内存数', + `hostname` varchar(255) DEFAULT NULL COMMENT '主机名', + `client_desc` varchar(255) DEFAULT NULL COMMENT '描述', + `ctime` bigint(64) DEFAULT NULL COMMENT '创建时间', + `utime` bigint(64) DEFAULT NULL COMMENT '更新时间', + `enable` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否可用', + `node_ip` varchar(255) DEFAULT NULL COMMENT '压测机所属宿主机ip', + `tenant` varchar(255) DEFAULT NULL COMMENT '租户信息', + `tenant_cn` varchar(255) NOT NULL DEFAULT '' COMMENT '租户,中文名', + `domain_conf` json DEFAULT NULL COMMENT '域名绑定', + PRIMARY KEY (`id`), + UNIQUE KEY `agent_ip_uindex` (`ip`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=60001; + +CREATE TABLE `checkpoint_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `check_type` int(11) DEFAULT NULL COMMENT '检查点类型', + `check_obj` varchar(255) DEFAULT NULL COMMENT '检查对象', + `check_condition` int(11) DEFAULT NULL COMMENT '检查条件', + `check_content` text DEFAULT NULL COMMENT '检查内容', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=60001; + +CREATE TABLE `dataset` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `note` varchar(128) DEFAULT NULL, + `type` int(32) DEFAULT NULL, + `default_param_name` varchar(128) DEFAULT NULL, + `ignore_first_row` int(32) DEFAULT '0', + `file_name` varchar(128) DEFAULT NULL, + `file_url` varchar(1024) DEFAULT NULL, + `file_ks_key` varchar(256) DEFAULT NULL, + `file_rows` bigint(64) DEFAULT NULL, + `file_size` bigint(64) DEFAULT NULL, + `preview_file_rows` json DEFAULT NULL, + `header` json DEFAULT NULL, + `interface_url` varchar(256) DEFAULT NULL, + `traffic_record_id` int(32) DEFAULT NULL, + `ctime` bigint(64) DEFAULT NULL, + `utime` bigint(64) DEFAULT NULL, + `creator` varchar(128) DEFAULT NULL, + `updater` varchar(128) DEFAULT NULL, + `tenant` varchar(255) DEFAULT NULL COMMENT '租户信息', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=60003; + +CREATE TABLE `dataset_scene_relation` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `dataset_id` int(32) DEFAULT NULL, + `scene_id` int(32) NOT NULL DEFAULT '0', + `ctime` bigint(64) DEFAULT NULL, + `utime` bigint(64) DEFAULT NULL, + `creator` varchar(128) DEFAULT NULL, + `updater` varchar(128) DEFAULT NULL, + `enable` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否真正引用', + PRIMARY KEY (`id`), + UNIQUE KEY `dataset_id` (`dataset_id`,`scene_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=60001; + +CREATE TABLE `domain_apply_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '主键', + `apply_user` varchar(255) NOT NULL DEFAULT '' COMMENT '申请人', + `domain` varchar(255) NOT NULL DEFAULT '' COMMENT '要绑定的域名', + `ip` varchar(255) NOT NULL DEFAULT '' COMMENT '要绑定的ip', + `agent_ip_list` json DEFAULT NULL COMMENT '绑定的机器ip列表', + `apply_status` int(11) NOT NULL DEFAULT '0' COMMENT '申请状态 0:待审核 1:审核完成', + `ctime` bigint(64) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001; + +CREATE TABLE `mibench_task` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `qps` int(32) DEFAULT NULL, + `origin_qps` int(32) DEFAULT NULL COMMENT '起始qps', + `max_qps` int(11) DEFAULT NULL COMMENT '最大qps', + `scene_id` int(32) DEFAULT NULL, + `serial_link_id` int(32) DEFAULT NULL COMMENT '所属链路id', + `scene_api_id` int(32) DEFAULT NULL COMMENT '该任务属于哪个接口', + `time` int(32) DEFAULT NULL, + `agent_num` int(32) DEFAULT NULL, + `finish_agent_num` int(32) DEFAULT NULL, + `ctime` bigint(64) DEFAULT NULL, + `utime` bigint(64) DEFAULT NULL, + `state` int(32) DEFAULT NULL, + `version` int(32) DEFAULT NULL, + `success_num` bigint(64) DEFAULT NULL, + `failure_num` bigint(64) DEFAULT NULL, + `task_type` int(32) DEFAULT NULL COMMENT '任务类型:1 http 2 dubbo 3 dag', + `parent_task_id` int(32) DEFAULT NULL COMMENT '所属父任务id', + `debug_result` longtext DEFAULT NULL COMMENT '调试的结果', + `debug_result_header` json DEFAULT NULL, + `report_id` varchar(255) DEFAULT NULL COMMENT '标记为同一次压测任务', + `request_params` json DEFAULT NULL COMMENT '请求参数', + `req_param_type` int(11) DEFAULT NULL COMMENT '请求参数所属类型', + `ok` tinyint(1) DEFAULT NULL COMMENT '是否成功', + `connect_task_num` int(11) DEFAULT NULL COMMENT '同一次压测下的总任务数', + `debug_trigger_cp` json DEFAULT NULL COMMENT '触发的cp', + `debug_trigger_filter_condition` json DEFAULT NULL COMMENT '触发的过滤条件', + `debug_req_headers` json DEFAULT NULL, + `debug_url` text DEFAULT NULL COMMENT '实际使用的url', + `debug_rt` int(32) NOT NULL DEFAULT '0' COMMENT '调试的rt', + `debug_size` int(32) NOT NULL DEFAULT '0' COMMENT '调试返回结果的大小', + `bench_mode` int(11) NOT NULL DEFAULT '0' COMMENT '压力模式 0 rps、1并发', + `increase_mode` int(11) NOT NULL DEFAULT '0' COMMENT 'Rps压力增加模式 0 固定() 1 手动 2 百分比递增', + `increase_percent` int(11) NOT NULL DEFAULT '0' COMMENT '递增百分比', + PRIMARY KEY (`id`), + KEY `idx_parent_task_id` (`parent_task_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=152326; + +CREATE TABLE `operation_log` +( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id', + `report_id` varchar(255) DEFAULT '' COMMENT '报告id', + `scene_id` int(32) NOT NULL COMMENT '所属场景id', + `type` int(4) unsigned DEFAULT '0' COMMENT '操作类型', + `content` text DEFAULT NULL COMMENT '操作内容', + `support_operation` json DEFAULT NULL, + `create_by` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人用户名', + `create_time` bigint(64) NOT NULL COMMENT '创建时间', + `update_time` bigint(64) NOT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + KEY `operation_log_scene_id_index` (`scene_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=60003 COMMENT='压测操作记录'; + +CREATE TABLE `report_info` +( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id', + `scene_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '场景id', + `snapshot_id` varchar(128) NOT NULL DEFAULT '' COMMENT '场景快照id', + `report_id` varchar(128) NOT NULL DEFAULT '' COMMENT '报告id', + `report_name` varchar(255) NOT NULL DEFAULT '' COMMENT '报告名', + `duration` int(10) unsigned DEFAULT '0' COMMENT '压测时长', + `concurrency` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '默认并发数', + `concurrency_max` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大并发数', + `create_by` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人用户名', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `status` int(11) unsigned NOT NULL DEFAULT '0', + `task_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '执行任务id', + `file_path` varchar(255) NOT NULL DEFAULT '' COMMENT '报告路径', + `finish_time` bigint(64) DEFAULT NULL COMMENT '压测结束时间', + `agents` text DEFAULT NULL COMMENT 'agent ip列表', + `extra` text DEFAULT NULL COMMENT '扩展信息', + `sla_event_list` json DEFAULT NULL COMMENT '事件列表', + `total_stat_analysis_event_list` json DEFAULT NULL COMMENT '错误分析事件记录', + `tenant` varchar(255) DEFAULT NULL COMMENT '租户信息', + `link_to_dag_id` json DEFAULT NULL COMMENT '链路id与dag任务id的映射', + PRIMARY KEY (`id`), + UNIQUE KEY `report_info_report_id_uindex` (`report_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=90001 COMMENT='压测报告信息'; + +CREATE TABLE `scene_api_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '场景接口id', + `scene_id` int(32) NOT NULL COMMENT '该接口所属场景id', + `api_order` int(11) NOT NULL COMMENT '接口在该场景下的顺序', + `api_name` varchar(255) NOT NULL DEFAULT '' COMMENT '接口名', + `source_type` int(11) NOT NULL COMMENT '接口来源 1:mi-api导入 2 手动输入', + `api_type` int(11) NOT NULL COMMENT '接口类型 0:http 1:dubbo', + `api_url` text DEFAULT NULL COMMENT '接口请求url', + `request_method` int(11) NOT NULL DEFAULT '0' COMMENT '请求方式 0:get,1:post', + `request_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '请求超时时间 ms', + `need_login` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要登录 0:否 1:是', + `token_type` int(11) DEFAULT '0' COMMENT '使用的token部门 0 有品(tokens) 1 米粉app ', + `api_header` json DEFAULT NULL COMMENT '接口请求头', + `content_type` varchar(255) DEFAULT NULL COMMENT 'post接口的请求数据格式 x-www-form-urlencoded raw(多种)', + `request_param_info` json DEFAULT NULL COMMENT 'http请求参数,带结构', + `output_param_info` json DEFAULT NULL COMMENT '接口出参定义', + `request_body` json DEFAULT NULL COMMENT 'post 请求体', + `nacos_type` int(11) DEFAULT NULL COMMENT 'dubbo接口使用的nacos地址', + `service_name` varchar(255) DEFAULT '' COMMENT 'dubbo服务名', + `method_name` varchar(255) DEFAULT '' COMMENT 'dubbo接口方法名', + `param_type_list` varchar(255) DEFAULT '' COMMENT 'dubbo参数类型列表', + `dubbo_param_json` json DEFAULT NULL COMMENT 'dubbo请求参数', + `dubbo_group` varchar(255) DEFAULT '' COMMENT 'dubbo接口分组', + `dubbo_version` varchar(255) DEFAULT '' COMMENT 'dubbo接口版本', + `serial_link_id` int(32) NOT NULL COMMENT '所属串联链路id', + `check_point` json DEFAULT NULL COMMENT '接口检查点配置', + `filter_condition` json DEFAULT NULL COMMENT '接口的过滤条件', + `api_tsp_auth` json DEFAULT NULL COMMENT '接口级别tsp验权', + `api_traffic_info` json DEFAULT NULL COMMENT '接口的流量录制配置', + `api_x5_info` json DEFAULT NULL COMMENT 'x5鉴权信息', + PRIMARY KEY (`id`), + KEY `idx_scene_link` (`scene_id`,`serial_link_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90001; + +CREATE TABLE `scene_group` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '分组id', + `group_name` varchar(255) NOT NULL COMMENT '分组名', + `group_desc` varchar(255) DEFAULT NULL COMMENT '分组描述', + `creator` varchar(255) DEFAULT NULL COMMENT '创建人', + `ctime` bigint(64) NOT NULL COMMENT '创建时间', + `tenant` varchar(255) DEFAULT NULL COMMENT '租户信息', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=60002; + +CREATE TABLE `scene_info` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT 'id', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT '场景名', + `scene_status` int(11) NOT NULL COMMENT '场景状态 0 待启动 1 执行中', + `creator` varchar(255) NOT NULL DEFAULT '' COMMENT '创建人', + `updator` varchar(255) NOT NULL DEFAULT '' COMMENT '更新人', + `apiNum` int(11) NOT NULL COMMENT '有效api数', + `remark` varchar(255) DEFAULT '' COMMENT '备注', + `scene_type` int(11) NOT NULL COMMENT '场景类型 0:http 1:dubbo', + `bench_mode` int(11) NOT NULL DEFAULT '0' COMMENT '压力模式 0 RPS (目前仅支持该模式)', + `Increment_mode` int(11) NOT NULL DEFAULT '0' COMMENT '递增模式 0 手动(Rps下仅支持手动模式)', + `increase_percent` int(11) NOT NULL DEFAULT '0' COMMENT '递增模式下的递增百分比', + `bench_time` int(11) NOT NULL DEFAULT '3' COMMENT '压测时间(秒)', + `max_bench_qps` int(11) DEFAULT NULL COMMENT '场景最大施压qps', + `rps_rate` int(11) NOT NULL DEFAULT '100' COMMENT '发压比例', + `api_bench_infos` json DEFAULT NULL COMMENT '场景各接口施压配置,最大、起始RPS,json格式', + `log_rate` int(11) DEFAULT '0' COMMENT '日志采样率 百分比', + `sla` json DEFAULT NULL COMMENT '场景对应的sla 信息', + `request_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '通用请求超时时间 ms', + `success_code` varchar(255) DEFAULT NULL COMMENT '请求成功状态码(默认200 )"301,302"', + `ctime` bigint(64) NOT NULL COMMENT '创建时间', + `utime` bigint(64) NOT NULL COMMENT '更新时间', + `scene_group_id` int(32) NOT NULL DEFAULT '0' COMMENT '所属分组id', + `global_header` json DEFAULT NULL COMMENT '全局header', + `cur_report_id` varchar(255) DEFAULT NULL COMMENT '当前运行时对应的报告id', + `agent_list` json DEFAULT NULL COMMENT '场景绑定的压测机id列表', + `scene_env` int(11) NOT NULL DEFAULT '0' COMMENT '场景环境', + `ref_dataset_ids` text DEFAULT NULL COMMENT '真正引用的数据集id', + `tenant` varchar(255) DEFAULT NULL COMMENT '租户信息\n', + `bench_count` int(11) NOT NULL DEFAULT '0' COMMENT '压测次数', + `scene_source` int(11) NOT NULL DEFAULT '0' COMMENT '场景来源 0:控制台创建 1:openapi创建', + `person_in_charge` json DEFAULT NULL COMMENT '场景负责人', + `last_bench_time` bigint(64) NOT NULL DEFAULT '0' COMMENT '上次压测时间', + `bench_calendar` json DEFAULT NULL COMMENT '压测日历', + `global_tsp_auth` json DEFAULT NULL COMMENT '全局tsp验证信息', + PRIMARY KEY (`id`), + KEY `uk_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90001; + +CREATE TABLE `scene_snapshot` +( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id', + `scene_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '场景id', + `snapshot_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'snapshot id', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `create_by` varchar(64) DEFAULT '' COMMENT '创建人用户名', + `version` int(10) unsigned DEFAULT '0' COMMENT '场景配置版本', + `md5` varchar(64) NOT NULL DEFAULT '', + `scene` longtext DEFAULT NULL COMMENT '场景配置', + `type` int(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `scene_snapshot_id_uindex` (`snapshot_id`), + KEY `scene_snapshot_scene_index` (`scene_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=90001 COMMENT='压测配置快照'; + +CREATE TABLE `serial_link` +( + `id` int(32) NOT NULL AUTO_INCREMENT COMMENT '串联链路id', + `name` varchar(255) NOT NULL COMMENT '串联链路名', + `scene_id` int(32) NOT NULL COMMENT '所属场景id', + `enable` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否启用', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90001; + +CREATE TABLE `sla` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `note` varchar(128) DEFAULT NULL, + `business_group` varchar(128) DEFAULT NULL, + `ctime` bigint(64) DEFAULT NULL, + `utime` bigint(64) DEFAULT NULL, + `creator` varchar(128) DEFAULT NULL, + `updater` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `k_creator` (`creator`), + KEY `k_ctime` (`ctime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=90003; + +CREATE TABLE `sla_rule` +( + `id` int(32) NOT NULL AUTO_INCREMENT, + `sla_id` int(32) NOT NULL, + `name` varchar(128) DEFAULT NULL COMMENT '规则名称', + `rule_item_type` varchar(128) DEFAULT NULL COMMENT '指标类型', + `rule_item` varchar(128) DEFAULT NULL COMMENT '指标名', + `compare_condition` varchar(128) NOT NULL DEFAULT '' COMMENT '对比条件', + `compare_value` int(32) DEFAULT NULL, + `degree` int(32) DEFAULT NULL, + `action_level` varchar(128) DEFAULT NULL, + `ctime` bigint(64) DEFAULT NULL, + `utime` bigint(64) DEFAULT NULL, + `creator` varchar(128) DEFAULT NULL, + `updater` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `k_sla_id` (`sla_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=90003; \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/test/java/run/mone/mimeter/dashboard/service/common/UtilityTest.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/test/java/run/mone/mimeter/dashboard/service/common/UtilityTest.java new file mode 100644 index 000000000..338a90a10 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-server/src/test/java/run/mone/mimeter/dashboard/service/common/UtilityTest.java @@ -0,0 +1,50 @@ +package run.mone.mimeter.dashboard.service.common; + +import org.junit.Ignore; +import org.junit.Test; +import run.mone.mimeter.dashboard.common.util.FileUtils; +import run.mone.mimeter.dashboard.common.util.Utility; + +import java.util.List; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +@Ignore +public class UtilityTest { + + @Test + public void testGenId() { + System.out.println(Utility.generateId(23439L)); + } + + @Test + public void rehashSalt() { + System.out.println(Utility.rehashSalt(-23439L, 2)); + } + + @Test + public void saltVersionedId() { + System.out.println(Utility.saltVersionedId(99439345L, 999)); + } + + @Test + public void generateSha256() { + System.out.println(Utility.generateSha256("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")); + } + + @Test + public void castTest() { + Object val = 1; + System.out.println(((Integer)val).longValue()); + } + + @Test + public void csvTest() { + String str = "a,\"a,b\",c"; + List lists = FileUtils.parseCsv(str); + System.out.println(1); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/pom.xml b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/pom.xml new file mode 100644 index 000000000..846fdf03c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/pom.xml @@ -0,0 +1,301 @@ + + + + mimeter-dashboard + run.mone + 1.0.0-SNAPSHOT + + 4.0.0 + + mimeter-dashboard-service + + + + + org.springframework.boot + spring-boot-starter-web + 2.2.2.RELEASE + + + + org.springframework.boot + spring-boot-starter-test + 2.2.2.RELEASE + + + + org.springframework + spring-beans + 5.2.0.RELEASE + + + + org.springframework + spring-core + 5.2.0.RELEASE + + + + org.springframework + spring-context + 5.2.0.RELEASE + + + + org.springframework + spring-test + 5.2.0.RELEASE + + + + com.xiaomi.mone + http-docs-core + 2.7.12-mone-v5-SNAPSHOT + + + + com.xiaomi.faas + hera-api-dubboapi + 1.0.3 + + + + com.xiaomi.youpin + tesla-k8s-proxy-api + 1.0.0-SNAPSHOT + + + + com.xiaomi.mone + mimonitor-api + 1.0-SNAPSHOT + + + + com.xiaomi.youpin + coloregg + 1.4-SNAPSHOT + + + + com.xiaomi.youpin + aop + 1.4-SNAPSHOT + + + + com.xiaomi.youpin + common + 1.7-SNAPSHOT + + + + org.springframework + spring-jdbc + 5.2.0.RELEASE + + + + mimeter-dashboard-api + run.mone + 1.0.0-SNAPSHOT + + + + mimeter-dashboard-common + run.mone + 1.0.0-SNAPSHOT + + + + org.apache.dubbo + dubbo + 2.7.12-mone-v14-SNAPSHOT + + + + + com.xiaomi.youpin + feishu + 1.4-SNAPSHOT + + + org.mybatis.generator + mybatis-generator-core + 1.3.5 + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.0 + + + com.mchange + c3p0 + 0.9.5.2 + + + + mysql + mysql-connector-java + 5.1.40 + + + + com.xiaomi.mone + mi-tpc-api + 1.0.0-SNAPSHOT + + + com.alibaba.nacos + nacos-spring-context + 0.3.6-mone-SNAPSHOT + + + spring-context + org.springframework + + + com.alibaba + fastjson + + + spring-context-support + com.alibaba.spring + + + + + + com.alibaba.nacos + nacos-client + 1.2.1-mone-v5-SNAPSHOT + + + commons-io + commons-io + + + + + + com.xiaomi.mone + dubbo-docs-core + 2.7.12-mone-v5-SNAPSHOT + + + dubbo + org.apache.dubbo + + + + + + com.xiaomi.youpin + nacos + 1.4-SNAPSHOT + + + + com.xiaomi.infosec + aegis-java-sdk + 2.3.2 + + + + com.xiaomi.miapi + mi-api-api + 1.0.0-SNAPSHOT + + + com.xiaomi.mone + dubbo-docs-core + + + + + + com.xiaomi.youpin + ks3 + 1.4-SNAPSHOT + compile + + + + org.apache.httpcomponents + httpmime + 4.5.5 + + + + com.xiaomi.youpin + 1.0.0-SNAPSHOT + tesla-traffic-recording-api + + + + com.xiaomi.youpin + 0.0.1-SNAPSHOT + gateway-api + + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + 7.6.2 + + + + org.elasticsearch + elasticsearch + 7.6.2 + + + + run.mone + es + 1.4-SNAPSHOT + + + + com.opencsv + opencsv + 4.4 + + + + com.xiaomi.infra + rocketmq-client-java + 1.0.1-RELEASE + + + + com.xiaomi.youpin + rmq-swimlane-aspect + 1.0.0-SNAPSHOT + + + + run.mone + umami + 1.4-SNAPSHOT + + + org.slf4j + slf4j-log4j12 + + + + + + mi-tpclogin-sdk + run.mone + 1.0.0-SNAPSHOT + + + + + + \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ChangeQpsReq.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ChangeQpsReq.java new file mode 100644 index 000000000..b1eb23f49 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ChangeQpsReq.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.task.DagTaskRps; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ChangeQpsReq implements Serializable { + + Integer rpsRate; + + List dagTaskRpsList; + + public ChangeQpsReq() { + } + + public ChangeQpsReq(List dagTaskRpsList) { + this.dagTaskRpsList = dagTaskRpsList; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboSceneDebugResult.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboSceneDebugResult.java new file mode 100644 index 000000000..f303515f6 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboSceneDebugResult.java @@ -0,0 +1,51 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DubboSceneDebugResult implements Serializable { + + private boolean parentTask; + + private Integer id; + + private Integer sceneId; + + private String apiName; + + private String serviceName; + + private String methodName; + + private String group; + + private String version; + + private Integer apiOrder; + + private Integer requestTimeout; + + private String paramsTypeList; + + private String requestBody; + + private String triggerCpInfo; + + private String debugTriggerFilterCondition; + + private String debugResult; + + private Integer taskStatus; + + private String realParam; + + private boolean ok; + + private long rt; + + //bytes + private long size; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboService.java new file mode 100644 index 000000000..7f5a0f8fb --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboService.java @@ -0,0 +1,9 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +@Data +public class DubboService { + private String name; + private Integer healthyInstanceCount; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboServiceList.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboServiceList.java new file mode 100644 index 000000000..dba839f15 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/DubboServiceList.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +import java.util.List; + +@Data +public class DubboServiceList { + private List serviceList; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/HttpSceneDebugResult.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/HttpSceneDebugResult.java new file mode 100644 index 000000000..be1fda4ec --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/HttpSceneDebugResult.java @@ -0,0 +1,57 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HttpSceneDebugResult implements Serializable { + + private boolean parentTask; + + private Integer id; + + private Integer sceneId; + + private String apiName; + + private String apiUrl; + + private Integer apiOrder; + + private Integer requestMethod; + + private Integer requestTimeout; + + private String contentType; + + private String apiHeader; + + private Integer reqParamType; + + private String requestParamInfo; + + private String outputParamInfo; + + private String requestBody; + + private String respHeader; + + private String triggerCpInfo; + + private String debugTriggerFilterCondition; + + private String debugResult; + + private Integer taskStatus; + + private String realParam; + + private boolean ok; + + private long rt; + + //bytes + private long size; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/MetricsValue.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/MetricsValue.java new file mode 100644 index 000000000..811f52071 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/MetricsValue.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/19 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MetricsValue { + + private Long ts; + + private Double value; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosInfo.java new file mode 100644 index 000000000..ae4cb936c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosInfo.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +@Data +public class NacosInfo { + private String usernameSt; + private String passwordSt; + + private String usernameOl; + private String passwordOl; + + + public NacosInfo(String usernameSt, String passwordSt, String usernameOl, String passwordOl) { + this.usernameSt = usernameSt; + this.passwordSt = passwordSt; + this.usernameOl = usernameOl; + this.passwordOl = passwordOl; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosLoginInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosLoginInfo.java new file mode 100644 index 000000000..3831ef3ce --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/NacosLoginInfo.java @@ -0,0 +1,8 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +@Data +public class NacosLoginInfo { + private String accessToken; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ReportEmitterData.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ReportEmitterData.java new file mode 100644 index 000000000..553d578a2 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/ReportEmitterData.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/30 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ReportEmitterData { + + /** + * EmitterTypeEnum + */ + private String type; + + /** + * create time + */ + private Long ts; + + /** + * json data point + */ + private String data; + + /** + * used for machine node or api + */ + private String node; + + private String extra; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SceneNameDTO.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SceneNameDTO.java new file mode 100644 index 000000000..9508833e0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SceneNameDTO.java @@ -0,0 +1,10 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SceneNameDTO implements Serializable { + String name; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SubmitTaskRes.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SubmitTaskRes.java new file mode 100644 index 000000000..482553fd1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/SubmitTaskRes.java @@ -0,0 +1,27 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; +import run.mone.mimeter.dashboard.bo.task.DagTaskRps; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class SubmitTaskRes implements Serializable { + private String reportId; + private TaskResult taskResult; + + /** + * 链路id与生成的dag 任务id映射 + */ + private Map linkTaskIdMap; + private List agentIpList; + + public SubmitTaskRes(String reportId, TaskResult taskResult, Map linkTaskIdMap, List agentIpList) { + this.reportId = reportId; + this.taskResult = taskResult; + this.linkTaskIdMap = linkTaskIdMap; + this.agentIpList = agentIpList; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/TaskResult.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/TaskResult.java new file mode 100644 index 000000000..0045dba5f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/TaskResult.java @@ -0,0 +1,33 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class TaskResult implements Serializable { + /** + * 任务id + */ + private int id; + + private int code; + + private String result; + + private boolean ok; + + /** + * 返回的header + */ + private Map respHeaders; + + private String triggerCpInfo; + + private long rt; + + //bytes + private long size; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/UserInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/UserInfo.java new file mode 100644 index 000000000..dcb457ad1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/bo/UserInfo.java @@ -0,0 +1,19 @@ +package run.mone.mimeter.dashboard.bo; + +import lombok.Data; + +@Data +public class UserInfo { + private String fullAccount;// + private String username;//用户账号 + private String name;//名称 + private String displayName;//展示名称 + private String departmentName;//部门 + private String firstDepartment;//一级部门(用于区分用户空间) + private String secondDepartment;//二级部门(用于区分用户空间) + private String email;//邮箱 + private String miID;//米id + private String avatar;//头像图片 + private boolean admin; + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/CheckResult.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/CheckResult.java new file mode 100644 index 000000000..abbad7719 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/CheckResult.java @@ -0,0 +1,54 @@ +package run.mone.mimeter.dashboard.common; + +/** + * 用于封装检查结果 + */ +public class CheckResult { + private boolean valid; + + private int code; + + private String msg; + + + public CheckResult(boolean valid, int code, String msg) { + this.valid = valid; + this.code = code; + this.msg = msg; + } + + + public boolean isValid() { + return valid; + } + + public void setValid(boolean valid) { + this.valid = valid; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + + @Override + public String toString() { + return "CheckResult{" + + "valid=" + valid + + ", code=" + code + + ", msg='" + msg + '\'' + + '}'; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/DubboParamItem.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/DubboParamItem.java new file mode 100644 index 000000000..e9c6f7d3c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/DubboParamItem.java @@ -0,0 +1,18 @@ +package run.mone.mimeter.dashboard.common; + +import lombok.Data; + +import java.lang.reflect.Type; +import java.util.List; + +@Data +public class DubboParamItem { + private Class itemClass; + private Type itemType; + + private String itemName; + private String itemClassStr; + private String defaultValue; + private String exampleValue; + private List itemValue; +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpDao.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpDao.java new file mode 100644 index 000000000..d89fbcad3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpDao.java @@ -0,0 +1,265 @@ +package run.mone.mimeter.dashboard.common; + +import com.google.gson.Gson; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.exception.CommonException; +import org.apache.http.HttpEntity; +import org.apache.http.HttpStatus; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Repository; + +import javax.annotation.PostConstruct; +import java.io.File; +import java.io.IOException; +import java.util.Map; + +@Repository +public class HttpDao { + + private static final Logger LOGGER = LoggerFactory.getLogger(HttpDao.class); + + private static final Gson gson = Util.getGson(); + + private RequestConfig requestConfig; + + @PostConstruct + public void init() { + requestConfig = RequestConfig.custom() + .setSocketTimeout(20000) + .setConnectTimeout(15000) + .setConnectionRequestTimeout(20000) + .build(); + } + + public HttpResult get(String url, Map params) { + Gson gson = new Gson(); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + + + HttpResult result = null; + + try { + URIBuilder uriBuilder = new URIBuilder(url); + for(Map.Entry entry : params.entrySet()) { + uriBuilder.setParameter(entry.getKey(), entry.getValue()); + } + + HttpGet request = new HttpGet(uriBuilder.build().toASCIIString()); + request.setHeader("Content-Type", "application/json"); + request.setHeader("Accept", "application/json"); + request.setConfig(requestConfig); + + response = httpClient.execute(request); + + int state = response.getStatusLine().getStatusCode(); + if (state != HttpStatus.SC_OK) { + LOGGER.error("[HttpDao.get]: failed to request: {}, params: {} response status: {}", + url, params, state); + return null; + } + + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + LOGGER.debug("[HttpDao.get] response: {}", responseContent); + result = gson.fromJson(responseContent, HttpResult.class); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + return result; + } + + public HttpResult post(String url, String paramJson) throws Exception{ + HttpResult result = null; + + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + try { + URIBuilder uriBuilder = new URIBuilder(url); + + HttpPost request = new HttpPost(uriBuilder.build().toASCIIString()); + request.setHeader("Content-Type", "application/json"); + request.setHeader("Accept", "application/json"); + request.setConfig(requestConfig); + + StringEntity requestEntity = new StringEntity(paramJson, "UTF-8"); + request.setEntity(requestEntity); + + + response = httpClient.execute(request); + + int state = response.getStatusLine().getStatusCode(); + if (state != HttpStatus.SC_OK) { + LOGGER.error("[HttpDao.post]: failed to request: {}, params: {} response status: {}", + url, paramJson, state); + throw new CommonException(CommonError.APIServerError.code, "请求API服务失败:" + state); + } + + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + result = gson.fromJson(responseContent, HttpResult.class); + } catch (Exception e) { + LOGGER.error("http call error,err:{}",e.getMessage()); + throw e; + } finally { + try { + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + LOGGER.error("http call error,err:{}",e.getMessage()); + throw e; + } + } + + return result; + } + + public HttpResult postWithUpload(String url, Map params, String path) { + Gson gson = new Gson(); + HttpResult result = null; + LOGGER.debug("path:{}", path); + + File file = new File(path); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + try { + URIBuilder uriBuilder = new URIBuilder(url); + + HttpPost request = new HttpPost(uriBuilder.build().toASCIIString()); +// request.setHeader("Content-Type", "multipart/form-data"); + request.setHeader("Accept", "application/json"); + request.setConfig(requestConfig); + + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + builder.addBinaryBody("fileData", file, ContentType.DEFAULT_BINARY, path); + for(Map.Entry entry : params.entrySet()) { + builder.addTextBody(entry.getKey(), entry.getValue(), ContentType.TEXT_PLAIN.withCharset("UTF-8")); + } + HttpEntity requestEntity = builder.build(); + request.setEntity(requestEntity); + + + response = httpClient.execute(request); + + int state = response.getStatusLine().getStatusCode(); + if (state != HttpStatus.SC_OK) { + LOGGER.error("[HttpDao.postWithUpload]: failed to request: {}, params: {}, file path: {}, response status: {}", + url, params, path, state); + throw new CommonException(CommonError.APIServerError.code, "请求API服务失败:" + state); + } + + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + result = gson.fromJson(responseContent, HttpResult.class); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + return result; + } + + public HttpResult delete(String url, Map params) { + Gson gson = new Gson(); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + + + HttpResult result = null; + + try { + URIBuilder uriBuilder = new URIBuilder(url); + for(Map.Entry entry : params.entrySet()) { + uriBuilder.setParameter(entry.getKey(), entry.getValue()); + } + + HttpDelete request = new HttpDelete(uriBuilder.build().toASCIIString()); + request.setHeader("Content-Type", "application/json"); + request.setHeader("Accept", "application/json"); + request.setConfig(requestConfig); + + response = httpClient.execute(request); + + int state = response.getStatusLine().getStatusCode(); + if (state != HttpStatus.SC_OK) { + LOGGER.error("[HttpDao.delete]: failed to request: {}, params: {} response status: {}", + url, params, state); + return null; + } + + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + LOGGER.debug("[HttpDao.delete] response: {}", responseContent); + result = gson.fromJson(responseContent, HttpResult.class); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + return result; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpResult.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpResult.java new file mode 100644 index 000000000..d416d87fc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/HttpResult.java @@ -0,0 +1,71 @@ +package run.mone.mimeter.dashboard.common; + +import java.util.Objects; + +public class HttpResult { + private int code; + + private String data; + + private String message; + + private String method; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + @Override + public String toString() { + return "HttpResult{" + + "code=" + code + + ", data='" + data + '\'' + + ", message='" + message + '\'' + + ", method='" + method + '\'' + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + HttpResult that = (HttpResult) o; + return code == that.code && + Objects.equals(data, that.data) && + Objects.equals(message, that.message) && + Objects.equals(method, that.method); + } + + @Override + public int hashCode() { + return Objects.hash(code, data, message, method); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SceneSource.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SceneSource.java new file mode 100644 index 000000000..87cc50521 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SceneSource.java @@ -0,0 +1,15 @@ +package run.mone.mimeter.dashboard.common; + + +public enum SceneSource { + + CONSOLE(0), + OPEN_API(1); + + + public final int code; + + private SceneSource(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SessionAccount.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SessionAccount.java new file mode 100644 index 000000000..0a6288da5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/SessionAccount.java @@ -0,0 +1,48 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.common; + +import lombok.Data; + +@Data +public class SessionAccount { + + private String username; + + private String name; + + private String email; + + private String tenant; + + private boolean admin; + + private String idPath; + + + public SessionAccount() { + } + + public SessionAccount(String username, String name, Boolean admin, String idPath) { + this.username = username; + this.name = name; + this.admin = admin; + this.idPath = idPath; + this.tenant = idPath; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskStatus.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskStatus.java new file mode 100644 index 000000000..4bb78176a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskStatus.java @@ -0,0 +1,18 @@ +package run.mone.mimeter.dashboard.common; + +public enum TaskStatus { + Init(0), + Success(1), + Failure(2), + Retry(3), + Running(4), + STOPPED(5), + + ; + + public int code; + + private TaskStatus(int code) { + this.code = code; + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskType.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskType.java new file mode 100644 index 000000000..a0a549aec --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/TaskType.java @@ -0,0 +1,20 @@ +package run.mone.mimeter.dashboard.common; + +/** + * @author goodjava@qq.com + * @date 2022/5/19 + */ +public enum TaskType { + + http(1), + dubbo(2), + dag(3), + demo(4); + + + public int code; + + private TaskType(int code) { + this.code = code; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/BizUtils.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/BizUtils.java new file mode 100644 index 000000000..a07881cb7 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/BizUtils.java @@ -0,0 +1,120 @@ +package run.mone.mimeter.dashboard.common.util; + +import run.mone.mimeter.dashboard.bo.sceneapi.OutputOriginEnum; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneApiOutputParam; + +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static run.mone.mimeter.dashboard.bo.common.Constants.*; + +public final class BizUtils { + private BizUtils() { + } + + private static final Pattern EL_PATTERN = Pattern.compile("\\{([^}]*)}"); + + /** + * 处理转换出参定义表达式 + * + * @param outputParams + */ + public static void processOutputParamExpr(List outputParams) { + for (SceneApiOutputParam outputParam : + outputParams) { + if (outputParam.getOrigin() == OutputOriginEnum.BODY_TXT.code) { + continue; + } + //已转换过表达式 + if (outputParam.getParseExpr().contains(DEFAULT_EXPR_PREX) || outputParam.getParseExpr().contains(DEFAULT_EXPR_JSON_PREX)){ + continue; + } + if (outputParam.getOriginParseExpr() == null) { + outputParam.setOriginParseExpr(outputParam.getParseExpr()); + } + + if (outputParam.getParseExpr().contains(EXPR_INT_FLAG)) { + //值为整型 + outputParam.setOriginParseExpr(outputParam.getParseExpr()); + + StringBuilder realExpr = new StringBuilder(DEFAULT_EXPR_JSON_PREX); + Matcher m = EL_PATTERN.matcher(outputParam.getParseExpr()); + + while (m.find()) { + String innerKey = m.group(1); + if (innerKey.contains(EXPR_INT_FLAG)) { + //目标字段 + String k = innerKey.substring(0, innerKey.indexOf(":")); + realExpr.append(".get(").append(k).append(").getAsInt()"); + } else { + realExpr.append(".get(").append(innerKey).append(")"); + } + } + outputParam.setParseExpr(realExpr.toString()); + } else if (outputParam.getParseExpr().contains(EXPR_STRING_FLAG)) { + //转为字符串 + outputParam.setOriginParseExpr(outputParam.getParseExpr()); + + StringBuilder realExpr = new StringBuilder(DEFAULT_EXPR_JSON_PREX); + Matcher m = EL_PATTERN.matcher(outputParam.getParseExpr()); + + while (m.find()) { + String innerKey = m.group(1); + if (innerKey.contains(EXPR_STRING_FLAG)) { + //目标字段 + String k = innerKey.substring(0, innerKey.indexOf(":")); + realExpr.append(".get(").append(k).append(").getAsString()"); + } else { + realExpr.append(".get(").append(innerKey).append(")"); + } + } + outputParam.setParseExpr(realExpr.toString()); + } else if (outputParam.getParseExpr().contains(EXPR_LIST_FLAG)) { + outputParam.setOriginParseExpr(outputParam.getParseExpr()); + + StringBuilder realExpr = new StringBuilder(DEFAULT_EXPR_JSON_PREX); + Matcher m = EL_PATTERN.matcher(outputParam.getParseExpr()); + + while (m.find()) { + String innerKey = m.group(1); + if (innerKey.contains(EXPR_LIST_FLAG)) { + //目标字段 + //{data}{goodIds::list[0].string} + //turn to params.json().get(data).get(goodIds)|0.string + String k = innerKey.substring(0, innerKey.indexOf(":")); + String index = innerKey.substring(innerKey.indexOf('[') + 1, innerKey.lastIndexOf(']')); + realExpr.append(".get(").append(k).append(")|").append(index); + if (innerKey.contains(".")){ + String valType = innerKey.substring(innerKey.indexOf(".")+1); + realExpr.append(".").append(valType); + } + } else { + realExpr.append(".get(").append(innerKey).append(")"); + } + } + outputParam.setParseExpr(realExpr.toString()); + } else if (outputParam.getParseExpr().contains(EXPR_BOOLEAN_FLAG)) { + //转为布尔值 + outputParam.setOriginParseExpr(outputParam.getParseExpr()); + + StringBuilder realExpr = new StringBuilder(DEFAULT_EXPR_JSON_PREX); + Matcher m = EL_PATTERN.matcher(outputParam.getParseExpr()); + + while (m.find()) { + String innerKey = m.group(1); + if (innerKey.contains(EXPR_BOOLEAN_FLAG)) { + //目标字段 + String k = innerKey.substring(0, innerKey.indexOf(":")); + realExpr.append(".get(").append(k).append(").getAsBoolean()"); + } else { + realExpr.append(".get(").append(innerKey).append(")"); + } + } + outputParam.setParseExpr(realExpr.toString()); + } else { + outputParam.setParseExpr(DEFAULT_EXPR_PREX + outputParam.getParseExpr()); + } + } + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/DubboParamUtils.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/DubboParamUtils.java new file mode 100644 index 000000000..4eb10f008 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/DubboParamUtils.java @@ -0,0 +1,109 @@ +package run.mone.mimeter.dashboard.common.util; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import run.mone.mimeter.dashboard.common.DubboParamItem; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.*; + +import static com.xiaomi.mone.http.docs.core.Constants.*; + +@Slf4j +public class DubboParamUtils { + + public static Object initWithDefaultValue(List layerItems) { + try { + List reqList = new ArrayList<>(); + if (!layerItems.isEmpty()){ + layerItems.forEach(layerItem -> reqList.add(initWithDefaultValue0(layerItem))); + } + return reqList; + } catch (Exception e) { + log.warn("DubboParamUtils.initWithDefaultValue, error msg: " + e.getMessage()); + return EMPTY_OBJECT_INSTANCE; + } + } + + private static Object initWithDefaultValue(DubboParamItem layerItem) { + try { + return initWithDefaultValue0(layerItem); + } catch (Exception e) { + log.warn("DubboParamUtils.initWithDefaultValue, error msg: " + e.getMessage()); + return EMPTY_OBJECT_INSTANCE; + } + } + + private static Object initWithDefaultValue0(DubboParamItem layerItem) { + Class classType = layerItem.getItemClass(); + String defaultValue = layerItem.getDefaultValue(); + if (Integer.class.isAssignableFrom(classType) || int.class.isAssignableFrom(classType)) { + return (StringUtils.isEmpty(defaultValue) || !NumberUtils.isDigits(defaultValue)) ? 0 : Integer.valueOf(defaultValue); + } else if (Byte.class.isAssignableFrom(classType) || byte.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? (byte) 0 : defaultValue; + } else if (Long.class.isAssignableFrom(classType) || long.class.isAssignableFrom(classType)) { + return (StringUtils.isEmpty(defaultValue) || !NumberUtils.isDigits(defaultValue)) ? 0L : Long.valueOf(defaultValue); + } else if (Double.class.isAssignableFrom(classType) || double.class.isAssignableFrom(classType)) { + return (StringUtils.isEmpty(defaultValue) || !NumberUtils.isNumber(defaultValue)) ? 0.0D : Double.valueOf(defaultValue); + } else if (Float.class.isAssignableFrom(classType) || float.class.isAssignableFrom(classType)) { + return (StringUtils.isEmpty(defaultValue) || !NumberUtils.isNumber(defaultValue)) ? 0.0F : Float.valueOf(defaultValue); + } else if (String.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) + ? (StringUtils.isEmpty(layerItem.getExampleValue()) ? "demoString" : layerItem.getExampleValue()) + : defaultValue; + } else if (Character.class.isAssignableFrom(classType) || char.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? 'c' : defaultValue; + } else if (Short.class.isAssignableFrom(classType) || short.class.isAssignableFrom(classType)) { + return (StringUtils.isEmpty(defaultValue) || !NumberUtils.isDigits(defaultValue)) ? (short) 0 : Short.valueOf(defaultValue); + } else if (Boolean.class.isAssignableFrom(classType) || boolean.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? false : Boolean.valueOf(defaultValue); + } else if (Date.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? "【" + Date.class.getName() + "】yyyy-MM-dd HH:mm:ss" : defaultValue; + } else if (LocalDate.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? "【" + LocalDate.class.getName() + "】yyyy-MM-dd" : defaultValue; + } else if (LocalDateTime.class.isAssignableFrom(classType)) { + return StringUtils.isEmpty(defaultValue) ? "【" + LocalDateTime.class.getName() + "】yyyy-MM-dd HH:mm:ss" : defaultValue; + } else if (BigDecimal.class.isAssignableFrom(classType)) { + return 0; + } else if (BigInteger.class.isAssignableFrom(classType)) { + return 0; + } else if (Enum.class.isAssignableFrom(classType)) { + Object[] enumConstants = classType.getEnumConstants(); + StringBuilder sb = new StringBuilder(ENUM_VALUES_SEPARATOR); + try { + Method getName = classType.getMethod(METHOD_NAME_NAME); + for (Object obj : enumConstants) { + sb.append(getName.invoke(obj)).append(ENUM_VALUES_SEPARATOR); + } + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + log.error(e.getMessage(), e); + } + return sb.toString(); + } else if (Map.class.isAssignableFrom(classType)) { + Map resMap = new HashMap<>(); + resMap.put(initWithDefaultValue(layerItem.getItemValue().get(0)), initWithDefaultValue(layerItem.getItemValue().get(1))); + return resMap; + } else if (classType.isArray() || Collection.class.isAssignableFrom(classType)) { + List resList = new ArrayList<>(); + resList.add(initWithDefaultValue(layerItem.getItemValue().get(0))); + return resList; + } else { + if (layerItem.getItemValue() == null) { + return EMPTY_OBJECT_INSTANCE; + } + + Map res = new HashMap<>(); + for (DubboParamItem perLayerItem : layerItem.getItemValue()) { + res.put(perLayerItem.getItemName(), initWithDefaultValue(perLayerItem)); + } + return res; + } + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/FileUtils.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/FileUtils.java new file mode 100644 index 000000000..d6fefc593 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/FileUtils.java @@ -0,0 +1,180 @@ +package run.mone.mimeter.dashboard.common.util; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author dingpei + * @date 2022-07-18 + */ +public class FileUtils { + + public static final HashMap mFileTypes = new HashMap(); + + static { + // images + mFileTypes.put("FFD8FF", "jpg"); + mFileTypes.put("89504E47", "png"); + mFileTypes.put("47494638", "gif"); + mFileTypes.put("49492A00", "tif"); + mFileTypes.put("424D", "bmp"); + /*CAD*/ + mFileTypes.put("41433130", "dwg"); + mFileTypes.put("38425053", "psd"); + /* 日记本 */ + mFileTypes.put("7B5C727466", "rtf"); + mFileTypes.put("3C3F786D6C", "xml"); + mFileTypes.put("68746D6C3E", "html"); + // 邮件 + mFileTypes.put("44656C69766572792D646174653A", "eml"); + mFileTypes.put("D0CF11E0", "doc"); + //excel2003版本文件 + mFileTypes.put("D0CF11E0", "xls"); + mFileTypes.put("5374616E64617264204A", "mdb"); + mFileTypes.put("252150532D41646F6265", "ps"); + mFileTypes.put("25504446", "pdf"); + mFileTypes.put("504B0304", "docx"); + //excel2007以上版本文件 + mFileTypes.put("504B0304", "xlsx"); + mFileTypes.put("52617221", "rar"); + mFileTypes.put("57415645", "wav"); + mFileTypes.put("41564920", "avi"); + mFileTypes.put("2E524D46", "rm"); + mFileTypes.put("000001BA", "mpg"); + mFileTypes.put("000001B3", "mpg"); + mFileTypes.put("6D6F6F76", "mov"); + mFileTypes.put("3026B2758E66CF11", "asf"); + mFileTypes.put("4D546864", "mid"); + mFileTypes.put("1F8B08", "gz"); + } + + /** + *

Title:getFileType

+ *

Description: 根据文件路径获取文件头信息

+ * + * @param filePath 文件路径(非网络文件) + * @return 文件头信息 + */ + public static String getFileType(String filePath) { + //返回十六进制 如:504B0304 + return mFileTypes.get(getFileHeader(filePath)); + } + + /** + *

Title:getFileTypeByFileInputStream

+ *

Description: 根据文件流获取文件头信息

+ * + * @param is 文件流 + * @return 文件头信息 + */ + public static String getFileTypeByFileInputStream(InputStream is) { + return mFileTypes.get(getFileHeaderByFileInputStream(is)); + } + + /** + *

Title:getFileHeader

+ *

Description: 根据文件路径获取文件头信息

+ * + * @param filePath 文件路径 + * @return 十六进制文件头信息 + */ + private static String getFileHeader(String filePath) { + FileInputStream is = null; + String value = null; + try { + is = new FileInputStream(filePath); + byte[] b = new byte[4]; + /* + * int read() 从此输入流中读取一个数据字节。int read(byte[] b) 从此输入流中将最多 b.length + * 个字节的数据读入一个 byte 数组中。 int read(byte[] b, int off, int len) + * 从此输入流中将最多 len 个字节的数据读入一个 byte 数组中。 + */ + is.read(b, 0, b.length); + value = bytesToHexString(b); + } catch (Exception e) { + } finally { + if (null != is) { + try { + is.close(); + } catch (IOException e) { + } + } + } + return value; + } + + /** + *

Title:getFileHeaderByFileInputStream

+ *

Description: 根据文件流获取文件头信息

+ * + * @param is 文件流 + * @return 十六进制文件头信息 + */ + private static String getFileHeaderByFileInputStream(InputStream is) { + String value = null; + try { + byte[] b = new byte[4]; + /* + * int read() 从此输入流中读取一个数据字节。int read(byte[] b) 从此输入流中将最多 b.length + * 个字节的数据读入一个 byte 数组中。 int read(byte[] b, int off, int len) + * 从此输入流中将最多 len 个字节的数据读入一个 byte 数组中。 + */ + is.read(b, 0, b.length); + value = bytesToHexString(b); + } catch (Exception e) { + } finally { + if (null != is) { + try { + is.close(); + } catch (IOException e) { + } + } + } + return value; + } + + /** + *

Title:bytesToHexString

+ *

Description: 将要读取文件头信息的文件的byte数组转换成string类型表示

+ * + * @param src 要读取文件头信息的文件的byte数组 + * @return 文件头信息 + */ + private static String bytesToHexString(byte[] src) { + StringBuilder builder = new StringBuilder(); + if (src == null || src.length <= 0) { + return null; + } + String hv; + for (int i = 0; i < src.length; i++) { + // 以十六进制(基数 16)无符号整数形式返回一个整数参数的字符串表示形式,并转换为大写 + hv = Integer.toHexString(src[i] & 0xFF).toUpperCase(); + if (hv.length() < 2) { + builder.append(0); + } + builder.append(hv); + } + //System.out.println(builder.toString()); + return builder.toString(); + } + + public static List parseCsv(String line) { + Pattern pattern = Pattern.compile("[^,\"]+|,,|(?:\"[^,\"]*\"[^\"]*\"[^\"]*)\"|\"(?:[^\"])*\""); + + List list = new ArrayList<>(); + + Matcher matcher = pattern.matcher(line); + while (matcher.find()) { + String cell = matcher.group(); + list.add(cell); + } + return list; + } + +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/MapTypeAdapter.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/MapTypeAdapter.java new file mode 100644 index 000000000..91a536630 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/MapTypeAdapter.java @@ -0,0 +1,112 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.common.util; + +import com.google.gson.Gson; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.internal.LinkedTreeMap; +import com.google.gson.internal.bind.ObjectTypeAdapter; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public final class MapTypeAdapter extends TypeAdapter { + public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (type.getRawType() == Object.class) { + return (TypeAdapter) new MapTypeAdapter(gson); + } + return null; + } + }; + + private final Gson gson; + + private MapTypeAdapter(Gson gson) { + this.gson = gson; + } + + @Override + public Object read(JsonReader in) throws IOException { + JsonToken token = in.peek(); + //判断字符串的实际类型 + switch (token) { + case BEGIN_ARRAY: + List list = new ArrayList<>(); + in.beginArray(); + while (in.hasNext()) { + list.add(read(in)); + } + in.endArray(); + return list; + + case BEGIN_OBJECT: + Map map = new LinkedTreeMap<>(); + in.beginObject(); + while (in.hasNext()) { + map.put(in.nextName(), read(in)); + } + in.endObject(); + return map; + case STRING: + return in.nextString(); + case NUMBER: + String s = in.nextString(); + if (s.contains(".")) { + return Double.valueOf(s); + } else { + try { + return Integer.valueOf(s); + } catch (Exception e) { + return Long.valueOf(s); + } + } + case BOOLEAN: + return in.nextBoolean(); + case NULL: + in.nextNull(); + return null; + default: + throw new IllegalStateException(); + } + } + + @Override + public void write(JsonWriter out, Object value) throws IOException { + if (value == null) { + out.nullValue(); + return; + } + //noinspection unchecked + TypeAdapter typeAdapter = (TypeAdapter) gson.getAdapter(value.getClass()); + if (typeAdapter instanceof ObjectTypeAdapter) { + out.beginObject(); + out.endObject(); + return; + } + typeAdapter.write(out, value); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Util.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Util.java new file mode 100644 index 000000000..135840c1d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Util.java @@ -0,0 +1,36 @@ +package run.mone.mimeter.dashboard.common.util; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.internal.bind.ObjectTypeAdapter; + +import java.lang.reflect.Field; +import java.util.Collections; +import java.util.List; + +public class Util { + + public static Gson getGson() { + Gson gson = new GsonBuilder().create(); + try { + Field factories = Gson.class.getDeclaredField("factories"); + factories.setAccessible(true); + Object o = factories.get(gson); + Class[] declaredClasses = Collections.class.getDeclaredClasses(); + for (Class c : declaredClasses) { + if ("java.util.Collections$UnmodifiableList".equals(c.getName())) { + Field listField = c.getDeclaredField("list"); + listField.setAccessible(true); + List list = (List) listField.get(o); + int i = list.indexOf(ObjectTypeAdapter.FACTORY); + list.set(i, MapTypeAdapter.FACTORY); + break; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return gson; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Utility.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Utility.java new file mode 100644 index 000000000..d140890aa --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/common/util/Utility.java @@ -0,0 +1,93 @@ +package run.mone.mimeter.dashboard.common.util; + +import org.apache.commons.codec.digest.DigestUtils; +import run.mone.mimeter.dashboard.pojo.common.Pageable; + +import java.util.HashMap; +import java.util.Map; + +import static com.google.common.base.Preconditions.checkArgument; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +public class Utility { + + public static void handlePagination(Pageable example, Integer pageSize, Integer pageNo) { + if (pageSize == null) { + return; + } + example.setLimit(pageSize); + + if (pageNo != null) { + checkArgument(pageNo >= 1, "invalid pageNo " + pageNo); + example.setOffset((pageNo - 1L) * pageSize); + } + } + + public static String generateId() { + return generateId(0L); + } + + public static String generateId(Long salt) { + long ts = System.currentTimeMillis(); + long base10 = 0; + long prefix = salt == null ? 0L : rehashSalt(salt, 2); + long multiplier = 1; + + for (int i = 0; i < 11; i++) { + base10 += (ts % 10) * multiplier; + multiplier *= 10; + ts /= 10; + } + base10 += prefix * multiplier; + return Long.toString(base10, 36).toUpperCase(); + } + + public static int rehashSalt(Long salt, int bits) { + if (salt == null || salt == 0 || bits <= 0) { + return 0; + } + if (salt < 0) { + salt = -salt; + } + int result = 0; + + while (salt > 0) { + long val = 0; + int multiplier = 1; + + for (int i = 0; i < bits && salt > 0; i++) { + val += (salt % 10) * multiplier; + salt /= 10; + multiplier *= 10; + } + result += val; + } + return result % 100; + } + + public static String saltVersionedId(long salt, int version) { + checkArgument(version >= 0 && salt >= 0, "invalid version or salt"); + String str = String.format("%08d%02d%08d", rehashSalt(salt, 8), version, + rehashSalt(System.currentTimeMillis() / 1000, 8)); + return Long.toString(Long.parseLong(str), 36).toUpperCase(); + } + + public static String generateSha256(String originalString) { + return DigestUtils.sha256Hex(originalString); + } + + public static Map convertMapType(Map map1) { + Map dict = new HashMap<>(); + + map1.forEach((k, v) -> { + if (k != null && v != null) { + dict.put(k, v.intValue()); + } + }); + return dict; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/es/Es.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/es/Es.java new file mode 100644 index 000000000..76ce692cc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/es/Es.java @@ -0,0 +1,36 @@ +package run.mone.mimeter.dashboard.es; + +import com.xiaomi.mone.es.EsClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author dingpei + */ +@Slf4j +@Configuration +public class Es { + + @Value("${es.address}") + private String address; + + @Value("${es.user}") + private String user; + + @Value("${es.pwd}") + private String pwd; + + @Bean + public EsClient esClient() throws Exception { + try { + return new EsClient(address, user, pwd); + } catch (Exception e) { + log.error("Es.esClient error, address:{}, user:{}, pwd:{}, msg:{}", address, user, pwd, e.getMessage(), e); + throw new Exception(); + } + } + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentApplyInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentApplyInfoMapper.java new file mode 100644 index 000000000..e9906be62 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentApplyInfoMapper.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.AgentApplyInfo; +import run.mone.mimeter.dashboard.pojo.AgentApplyInfoExample; + +public interface AgentApplyInfoMapper { + long countByExample(AgentApplyInfoExample example); + + int deleteByExample(AgentApplyInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(AgentApplyInfo record); + + int insertSelective(AgentApplyInfo record); + + List selectByExample(AgentApplyInfoExample example); + + AgentApplyInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") AgentApplyInfo record, @Param("example") AgentApplyInfoExample example); + + int updateByExample(@Param("record") AgentApplyInfo record, @Param("example") AgentApplyInfoExample example); + + int updateByPrimaryKeySelective(AgentApplyInfo record); + + int updateByPrimaryKey(AgentApplyInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") AgentApplyInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentInfoMapper.java new file mode 100644 index 000000000..2473adbab --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/AgentInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.AgentInfo; +import run.mone.mimeter.dashboard.pojo.AgentInfoExample; + +public interface AgentInfoMapper { + long countByExample(AgentInfoExample example); + + int deleteByExample(AgentInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(AgentInfo record); + + int insertSelective(AgentInfo record); + + List selectByExampleWithBLOBs(AgentInfoExample example); + + List selectByExample(AgentInfoExample example); + + AgentInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") AgentInfo record, @Param("example") AgentInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") AgentInfo record, @Param("example") AgentInfoExample example); + + int updateByExample(@Param("record") AgentInfo record, @Param("example") AgentInfoExample example); + + int updateByPrimaryKeySelective(AgentInfo record); + + int updateByPrimaryKeyWithBLOBs(AgentInfo record); + + int updateByPrimaryKey(AgentInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") AgentInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ApiStatMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ApiStatMapper.java new file mode 100644 index 000000000..ae01a9084 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ApiStatMapper.java @@ -0,0 +1,39 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.ApiStat; +import run.mone.mimeter.dashboard.pojo.ApiStatExample; + +@Mapper +public interface ApiStatMapper { + long countByExample(ApiStatExample example); + + int deleteByExample(ApiStatExample example); + + int deleteByPrimaryKey(Long id); + + int insert(ApiStat record); + + int insertSelective(ApiStat record); + + List selectByExample(ApiStatExample example); + + ApiStat selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") ApiStat record, @Param("example") ApiStatExample example); + + int updateByExample(@Param("record") ApiStat record, @Param("example") ApiStatExample example); + + int updateByPrimaryKeySelective(ApiStat record); + + int updateByPrimaryKey(ApiStat record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiStat.Column ... selective); + + int saveAccumulative(ApiStat record); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/CheckPointInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/CheckPointInfoMapper.java new file mode 100644 index 000000000..3c95ae394 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/CheckPointInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.CheckPointInfo; +import run.mone.mimeter.dashboard.pojo.CheckPointInfoExample; + +public interface CheckPointInfoMapper { + long countByExample(CheckPointInfoExample example); + + int deleteByExample(CheckPointInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(CheckPointInfo record); + + int insertSelective(CheckPointInfo record); + + List selectByExampleWithBLOBs(CheckPointInfoExample example); + + List selectByExample(CheckPointInfoExample example); + + CheckPointInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") CheckPointInfo record, @Param("example") CheckPointInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") CheckPointInfo record, @Param("example") CheckPointInfoExample example); + + int updateByExample(@Param("record") CheckPointInfo record, @Param("example") CheckPointInfoExample example); + + int updateByPrimaryKeySelective(CheckPointInfo record); + + int updateByPrimaryKeyWithBLOBs(CheckPointInfo record); + + int updateByPrimaryKey(CheckPointInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CheckPointInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetMapper.java new file mode 100644 index 000000000..78d52557b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.Dataset; +import run.mone.mimeter.dashboard.pojo.DatasetExample; + +public interface DatasetMapper { + long countByExample(DatasetExample example); + + int deleteByExample(DatasetExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(Dataset record); + + int insertSelective(Dataset record); + + List selectByExampleWithBLOBs(DatasetExample example); + + List selectByExample(DatasetExample example); + + Dataset selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") Dataset record, @Param("example") DatasetExample example); + + int updateByExampleWithBLOBs(@Param("record") Dataset record, @Param("example") DatasetExample example); + + int updateByExample(@Param("record") Dataset record, @Param("example") DatasetExample example); + + int updateByPrimaryKeySelective(Dataset record); + + int updateByPrimaryKeyWithBLOBs(Dataset record); + + int updateByPrimaryKey(Dataset record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Dataset.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetSceneRelationMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetSceneRelationMapper.java new file mode 100644 index 000000000..e15114da8 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DatasetSceneRelationMapper.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.DatasetSceneRelation; +import run.mone.mimeter.dashboard.pojo.DatasetSceneRelationExample; + +public interface DatasetSceneRelationMapper { + long countByExample(DatasetSceneRelationExample example); + + int deleteByExample(DatasetSceneRelationExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(DatasetSceneRelation record); + + int insertSelective(DatasetSceneRelation record); + + List selectByExample(DatasetSceneRelationExample example); + + DatasetSceneRelation selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") DatasetSceneRelation record, @Param("example") DatasetSceneRelationExample example); + + int updateByExample(@Param("record") DatasetSceneRelation record, @Param("example") DatasetSceneRelationExample example); + + int updateByPrimaryKeySelective(DatasetSceneRelation record); + + int updateByPrimaryKey(DatasetSceneRelation record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") DatasetSceneRelation.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DomainApplyInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DomainApplyInfoMapper.java new file mode 100644 index 000000000..da85c2efc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/DomainApplyInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.DomainApplyInfo; +import run.mone.mimeter.dashboard.pojo.DomainApplyInfoExample; + +public interface DomainApplyInfoMapper { + long countByExample(DomainApplyInfoExample example); + + int deleteByExample(DomainApplyInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(DomainApplyInfo record); + + int insertSelective(DomainApplyInfo record); + + List selectByExampleWithBLOBs(DomainApplyInfoExample example); + + List selectByExample(DomainApplyInfoExample example); + + DomainApplyInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") DomainApplyInfo record, @Param("example") DomainApplyInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") DomainApplyInfo record, @Param("example") DomainApplyInfoExample example); + + int updateByExample(@Param("record") DomainApplyInfo record, @Param("example") DomainApplyInfoExample example); + + int updateByPrimaryKeySelective(DomainApplyInfo record); + + int updateByPrimaryKeyWithBLOBs(DomainApplyInfo record); + + int updateByPrimaryKey(DomainApplyInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") DomainApplyInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/MibenchTaskMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/MibenchTaskMapper.java new file mode 100644 index 000000000..6db978c88 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/MibenchTaskMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.MibenchTask; +import run.mone.mimeter.dashboard.pojo.MibenchTaskExample; + +public interface MibenchTaskMapper { + long countByExample(MibenchTaskExample example); + + int deleteByExample(MibenchTaskExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(MibenchTask record); + + int insertSelective(MibenchTask record); + + List selectByExampleWithBLOBs(MibenchTaskExample example); + + List selectByExample(MibenchTaskExample example); + + MibenchTask selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") MibenchTask record, @Param("example") MibenchTaskExample example); + + int updateByExampleWithBLOBs(@Param("record") MibenchTask record, @Param("example") MibenchTaskExample example); + + int updateByExample(@Param("record") MibenchTask record, @Param("example") MibenchTaskExample example); + + int updateByPrimaryKeySelective(MibenchTask record); + + int updateByPrimaryKeyWithBLOBs(MibenchTask record); + + int updateByPrimaryKey(MibenchTask record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") MibenchTask.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/OperationLogMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/OperationLogMapper.java new file mode 100644 index 000000000..fb4cc6d92 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/OperationLogMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.OperationLog; +import run.mone.mimeter.dashboard.pojo.OperationLogExample; + +public interface OperationLogMapper { + long countByExample(OperationLogExample example); + + int deleteByExample(OperationLogExample example); + + int deleteByPrimaryKey(Long id); + + int insert(OperationLog record); + + int insertSelective(OperationLog record); + + List selectByExampleWithBLOBs(OperationLogExample example); + + List selectByExample(OperationLogExample example); + + OperationLog selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") OperationLog record, @Param("example") OperationLogExample example); + + int updateByExampleWithBLOBs(@Param("record") OperationLog record, @Param("example") OperationLogExample example); + + int updateByExample(@Param("record") OperationLog record, @Param("example") OperationLogExample example); + + int updateByPrimaryKeySelective(OperationLog record); + + int updateByPrimaryKeyWithBLOBs(OperationLog record); + + int updateByPrimaryKey(OperationLog record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") OperationLog.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportInfoMapper.java new file mode 100644 index 000000000..ff5f1e4ff --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.ReportInfo; +import run.mone.mimeter.dashboard.pojo.ReportInfoExample; + +public interface ReportInfoMapper { + long countByExample(ReportInfoExample example); + + int deleteByExample(ReportInfoExample example); + + int deleteByPrimaryKey(Long id); + + int insert(ReportInfo record); + + int insertSelective(ReportInfo record); + + List selectByExampleWithBLOBs(ReportInfoExample example); + + List selectByExample(ReportInfoExample example); + + ReportInfo selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") ReportInfo record, @Param("example") ReportInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") ReportInfo record, @Param("example") ReportInfoExample example); + + int updateByExample(@Param("record") ReportInfo record, @Param("example") ReportInfoExample example); + + int updateByPrimaryKeySelective(ReportInfo record); + + int updateByPrimaryKeyWithBLOBs(ReportInfo record); + + int updateByPrimaryKey(ReportInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ReportInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportStatMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportStatMapper.java new file mode 100644 index 000000000..847b8e471 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/ReportStatMapper.java @@ -0,0 +1,39 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.ReportStat; +import run.mone.mimeter.dashboard.pojo.ReportStatExample; + +@Mapper +public interface ReportStatMapper { + long countByExample(ReportStatExample example); + + int deleteByExample(ReportStatExample example); + + int deleteByPrimaryKey(Long id); + + int insert(ReportStat record); + + int insertSelective(ReportStat record); + + List selectByExample(ReportStatExample example); + + ReportStat selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") ReportStat record, @Param("example") ReportStatExample example); + + int updateByExample(@Param("record") ReportStat record, @Param("example") ReportStatExample example); + + int updateByPrimaryKeySelective(ReportStat record); + + int updateByPrimaryKey(ReportStat record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ReportStat.Column ... selective); + + int saveAccumulative(ReportStat record); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneApiInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneApiInfoMapper.java new file mode 100644 index 000000000..f2860871e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneApiInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SceneApiInfo; +import run.mone.mimeter.dashboard.pojo.SceneApiInfoExample; + +public interface SceneApiInfoMapper { + long countByExample(SceneApiInfoExample example); + + int deleteByExample(SceneApiInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SceneApiInfo record); + + int insertSelective(SceneApiInfo record); + + List selectByExampleWithBLOBs(SceneApiInfoExample example); + + List selectByExample(SceneApiInfoExample example); + + SceneApiInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SceneApiInfo record, @Param("example") SceneApiInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") SceneApiInfo record, @Param("example") SceneApiInfoExample example); + + int updateByExample(@Param("record") SceneApiInfo record, @Param("example") SceneApiInfoExample example); + + int updateByPrimaryKeySelective(SceneApiInfo record); + + int updateByPrimaryKeyWithBLOBs(SceneApiInfo record); + + int updateByPrimaryKey(SceneApiInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SceneApiInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneGroupMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneGroupMapper.java new file mode 100644 index 000000000..c212f2922 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneGroupMapper.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SceneGroup; +import run.mone.mimeter.dashboard.pojo.SceneGroupExample; + +public interface SceneGroupMapper { + long countByExample(SceneGroupExample example); + + int deleteByExample(SceneGroupExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SceneGroup record); + + int insertSelective(SceneGroup record); + + List selectByExample(SceneGroupExample example); + + SceneGroup selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SceneGroup record, @Param("example") SceneGroupExample example); + + int updateByExample(@Param("record") SceneGroup record, @Param("example") SceneGroupExample example); + + int updateByPrimaryKeySelective(SceneGroup record); + + int updateByPrimaryKey(SceneGroup record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SceneGroup.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneInfoMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneInfoMapper.java new file mode 100644 index 000000000..01172b6ee --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneInfoMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SceneInfo; +import run.mone.mimeter.dashboard.pojo.SceneInfoExample; + +public interface SceneInfoMapper { + long countByExample(SceneInfoExample example); + + int deleteByExample(SceneInfoExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SceneInfo record); + + int insertSelective(SceneInfo record); + + List selectByExampleWithBLOBs(SceneInfoExample example); + + List selectByExample(SceneInfoExample example); + + SceneInfo selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SceneInfo record, @Param("example") SceneInfoExample example); + + int updateByExampleWithBLOBs(@Param("record") SceneInfo record, @Param("example") SceneInfoExample example); + + int updateByExample(@Param("record") SceneInfo record, @Param("example") SceneInfoExample example); + + int updateByPrimaryKeySelective(SceneInfo record); + + int updateByPrimaryKeyWithBLOBs(SceneInfo record); + + int updateByPrimaryKey(SceneInfo record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SceneInfo.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneSnapshotMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneSnapshotMapper.java new file mode 100644 index 000000000..6efacf430 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SceneSnapshotMapper.java @@ -0,0 +1,40 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SceneSnapshot; +import run.mone.mimeter.dashboard.pojo.SceneSnapshotExample; + +public interface SceneSnapshotMapper { + long countByExample(SceneSnapshotExample example); + + int deleteByExample(SceneSnapshotExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SceneSnapshot record); + + int insertSelective(SceneSnapshot record); + + List selectByExampleWithBLOBs(SceneSnapshotExample example); + + List selectByExample(SceneSnapshotExample example); + + SceneSnapshot selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SceneSnapshot record, @Param("example") SceneSnapshotExample example); + + int updateByExampleWithBLOBs(@Param("record") SceneSnapshot record, @Param("example") SceneSnapshotExample example); + + int updateByExample(@Param("record") SceneSnapshot record, @Param("example") SceneSnapshotExample example); + + int updateByPrimaryKeySelective(SceneSnapshot record); + + int updateByPrimaryKeyWithBLOBs(SceneSnapshot record); + + int updateByPrimaryKey(SceneSnapshot record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SceneSnapshot.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SerialLinkMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SerialLinkMapper.java new file mode 100644 index 000000000..8134184c0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SerialLinkMapper.java @@ -0,0 +1,37 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SerialLink; +import run.mone.mimeter.dashboard.pojo.SerialLinkExample; + +@Mapper +public interface SerialLinkMapper { + long countByExample(SerialLinkExample example); + + int deleteByExample(SerialLinkExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SerialLink record); + + int insertSelective(SerialLink record); + + List selectByExample(SerialLinkExample example); + + SerialLink selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SerialLink record, @Param("example") SerialLinkExample example); + + int updateByExample(@Param("record") SerialLink record, @Param("example") SerialLinkExample example); + + int updateByPrimaryKeySelective(SerialLink record); + + int updateByPrimaryKey(SerialLink record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SerialLink.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaMapper.java new file mode 100644 index 000000000..d1796f571 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaMapper.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.Sla; +import run.mone.mimeter.dashboard.pojo.SlaExample; + +public interface SlaMapper { + long countByExample(SlaExample example); + + int deleteByExample(SlaExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(Sla record); + + int insertSelective(Sla record); + + List selectByExample(SlaExample example); + + Sla selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") Sla record, @Param("example") SlaExample example); + + int updateByExample(@Param("record") Sla record, @Param("example") SlaExample example); + + int updateByPrimaryKeySelective(Sla record); + + int updateByPrimaryKey(Sla record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Sla.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaRuleMapper.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaRuleMapper.java new file mode 100644 index 000000000..a9f22ba02 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/mapper/SlaRuleMapper.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import run.mone.mimeter.dashboard.pojo.SlaRule; +import run.mone.mimeter.dashboard.pojo.SlaRuleExample; + +public interface SlaRuleMapper { + long countByExample(SlaRuleExample example); + + int deleteByExample(SlaRuleExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SlaRule record); + + int insertSelective(SlaRule record); + + List selectByExample(SlaRuleExample example); + + SlaRule selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SlaRule record, @Param("example") SlaRuleExample example); + + int updateByExample(@Param("record") SlaRule record, @Param("example") SlaRuleExample example); + + int updateByPrimaryKeySelective(SlaRule record); + + int updateByPrimaryKey(SlaRule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SlaRule.Column ... selective); +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfo.java new file mode 100644 index 000000000..b99ea76ec --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfo.java @@ -0,0 +1,164 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class AgentApplyInfo { + private Integer id; + + private String applyUser; + + private String applyOrgId; + + private String applyOrgName; + + private String agentIp; + + private String agentHostname; + + private Integer applyStatus; + + private Long ctime; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getApplyUser() { + return applyUser; + } + + public void setApplyUser(String applyUser) { + this.applyUser = applyUser == null ? null : applyUser.trim(); + } + + public String getApplyOrgId() { + return applyOrgId; + } + + public void setApplyOrgId(String applyOrgId) { + this.applyOrgId = applyOrgId == null ? null : applyOrgId.trim(); + } + + public String getApplyOrgName() { + return applyOrgName; + } + + public void setApplyOrgName(String applyOrgName) { + this.applyOrgName = applyOrgName == null ? null : applyOrgName.trim(); + } + + public String getAgentIp() { + return agentIp; + } + + public void setAgentIp(String agentIp) { + this.agentIp = agentIp == null ? null : agentIp.trim(); + } + + public String getAgentHostname() { + return agentHostname; + } + + public void setAgentHostname(String agentHostname) { + this.agentHostname = agentHostname == null ? null : agentHostname.trim(); + } + + public Integer getApplyStatus() { + return applyStatus; + } + + public void setApplyStatus(Integer applyStatus) { + this.applyStatus = applyStatus; + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public enum Column { + id("id", "id", "INTEGER", false), + applyUser("apply_user", "applyUser", "VARCHAR", false), + applyOrgId("apply_org_id", "applyOrgId", "VARCHAR", false), + applyOrgName("apply_org_name", "applyOrgName", "VARCHAR", false), + agentIp("agent_ip", "agentIp", "VARCHAR", false), + agentHostname("agent_hostname", "agentHostname", "VARCHAR", false), + applyStatus("apply_status", "applyStatus", "INTEGER", false), + ctime("ctime", "ctime", "BIGINT", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfoExample.java new file mode 100644 index 000000000..ded48efcb --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentApplyInfoExample.java @@ -0,0 +1,730 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class AgentApplyInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AgentApplyInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andApplyUserIsNull() { + addCriterion("apply_user is null"); + return (Criteria) this; + } + + public Criteria andApplyUserIsNotNull() { + addCriterion("apply_user is not null"); + return (Criteria) this; + } + + public Criteria andApplyUserEqualTo(String value) { + addCriterion("apply_user =", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotEqualTo(String value) { + addCriterion("apply_user <>", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserGreaterThan(String value) { + addCriterion("apply_user >", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserGreaterThanOrEqualTo(String value) { + addCriterion("apply_user >=", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLessThan(String value) { + addCriterion("apply_user <", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLessThanOrEqualTo(String value) { + addCriterion("apply_user <=", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLike(String value) { + addCriterion("apply_user like", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotLike(String value) { + addCriterion("apply_user not like", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserIn(List values) { + addCriterion("apply_user in", values, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotIn(List values) { + addCriterion("apply_user not in", values, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserBetween(String value1, String value2) { + addCriterion("apply_user between", value1, value2, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotBetween(String value1, String value2) { + addCriterion("apply_user not between", value1, value2, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdIsNull() { + addCriterion("apply_org_id is null"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdIsNotNull() { + addCriterion("apply_org_id is not null"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdEqualTo(String value) { + addCriterion("apply_org_id =", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdNotEqualTo(String value) { + addCriterion("apply_org_id <>", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdGreaterThan(String value) { + addCriterion("apply_org_id >", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdGreaterThanOrEqualTo(String value) { + addCriterion("apply_org_id >=", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdLessThan(String value) { + addCriterion("apply_org_id <", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdLessThanOrEqualTo(String value) { + addCriterion("apply_org_id <=", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdLike(String value) { + addCriterion("apply_org_id like", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdNotLike(String value) { + addCriterion("apply_org_id not like", value, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdIn(List values) { + addCriterion("apply_org_id in", values, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdNotIn(List values) { + addCriterion("apply_org_id not in", values, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdBetween(String value1, String value2) { + addCriterion("apply_org_id between", value1, value2, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgIdNotBetween(String value1, String value2) { + addCriterion("apply_org_id not between", value1, value2, "applyOrgId"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameIsNull() { + addCriterion("apply_org_name is null"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameIsNotNull() { + addCriterion("apply_org_name is not null"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameEqualTo(String value) { + addCriterion("apply_org_name =", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameNotEqualTo(String value) { + addCriterion("apply_org_name <>", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameGreaterThan(String value) { + addCriterion("apply_org_name >", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameGreaterThanOrEqualTo(String value) { + addCriterion("apply_org_name >=", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameLessThan(String value) { + addCriterion("apply_org_name <", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameLessThanOrEqualTo(String value) { + addCriterion("apply_org_name <=", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameLike(String value) { + addCriterion("apply_org_name like", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameNotLike(String value) { + addCriterion("apply_org_name not like", value, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameIn(List values) { + addCriterion("apply_org_name in", values, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameNotIn(List values) { + addCriterion("apply_org_name not in", values, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameBetween(String value1, String value2) { + addCriterion("apply_org_name between", value1, value2, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andApplyOrgNameNotBetween(String value1, String value2) { + addCriterion("apply_org_name not between", value1, value2, "applyOrgName"); + return (Criteria) this; + } + + public Criteria andAgentIpIsNull() { + addCriterion("agent_ip is null"); + return (Criteria) this; + } + + public Criteria andAgentIpIsNotNull() { + addCriterion("agent_ip is not null"); + return (Criteria) this; + } + + public Criteria andAgentIpEqualTo(String value) { + addCriterion("agent_ip =", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpNotEqualTo(String value) { + addCriterion("agent_ip <>", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpGreaterThan(String value) { + addCriterion("agent_ip >", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpGreaterThanOrEqualTo(String value) { + addCriterion("agent_ip >=", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpLessThan(String value) { + addCriterion("agent_ip <", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpLessThanOrEqualTo(String value) { + addCriterion("agent_ip <=", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpLike(String value) { + addCriterion("agent_ip like", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpNotLike(String value) { + addCriterion("agent_ip not like", value, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpIn(List values) { + addCriterion("agent_ip in", values, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpNotIn(List values) { + addCriterion("agent_ip not in", values, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpBetween(String value1, String value2) { + addCriterion("agent_ip between", value1, value2, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentIpNotBetween(String value1, String value2) { + addCriterion("agent_ip not between", value1, value2, "agentIp"); + return (Criteria) this; + } + + public Criteria andAgentHostnameIsNull() { + addCriterion("agent_hostname is null"); + return (Criteria) this; + } + + public Criteria andAgentHostnameIsNotNull() { + addCriterion("agent_hostname is not null"); + return (Criteria) this; + } + + public Criteria andAgentHostnameEqualTo(String value) { + addCriterion("agent_hostname =", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameNotEqualTo(String value) { + addCriterion("agent_hostname <>", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameGreaterThan(String value) { + addCriterion("agent_hostname >", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameGreaterThanOrEqualTo(String value) { + addCriterion("agent_hostname >=", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameLessThan(String value) { + addCriterion("agent_hostname <", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameLessThanOrEqualTo(String value) { + addCriterion("agent_hostname <=", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameLike(String value) { + addCriterion("agent_hostname like", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameNotLike(String value) { + addCriterion("agent_hostname not like", value, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameIn(List values) { + addCriterion("agent_hostname in", values, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameNotIn(List values) { + addCriterion("agent_hostname not in", values, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameBetween(String value1, String value2) { + addCriterion("agent_hostname between", value1, value2, "agentHostname"); + return (Criteria) this; + } + + public Criteria andAgentHostnameNotBetween(String value1, String value2) { + addCriterion("agent_hostname not between", value1, value2, "agentHostname"); + return (Criteria) this; + } + + public Criteria andApplyStatusIsNull() { + addCriterion("apply_status is null"); + return (Criteria) this; + } + + public Criteria andApplyStatusIsNotNull() { + addCriterion("apply_status is not null"); + return (Criteria) this; + } + + public Criteria andApplyStatusEqualTo(Integer value) { + addCriterion("apply_status =", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotEqualTo(Integer value) { + addCriterion("apply_status <>", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusGreaterThan(Integer value) { + addCriterion("apply_status >", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("apply_status >=", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusLessThan(Integer value) { + addCriterion("apply_status <", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusLessThanOrEqualTo(Integer value) { + addCriterion("apply_status <=", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusIn(List values) { + addCriterion("apply_status in", values, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotIn(List values) { + addCriterion("apply_status not in", values, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusBetween(Integer value1, Integer value2) { + addCriterion("apply_status between", value1, value2, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotBetween(Integer value1, Integer value2) { + addCriterion("apply_status not between", value1, value2, "applyStatus"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfo.java new file mode 100644 index 000000000..f40c2f01a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfo.java @@ -0,0 +1,263 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class AgentInfo { + private Integer id; + + private String serverName; + + private String ip; + + private Integer port; + + private Integer cpu; + + private Long mem; + + private Integer useCpu; + + private Long useMem; + + private String hostname; + + private String clientDesc; + + private Long ctime; + + private Long utime; + + private Boolean enable; + + private String nodeIp; + + private String tenant; + + private String tenantCn; + + private String domainConf; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName == null ? null : serverName.trim(); + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip == null ? null : ip.trim(); + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getCpu() { + return cpu; + } + + public void setCpu(Integer cpu) { + this.cpu = cpu; + } + + public Long getMem() { + return mem; + } + + public void setMem(Long mem) { + this.mem = mem; + } + + public Integer getUseCpu() { + return useCpu; + } + + public void setUseCpu(Integer useCpu) { + this.useCpu = useCpu; + } + + public Long getUseMem() { + return useMem; + } + + public void setUseMem(Long useMem) { + this.useMem = useMem; + } + + public String getHostname() { + return hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname == null ? null : hostname.trim(); + } + + public String getClientDesc() { + return clientDesc; + } + + public void setClientDesc(String clientDesc) { + this.clientDesc = clientDesc == null ? null : clientDesc.trim(); + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public String getNodeIp() { + return nodeIp; + } + + public void setNodeIp(String nodeIp) { + this.nodeIp = nodeIp == null ? null : nodeIp.trim(); + } + + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant == null ? null : tenant.trim(); + } + + public String getTenantCn() { + return tenantCn; + } + + public void setTenantCn(String tenantCn) { + this.tenantCn = tenantCn == null ? null : tenantCn.trim(); + } + + public String getDomainConf() { + return domainConf; + } + + public void setDomainConf(String domainConf) { + this.domainConf = domainConf == null ? null : domainConf.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + serverName("server_name", "serverName", "VARCHAR", false), + ip("ip", "ip", "VARCHAR", false), + port("port", "port", "INTEGER", false), + cpu("cpu", "cpu", "INTEGER", false), + mem("mem", "mem", "BIGINT", false), + useCpu("use_cpu", "useCpu", "INTEGER", false), + useMem("use_mem", "useMem", "BIGINT", false), + hostname("hostname", "hostname", "VARCHAR", false), + clientDesc("client_desc", "clientDesc", "VARCHAR", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + enable("enable", "enable", "BIT", false), + nodeIp("node_ip", "nodeIp", "VARCHAR", false), + tenant("tenant", "tenant", "VARCHAR", false), + tenantCn("tenant_cn", "tenantCn", "VARCHAR", false), + domainConf("domain_conf", "domainConf", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfoExample.java new file mode 100644 index 000000000..4847c2489 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/AgentInfoExample.java @@ -0,0 +1,1230 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class AgentInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AgentInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andServerNameIsNull() { + addCriterion("server_name is null"); + return (Criteria) this; + } + + public Criteria andServerNameIsNotNull() { + addCriterion("server_name is not null"); + return (Criteria) this; + } + + public Criteria andServerNameEqualTo(String value) { + addCriterion("server_name =", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameNotEqualTo(String value) { + addCriterion("server_name <>", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameGreaterThan(String value) { + addCriterion("server_name >", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameGreaterThanOrEqualTo(String value) { + addCriterion("server_name >=", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameLessThan(String value) { + addCriterion("server_name <", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameLessThanOrEqualTo(String value) { + addCriterion("server_name <=", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameLike(String value) { + addCriterion("server_name like", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameNotLike(String value) { + addCriterion("server_name not like", value, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameIn(List values) { + addCriterion("server_name in", values, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameNotIn(List values) { + addCriterion("server_name not in", values, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameBetween(String value1, String value2) { + addCriterion("server_name between", value1, value2, "serverName"); + return (Criteria) this; + } + + public Criteria andServerNameNotBetween(String value1, String value2) { + addCriterion("server_name not between", value1, value2, "serverName"); + return (Criteria) this; + } + + public Criteria andIpIsNull() { + addCriterion("ip is null"); + return (Criteria) this; + } + + public Criteria andIpIsNotNull() { + addCriterion("ip is not null"); + return (Criteria) this; + } + + public Criteria andIpEqualTo(String value) { + addCriterion("ip =", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotEqualTo(String value) { + addCriterion("ip <>", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThan(String value) { + addCriterion("ip >", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThanOrEqualTo(String value) { + addCriterion("ip >=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThan(String value) { + addCriterion("ip <", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThanOrEqualTo(String value) { + addCriterion("ip <=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLike(String value) { + addCriterion("ip like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotLike(String value) { + addCriterion("ip not like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpIn(List values) { + addCriterion("ip in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotIn(List values) { + addCriterion("ip not in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpBetween(String value1, String value2) { + addCriterion("ip between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotBetween(String value1, String value2) { + addCriterion("ip not between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andPortIsNull() { + addCriterion("port is null"); + return (Criteria) this; + } + + public Criteria andPortIsNotNull() { + addCriterion("port is not null"); + return (Criteria) this; + } + + public Criteria andPortEqualTo(Integer value) { + addCriterion("port =", value, "port"); + return (Criteria) this; + } + + public Criteria andPortNotEqualTo(Integer value) { + addCriterion("port <>", value, "port"); + return (Criteria) this; + } + + public Criteria andPortGreaterThan(Integer value) { + addCriterion("port >", value, "port"); + return (Criteria) this; + } + + public Criteria andPortGreaterThanOrEqualTo(Integer value) { + addCriterion("port >=", value, "port"); + return (Criteria) this; + } + + public Criteria andPortLessThan(Integer value) { + addCriterion("port <", value, "port"); + return (Criteria) this; + } + + public Criteria andPortLessThanOrEqualTo(Integer value) { + addCriterion("port <=", value, "port"); + return (Criteria) this; + } + + public Criteria andPortIn(List values) { + addCriterion("port in", values, "port"); + return (Criteria) this; + } + + public Criteria andPortNotIn(List values) { + addCriterion("port not in", values, "port"); + return (Criteria) this; + } + + public Criteria andPortBetween(Integer value1, Integer value2) { + addCriterion("port between", value1, value2, "port"); + return (Criteria) this; + } + + public Criteria andPortNotBetween(Integer value1, Integer value2) { + addCriterion("port not between", value1, value2, "port"); + return (Criteria) this; + } + + public Criteria andCpuIsNull() { + addCriterion("cpu is null"); + return (Criteria) this; + } + + public Criteria andCpuIsNotNull() { + addCriterion("cpu is not null"); + return (Criteria) this; + } + + public Criteria andCpuEqualTo(Integer value) { + addCriterion("cpu =", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuNotEqualTo(Integer value) { + addCriterion("cpu <>", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuGreaterThan(Integer value) { + addCriterion("cpu >", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuGreaterThanOrEqualTo(Integer value) { + addCriterion("cpu >=", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuLessThan(Integer value) { + addCriterion("cpu <", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuLessThanOrEqualTo(Integer value) { + addCriterion("cpu <=", value, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuIn(List values) { + addCriterion("cpu in", values, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuNotIn(List values) { + addCriterion("cpu not in", values, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuBetween(Integer value1, Integer value2) { + addCriterion("cpu between", value1, value2, "cpu"); + return (Criteria) this; + } + + public Criteria andCpuNotBetween(Integer value1, Integer value2) { + addCriterion("cpu not between", value1, value2, "cpu"); + return (Criteria) this; + } + + public Criteria andMemIsNull() { + addCriterion("mem is null"); + return (Criteria) this; + } + + public Criteria andMemIsNotNull() { + addCriterion("mem is not null"); + return (Criteria) this; + } + + public Criteria andMemEqualTo(Long value) { + addCriterion("mem =", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemNotEqualTo(Long value) { + addCriterion("mem <>", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemGreaterThan(Long value) { + addCriterion("mem >", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemGreaterThanOrEqualTo(Long value) { + addCriterion("mem >=", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemLessThan(Long value) { + addCriterion("mem <", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemLessThanOrEqualTo(Long value) { + addCriterion("mem <=", value, "mem"); + return (Criteria) this; + } + + public Criteria andMemIn(List values) { + addCriterion("mem in", values, "mem"); + return (Criteria) this; + } + + public Criteria andMemNotIn(List values) { + addCriterion("mem not in", values, "mem"); + return (Criteria) this; + } + + public Criteria andMemBetween(Long value1, Long value2) { + addCriterion("mem between", value1, value2, "mem"); + return (Criteria) this; + } + + public Criteria andMemNotBetween(Long value1, Long value2) { + addCriterion("mem not between", value1, value2, "mem"); + return (Criteria) this; + } + + public Criteria andUseCpuIsNull() { + addCriterion("use_cpu is null"); + return (Criteria) this; + } + + public Criteria andUseCpuIsNotNull() { + addCriterion("use_cpu is not null"); + return (Criteria) this; + } + + public Criteria andUseCpuEqualTo(Integer value) { + addCriterion("use_cpu =", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuNotEqualTo(Integer value) { + addCriterion("use_cpu <>", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuGreaterThan(Integer value) { + addCriterion("use_cpu >", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuGreaterThanOrEqualTo(Integer value) { + addCriterion("use_cpu >=", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuLessThan(Integer value) { + addCriterion("use_cpu <", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuLessThanOrEqualTo(Integer value) { + addCriterion("use_cpu <=", value, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuIn(List values) { + addCriterion("use_cpu in", values, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuNotIn(List values) { + addCriterion("use_cpu not in", values, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuBetween(Integer value1, Integer value2) { + addCriterion("use_cpu between", value1, value2, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseCpuNotBetween(Integer value1, Integer value2) { + addCriterion("use_cpu not between", value1, value2, "useCpu"); + return (Criteria) this; + } + + public Criteria andUseMemIsNull() { + addCriterion("use_mem is null"); + return (Criteria) this; + } + + public Criteria andUseMemIsNotNull() { + addCriterion("use_mem is not null"); + return (Criteria) this; + } + + public Criteria andUseMemEqualTo(Long value) { + addCriterion("use_mem =", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemNotEqualTo(Long value) { + addCriterion("use_mem <>", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemGreaterThan(Long value) { + addCriterion("use_mem >", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemGreaterThanOrEqualTo(Long value) { + addCriterion("use_mem >=", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemLessThan(Long value) { + addCriterion("use_mem <", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemLessThanOrEqualTo(Long value) { + addCriterion("use_mem <=", value, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemIn(List values) { + addCriterion("use_mem in", values, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemNotIn(List values) { + addCriterion("use_mem not in", values, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemBetween(Long value1, Long value2) { + addCriterion("use_mem between", value1, value2, "useMem"); + return (Criteria) this; + } + + public Criteria andUseMemNotBetween(Long value1, Long value2) { + addCriterion("use_mem not between", value1, value2, "useMem"); + return (Criteria) this; + } + + public Criteria andHostnameIsNull() { + addCriterion("hostname is null"); + return (Criteria) this; + } + + public Criteria andHostnameIsNotNull() { + addCriterion("hostname is not null"); + return (Criteria) this; + } + + public Criteria andHostnameEqualTo(String value) { + addCriterion("hostname =", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameNotEqualTo(String value) { + addCriterion("hostname <>", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameGreaterThan(String value) { + addCriterion("hostname >", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameGreaterThanOrEqualTo(String value) { + addCriterion("hostname >=", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameLessThan(String value) { + addCriterion("hostname <", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameLessThanOrEqualTo(String value) { + addCriterion("hostname <=", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameLike(String value) { + addCriterion("hostname like", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameNotLike(String value) { + addCriterion("hostname not like", value, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameIn(List values) { + addCriterion("hostname in", values, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameNotIn(List values) { + addCriterion("hostname not in", values, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameBetween(String value1, String value2) { + addCriterion("hostname between", value1, value2, "hostname"); + return (Criteria) this; + } + + public Criteria andHostnameNotBetween(String value1, String value2) { + addCriterion("hostname not between", value1, value2, "hostname"); + return (Criteria) this; + } + + public Criteria andClientDescIsNull() { + addCriterion("client_desc is null"); + return (Criteria) this; + } + + public Criteria andClientDescIsNotNull() { + addCriterion("client_desc is not null"); + return (Criteria) this; + } + + public Criteria andClientDescEqualTo(String value) { + addCriterion("client_desc =", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescNotEqualTo(String value) { + addCriterion("client_desc <>", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescGreaterThan(String value) { + addCriterion("client_desc >", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescGreaterThanOrEqualTo(String value) { + addCriterion("client_desc >=", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescLessThan(String value) { + addCriterion("client_desc <", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescLessThanOrEqualTo(String value) { + addCriterion("client_desc <=", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescLike(String value) { + addCriterion("client_desc like", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescNotLike(String value) { + addCriterion("client_desc not like", value, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescIn(List values) { + addCriterion("client_desc in", values, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescNotIn(List values) { + addCriterion("client_desc not in", values, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescBetween(String value1, String value2) { + addCriterion("client_desc between", value1, value2, "clientDesc"); + return (Criteria) this; + } + + public Criteria andClientDescNotBetween(String value1, String value2) { + addCriterion("client_desc not between", value1, value2, "clientDesc"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("enable is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("enable is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("enable =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("enable <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("enable >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("enable >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("enable <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("enable <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("enable in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("enable not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("enable between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("enable not between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andNodeIpIsNull() { + addCriterion("node_ip is null"); + return (Criteria) this; + } + + public Criteria andNodeIpIsNotNull() { + addCriterion("node_ip is not null"); + return (Criteria) this; + } + + public Criteria andNodeIpEqualTo(String value) { + addCriterion("node_ip =", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpNotEqualTo(String value) { + addCriterion("node_ip <>", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpGreaterThan(String value) { + addCriterion("node_ip >", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpGreaterThanOrEqualTo(String value) { + addCriterion("node_ip >=", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpLessThan(String value) { + addCriterion("node_ip <", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpLessThanOrEqualTo(String value) { + addCriterion("node_ip <=", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpLike(String value) { + addCriterion("node_ip like", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpNotLike(String value) { + addCriterion("node_ip not like", value, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpIn(List values) { + addCriterion("node_ip in", values, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpNotIn(List values) { + addCriterion("node_ip not in", values, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpBetween(String value1, String value2) { + addCriterion("node_ip between", value1, value2, "nodeIp"); + return (Criteria) this; + } + + public Criteria andNodeIpNotBetween(String value1, String value2) { + addCriterion("node_ip not between", value1, value2, "nodeIp"); + return (Criteria) this; + } + + public Criteria andTenantIsNull() { + addCriterion("tenant is null"); + return (Criteria) this; + } + + public Criteria andTenantIsNotNull() { + addCriterion("tenant is not null"); + return (Criteria) this; + } + + public Criteria andTenantEqualTo(String value) { + addCriterion("tenant =", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotEqualTo(String value) { + addCriterion("tenant <>", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThan(String value) { + addCriterion("tenant >", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThanOrEqualTo(String value) { + addCriterion("tenant >=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThan(String value) { + addCriterion("tenant <", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThanOrEqualTo(String value) { + addCriterion("tenant <=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLike(String value) { + addCriterion("tenant like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotLike(String value) { + addCriterion("tenant not like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantIn(List values) { + addCriterion("tenant in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotIn(List values) { + addCriterion("tenant not in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantBetween(String value1, String value2) { + addCriterion("tenant between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotBetween(String value1, String value2) { + addCriterion("tenant not between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantCnIsNull() { + addCriterion("tenant_cn is null"); + return (Criteria) this; + } + + public Criteria andTenantCnIsNotNull() { + addCriterion("tenant_cn is not null"); + return (Criteria) this; + } + + public Criteria andTenantCnEqualTo(String value) { + addCriterion("tenant_cn =", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnNotEqualTo(String value) { + addCriterion("tenant_cn <>", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnGreaterThan(String value) { + addCriterion("tenant_cn >", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnGreaterThanOrEqualTo(String value) { + addCriterion("tenant_cn >=", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnLessThan(String value) { + addCriterion("tenant_cn <", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnLessThanOrEqualTo(String value) { + addCriterion("tenant_cn <=", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnLike(String value) { + addCriterion("tenant_cn like", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnNotLike(String value) { + addCriterion("tenant_cn not like", value, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnIn(List values) { + addCriterion("tenant_cn in", values, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnNotIn(List values) { + addCriterion("tenant_cn not in", values, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnBetween(String value1, String value2) { + addCriterion("tenant_cn between", value1, value2, "tenantCn"); + return (Criteria) this; + } + + public Criteria andTenantCnNotBetween(String value1, String value2) { + addCriterion("tenant_cn not between", value1, value2, "tenantCn"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStat.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStat.java new file mode 100644 index 000000000..325cee8ee --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStat.java @@ -0,0 +1,341 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +public class ApiStat { + private Long id; + + private Long sceneId; + + private String reportId; + + private Long apiId; + + private Integer reqSucc; + + private Integer reqFail; + + private Integer tps; + + private Integer tpsMax; + + private Integer rt; + + private Integer rtMax; + + private Integer rt99; + + private Integer rt90; + + private Integer rt70; + + private Integer rt50; + + private Integer connDuration; + + private Integer recvDuration; + + private Integer sendDuration; + + private Integer waitDuration; + + private Date createTime; + + private Date updateTime; + + private String apiUri; + + private String apiMethod; + + private Long serialId; + + private Long taskId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSceneId() { + return sceneId; + } + + public void setSceneId(Long sceneId) { + this.sceneId = sceneId; + } + + public String getReportId() { + return reportId; + } + + public void setReportId(String reportId) { + this.reportId = reportId == null ? null : reportId.trim(); + } + + public Long getApiId() { + return apiId; + } + + public void setApiId(Long apiId) { + this.apiId = apiId; + } + + public Integer getReqSucc() { + return reqSucc; + } + + public void setReqSucc(Integer reqSucc) { + this.reqSucc = reqSucc; + } + + public Integer getReqFail() { + return reqFail; + } + + public void setReqFail(Integer reqFail) { + this.reqFail = reqFail; + } + + public Integer getTps() { + return tps; + } + + public void setTps(Integer tps) { + this.tps = tps; + } + + public Integer getTpsMax() { + return tpsMax; + } + + public void setTpsMax(Integer tpsMax) { + this.tpsMax = tpsMax; + } + + public Integer getRt() { + return rt; + } + + public void setRt(Integer rt) { + this.rt = rt; + } + + public Integer getRtMax() { + return rtMax; + } + + public void setRtMax(Integer rtMax) { + this.rtMax = rtMax; + } + + public Integer getRt99() { + return rt99; + } + + public void setRt99(Integer rt99) { + this.rt99 = rt99; + } + + public Integer getRt90() { + return rt90; + } + + public void setRt90(Integer rt90) { + this.rt90 = rt90; + } + + public Integer getRt70() { + return rt70; + } + + public void setRt70(Integer rt70) { + this.rt70 = rt70; + } + + public Integer getRt50() { + return rt50; + } + + public void setRt50(Integer rt50) { + this.rt50 = rt50; + } + + public Integer getConnDuration() { + return connDuration; + } + + public void setConnDuration(Integer connDuration) { + this.connDuration = connDuration; + } + + public Integer getRecvDuration() { + return recvDuration; + } + + public void setRecvDuration(Integer recvDuration) { + this.recvDuration = recvDuration; + } + + public Integer getSendDuration() { + return sendDuration; + } + + public void setSendDuration(Integer sendDuration) { + this.sendDuration = sendDuration; + } + + public Integer getWaitDuration() { + return waitDuration; + } + + public void setWaitDuration(Integer waitDuration) { + this.waitDuration = waitDuration; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getApiUri() { + return apiUri; + } + + public void setApiUri(String apiUri) { + this.apiUri = apiUri == null ? null : apiUri.trim(); + } + + public String getApiMethod() { + return apiMethod; + } + + public void setApiMethod(String apiMethod) { + this.apiMethod = apiMethod == null ? null : apiMethod.trim(); + } + + public Long getSerialId() { + return serialId; + } + + public void setSerialId(Long serialId) { + this.serialId = serialId; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public enum Column { + id("id", "id", "BIGINT", false), + sceneId("scene_id", "sceneId", "BIGINT", false), + reportId("report_id", "reportId", "VARCHAR", false), + apiId("api_id", "apiId", "BIGINT", false), + reqSucc("req_succ", "reqSucc", "INTEGER", false), + reqFail("req_fail", "reqFail", "INTEGER", false), + tps("tps", "tps", "INTEGER", false), + tpsMax("tps_max", "tpsMax", "INTEGER", false), + rt("rt", "rt", "INTEGER", false), + rtMax("rt_max", "rtMax", "INTEGER", false), + rt99("rt99", "rt99", "INTEGER", false), + rt90("rt90", "rt90", "INTEGER", false), + rt70("rt70", "rt70", "INTEGER", false), + rt50("rt50", "rt50", "INTEGER", false), + connDuration("conn_duration", "connDuration", "INTEGER", false), + recvDuration("recv_duration", "recvDuration", "INTEGER", false), + sendDuration("send_duration", "sendDuration", "INTEGER", false), + waitDuration("wait_duration", "waitDuration", "INTEGER", false), + createTime("create_time", "createTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + apiUri("api_uri", "apiUri", "VARCHAR", false), + apiMethod("api_method", "apiMethod", "VARCHAR", false), + serialId("serial_id", "serialId", "BIGINT", false), + taskId("task_id", "taskId", "BIGINT", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStatExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStatExample.java new file mode 100644 index 000000000..78f7f19ce --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ApiStatExample.java @@ -0,0 +1,1691 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ApiStatExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + public ApiStatExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Long value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Long value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Long value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Long value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Long value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Long value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Long value1, Long value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Long value1, Long value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andApiIdIsNull() { + addCriterion("api_id is null"); + return (Criteria) this; + } + + public Criteria andApiIdIsNotNull() { + addCriterion("api_id is not null"); + return (Criteria) this; + } + + public Criteria andApiIdEqualTo(Long value) { + addCriterion("api_id =", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdNotEqualTo(Long value) { + addCriterion("api_id <>", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdGreaterThan(Long value) { + addCriterion("api_id >", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdGreaterThanOrEqualTo(Long value) { + addCriterion("api_id >=", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdLessThan(Long value) { + addCriterion("api_id <", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdLessThanOrEqualTo(Long value) { + addCriterion("api_id <=", value, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdIn(List values) { + addCriterion("api_id in", values, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdNotIn(List values) { + addCriterion("api_id not in", values, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdBetween(Long value1, Long value2) { + addCriterion("api_id between", value1, value2, "apiId"); + return (Criteria) this; + } + + public Criteria andApiIdNotBetween(Long value1, Long value2) { + addCriterion("api_id not between", value1, value2, "apiId"); + return (Criteria) this; + } + + public Criteria andReqSuccIsNull() { + addCriterion("req_succ is null"); + return (Criteria) this; + } + + public Criteria andReqSuccIsNotNull() { + addCriterion("req_succ is not null"); + return (Criteria) this; + } + + public Criteria andReqSuccEqualTo(Integer value) { + addCriterion("req_succ =", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotEqualTo(Integer value) { + addCriterion("req_succ <>", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccGreaterThan(Integer value) { + addCriterion("req_succ >", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccGreaterThanOrEqualTo(Integer value) { + addCriterion("req_succ >=", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccLessThan(Integer value) { + addCriterion("req_succ <", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccLessThanOrEqualTo(Integer value) { + addCriterion("req_succ <=", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccIn(List values) { + addCriterion("req_succ in", values, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotIn(List values) { + addCriterion("req_succ not in", values, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccBetween(Integer value1, Integer value2) { + addCriterion("req_succ between", value1, value2, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotBetween(Integer value1, Integer value2) { + addCriterion("req_succ not between", value1, value2, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqFailIsNull() { + addCriterion("req_fail is null"); + return (Criteria) this; + } + + public Criteria andReqFailIsNotNull() { + addCriterion("req_fail is not null"); + return (Criteria) this; + } + + public Criteria andReqFailEqualTo(Integer value) { + addCriterion("req_fail =", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotEqualTo(Integer value) { + addCriterion("req_fail <>", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailGreaterThan(Integer value) { + addCriterion("req_fail >", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailGreaterThanOrEqualTo(Integer value) { + addCriterion("req_fail >=", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailLessThan(Integer value) { + addCriterion("req_fail <", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailLessThanOrEqualTo(Integer value) { + addCriterion("req_fail <=", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailIn(List values) { + addCriterion("req_fail in", values, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotIn(List values) { + addCriterion("req_fail not in", values, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailBetween(Integer value1, Integer value2) { + addCriterion("req_fail between", value1, value2, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotBetween(Integer value1, Integer value2) { + addCriterion("req_fail not between", value1, value2, "reqFail"); + return (Criteria) this; + } + + public Criteria andTpsIsNull() { + addCriterion("tps is null"); + return (Criteria) this; + } + + public Criteria andTpsIsNotNull() { + addCriterion("tps is not null"); + return (Criteria) this; + } + + public Criteria andTpsEqualTo(Integer value) { + addCriterion("tps =", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotEqualTo(Integer value) { + addCriterion("tps <>", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsGreaterThan(Integer value) { + addCriterion("tps >", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsGreaterThanOrEqualTo(Integer value) { + addCriterion("tps >=", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsLessThan(Integer value) { + addCriterion("tps <", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsLessThanOrEqualTo(Integer value) { + addCriterion("tps <=", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsIn(List values) { + addCriterion("tps in", values, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotIn(List values) { + addCriterion("tps not in", values, "tps"); + return (Criteria) this; + } + + public Criteria andTpsBetween(Integer value1, Integer value2) { + addCriterion("tps between", value1, value2, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotBetween(Integer value1, Integer value2) { + addCriterion("tps not between", value1, value2, "tps"); + return (Criteria) this; + } + + public Criteria andTpsMaxIsNull() { + addCriterion("tps_max is null"); + return (Criteria) this; + } + + public Criteria andTpsMaxIsNotNull() { + addCriterion("tps_max is not null"); + return (Criteria) this; + } + + public Criteria andTpsMaxEqualTo(Integer value) { + addCriterion("tps_max =", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotEqualTo(Integer value) { + addCriterion("tps_max <>", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxGreaterThan(Integer value) { + addCriterion("tps_max >", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxGreaterThanOrEqualTo(Integer value) { + addCriterion("tps_max >=", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxLessThan(Integer value) { + addCriterion("tps_max <", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxLessThanOrEqualTo(Integer value) { + addCriterion("tps_max <=", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxIn(List values) { + addCriterion("tps_max in", values, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotIn(List values) { + addCriterion("tps_max not in", values, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxBetween(Integer value1, Integer value2) { + addCriterion("tps_max between", value1, value2, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotBetween(Integer value1, Integer value2) { + addCriterion("tps_max not between", value1, value2, "tpsMax"); + return (Criteria) this; + } + + public Criteria andRtIsNull() { + addCriterion("rt is null"); + return (Criteria) this; + } + + public Criteria andRtIsNotNull() { + addCriterion("rt is not null"); + return (Criteria) this; + } + + public Criteria andRtEqualTo(Integer value) { + addCriterion("rt =", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotEqualTo(Integer value) { + addCriterion("rt <>", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtGreaterThan(Integer value) { + addCriterion("rt >", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtGreaterThanOrEqualTo(Integer value) { + addCriterion("rt >=", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtLessThan(Integer value) { + addCriterion("rt <", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtLessThanOrEqualTo(Integer value) { + addCriterion("rt <=", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtIn(List values) { + addCriterion("rt in", values, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotIn(List values) { + addCriterion("rt not in", values, "rt"); + return (Criteria) this; + } + + public Criteria andRtBetween(Integer value1, Integer value2) { + addCriterion("rt between", value1, value2, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotBetween(Integer value1, Integer value2) { + addCriterion("rt not between", value1, value2, "rt"); + return (Criteria) this; + } + + public Criteria andRtMaxIsNull() { + addCriterion("rt_max is null"); + return (Criteria) this; + } + + public Criteria andRtMaxIsNotNull() { + addCriterion("rt_max is not null"); + return (Criteria) this; + } + + public Criteria andRtMaxEqualTo(Integer value) { + addCriterion("rt_max =", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotEqualTo(Integer value) { + addCriterion("rt_max <>", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxGreaterThan(Integer value) { + addCriterion("rt_max >", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxGreaterThanOrEqualTo(Integer value) { + addCriterion("rt_max >=", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxLessThan(Integer value) { + addCriterion("rt_max <", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxLessThanOrEqualTo(Integer value) { + addCriterion("rt_max <=", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxIn(List values) { + addCriterion("rt_max in", values, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotIn(List values) { + addCriterion("rt_max not in", values, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxBetween(Integer value1, Integer value2) { + addCriterion("rt_max between", value1, value2, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotBetween(Integer value1, Integer value2) { + addCriterion("rt_max not between", value1, value2, "rtMax"); + return (Criteria) this; + } + + public Criteria andRt99IsNull() { + addCriterion("rt99 is null"); + return (Criteria) this; + } + + public Criteria andRt99IsNotNull() { + addCriterion("rt99 is not null"); + return (Criteria) this; + } + + public Criteria andRt99EqualTo(Integer value) { + addCriterion("rt99 =", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotEqualTo(Integer value) { + addCriterion("rt99 <>", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99GreaterThan(Integer value) { + addCriterion("rt99 >", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99GreaterThanOrEqualTo(Integer value) { + addCriterion("rt99 >=", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99LessThan(Integer value) { + addCriterion("rt99 <", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99LessThanOrEqualTo(Integer value) { + addCriterion("rt99 <=", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99In(List values) { + addCriterion("rt99 in", values, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotIn(List values) { + addCriterion("rt99 not in", values, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99Between(Integer value1, Integer value2) { + addCriterion("rt99 between", value1, value2, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotBetween(Integer value1, Integer value2) { + addCriterion("rt99 not between", value1, value2, "rt99"); + return (Criteria) this; + } + + public Criteria andRt90IsNull() { + addCriterion("rt90 is null"); + return (Criteria) this; + } + + public Criteria andRt90IsNotNull() { + addCriterion("rt90 is not null"); + return (Criteria) this; + } + + public Criteria andRt90EqualTo(Integer value) { + addCriterion("rt90 =", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotEqualTo(Integer value) { + addCriterion("rt90 <>", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90GreaterThan(Integer value) { + addCriterion("rt90 >", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90GreaterThanOrEqualTo(Integer value) { + addCriterion("rt90 >=", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90LessThan(Integer value) { + addCriterion("rt90 <", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90LessThanOrEqualTo(Integer value) { + addCriterion("rt90 <=", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90In(List values) { + addCriterion("rt90 in", values, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotIn(List values) { + addCriterion("rt90 not in", values, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90Between(Integer value1, Integer value2) { + addCriterion("rt90 between", value1, value2, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotBetween(Integer value1, Integer value2) { + addCriterion("rt90 not between", value1, value2, "rt90"); + return (Criteria) this; + } + + public Criteria andRt70IsNull() { + addCriterion("rt70 is null"); + return (Criteria) this; + } + + public Criteria andRt70IsNotNull() { + addCriterion("rt70 is not null"); + return (Criteria) this; + } + + public Criteria andRt70EqualTo(Integer value) { + addCriterion("rt70 =", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70NotEqualTo(Integer value) { + addCriterion("rt70 <>", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70GreaterThan(Integer value) { + addCriterion("rt70 >", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70GreaterThanOrEqualTo(Integer value) { + addCriterion("rt70 >=", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70LessThan(Integer value) { + addCriterion("rt70 <", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70LessThanOrEqualTo(Integer value) { + addCriterion("rt70 <=", value, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70In(List values) { + addCriterion("rt70 in", values, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70NotIn(List values) { + addCriterion("rt70 not in", values, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70Between(Integer value1, Integer value2) { + addCriterion("rt70 between", value1, value2, "rt70"); + return (Criteria) this; + } + + public Criteria andRt70NotBetween(Integer value1, Integer value2) { + addCriterion("rt70 not between", value1, value2, "rt70"); + return (Criteria) this; + } + + public Criteria andRt50IsNull() { + addCriterion("rt50 is null"); + return (Criteria) this; + } + + public Criteria andRt50IsNotNull() { + addCriterion("rt50 is not null"); + return (Criteria) this; + } + + public Criteria andRt50EqualTo(Integer value) { + addCriterion("rt50 =", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50NotEqualTo(Integer value) { + addCriterion("rt50 <>", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50GreaterThan(Integer value) { + addCriterion("rt50 >", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50GreaterThanOrEqualTo(Integer value) { + addCriterion("rt50 >=", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50LessThan(Integer value) { + addCriterion("rt50 <", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50LessThanOrEqualTo(Integer value) { + addCriterion("rt50 <=", value, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50In(List values) { + addCriterion("rt50 in", values, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50NotIn(List values) { + addCriterion("rt50 not in", values, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50Between(Integer value1, Integer value2) { + addCriterion("rt50 between", value1, value2, "rt50"); + return (Criteria) this; + } + + public Criteria andRt50NotBetween(Integer value1, Integer value2) { + addCriterion("rt50 not between", value1, value2, "rt50"); + return (Criteria) this; + } + + public Criteria andConnDurationIsNull() { + addCriterion("conn_duration is null"); + return (Criteria) this; + } + + public Criteria andConnDurationIsNotNull() { + addCriterion("conn_duration is not null"); + return (Criteria) this; + } + + public Criteria andConnDurationEqualTo(Integer value) { + addCriterion("conn_duration =", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationNotEqualTo(Integer value) { + addCriterion("conn_duration <>", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationGreaterThan(Integer value) { + addCriterion("conn_duration >", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("conn_duration >=", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationLessThan(Integer value) { + addCriterion("conn_duration <", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationLessThanOrEqualTo(Integer value) { + addCriterion("conn_duration <=", value, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationIn(List values) { + addCriterion("conn_duration in", values, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationNotIn(List values) { + addCriterion("conn_duration not in", values, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationBetween(Integer value1, Integer value2) { + addCriterion("conn_duration between", value1, value2, "connDuration"); + return (Criteria) this; + } + + public Criteria andConnDurationNotBetween(Integer value1, Integer value2) { + addCriterion("conn_duration not between", value1, value2, "connDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationIsNull() { + addCriterion("recv_duration is null"); + return (Criteria) this; + } + + public Criteria andRecvDurationIsNotNull() { + addCriterion("recv_duration is not null"); + return (Criteria) this; + } + + public Criteria andRecvDurationEqualTo(Integer value) { + addCriterion("recv_duration =", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationNotEqualTo(Integer value) { + addCriterion("recv_duration <>", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationGreaterThan(Integer value) { + addCriterion("recv_duration >", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("recv_duration >=", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationLessThan(Integer value) { + addCriterion("recv_duration <", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationLessThanOrEqualTo(Integer value) { + addCriterion("recv_duration <=", value, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationIn(List values) { + addCriterion("recv_duration in", values, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationNotIn(List values) { + addCriterion("recv_duration not in", values, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationBetween(Integer value1, Integer value2) { + addCriterion("recv_duration between", value1, value2, "recvDuration"); + return (Criteria) this; + } + + public Criteria andRecvDurationNotBetween(Integer value1, Integer value2) { + addCriterion("recv_duration not between", value1, value2, "recvDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationIsNull() { + addCriterion("send_duration is null"); + return (Criteria) this; + } + + public Criteria andSendDurationIsNotNull() { + addCriterion("send_duration is not null"); + return (Criteria) this; + } + + public Criteria andSendDurationEqualTo(Integer value) { + addCriterion("send_duration =", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationNotEqualTo(Integer value) { + addCriterion("send_duration <>", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationGreaterThan(Integer value) { + addCriterion("send_duration >", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("send_duration >=", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationLessThan(Integer value) { + addCriterion("send_duration <", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationLessThanOrEqualTo(Integer value) { + addCriterion("send_duration <=", value, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationIn(List values) { + addCriterion("send_duration in", values, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationNotIn(List values) { + addCriterion("send_duration not in", values, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationBetween(Integer value1, Integer value2) { + addCriterion("send_duration between", value1, value2, "sendDuration"); + return (Criteria) this; + } + + public Criteria andSendDurationNotBetween(Integer value1, Integer value2) { + addCriterion("send_duration not between", value1, value2, "sendDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationIsNull() { + addCriterion("wait_duration is null"); + return (Criteria) this; + } + + public Criteria andWaitDurationIsNotNull() { + addCriterion("wait_duration is not null"); + return (Criteria) this; + } + + public Criteria andWaitDurationEqualTo(Integer value) { + addCriterion("wait_duration =", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationNotEqualTo(Integer value) { + addCriterion("wait_duration <>", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationGreaterThan(Integer value) { + addCriterion("wait_duration >", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("wait_duration >=", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationLessThan(Integer value) { + addCriterion("wait_duration <", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationLessThanOrEqualTo(Integer value) { + addCriterion("wait_duration <=", value, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationIn(List values) { + addCriterion("wait_duration in", values, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationNotIn(List values) { + addCriterion("wait_duration not in", values, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationBetween(Integer value1, Integer value2) { + addCriterion("wait_duration between", value1, value2, "waitDuration"); + return (Criteria) this; + } + + public Criteria andWaitDurationNotBetween(Integer value1, Integer value2) { + addCriterion("wait_duration not between", value1, value2, "waitDuration"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andApiUriIsNull() { + addCriterion("api_uri is null"); + return (Criteria) this; + } + + public Criteria andApiUriIsNotNull() { + addCriterion("api_uri is not null"); + return (Criteria) this; + } + + public Criteria andApiUriEqualTo(String value) { + addCriterion("api_uri =", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriNotEqualTo(String value) { + addCriterion("api_uri <>", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriGreaterThan(String value) { + addCriterion("api_uri >", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriGreaterThanOrEqualTo(String value) { + addCriterion("api_uri >=", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriLessThan(String value) { + addCriterion("api_uri <", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriLessThanOrEqualTo(String value) { + addCriterion("api_uri <=", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriLike(String value) { + addCriterion("api_uri like", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriNotLike(String value) { + addCriterion("api_uri not like", value, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriIn(List values) { + addCriterion("api_uri in", values, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriNotIn(List values) { + addCriterion("api_uri not in", values, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriBetween(String value1, String value2) { + addCriterion("api_uri between", value1, value2, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiUriNotBetween(String value1, String value2) { + addCriterion("api_uri not between", value1, value2, "apiUri"); + return (Criteria) this; + } + + public Criteria andApiMethodIsNull() { + addCriterion("api_method is null"); + return (Criteria) this; + } + + public Criteria andApiMethodIsNotNull() { + addCriterion("api_method is not null"); + return (Criteria) this; + } + + public Criteria andApiMethodEqualTo(String value) { + addCriterion("api_method =", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodNotEqualTo(String value) { + addCriterion("api_method <>", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodGreaterThan(String value) { + addCriterion("api_method >", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodGreaterThanOrEqualTo(String value) { + addCriterion("api_method >=", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodLessThan(String value) { + addCriterion("api_method <", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodLessThanOrEqualTo(String value) { + addCriterion("api_method <=", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodLike(String value) { + addCriterion("api_method like", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodNotLike(String value) { + addCriterion("api_method not like", value, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodIn(List values) { + addCriterion("api_method in", values, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodNotIn(List values) { + addCriterion("api_method not in", values, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodBetween(String value1, String value2) { + addCriterion("api_method between", value1, value2, "apiMethod"); + return (Criteria) this; + } + + public Criteria andApiMethodNotBetween(String value1, String value2) { + addCriterion("api_method not between", value1, value2, "apiMethod"); + return (Criteria) this; + } + + public Criteria andSerialIdIsNull() { + addCriterion("serial_id is null"); + return (Criteria) this; + } + + public Criteria andSerialIdIsNotNull() { + addCriterion("serial_id is not null"); + return (Criteria) this; + } + + public Criteria andSerialIdEqualTo(Long value) { + addCriterion("serial_id =", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdNotEqualTo(Long value) { + addCriterion("serial_id <>", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdGreaterThan(Long value) { + addCriterion("serial_id >", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdGreaterThanOrEqualTo(Long value) { + addCriterion("serial_id >=", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdLessThan(Long value) { + addCriterion("serial_id <", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdLessThanOrEqualTo(Long value) { + addCriterion("serial_id <=", value, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdIn(List values) { + addCriterion("serial_id in", values, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdNotIn(List values) { + addCriterion("serial_id not in", values, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdBetween(Long value1, Long value2) { + addCriterion("serial_id between", value1, value2, "serialId"); + return (Criteria) this; + } + + public Criteria andSerialIdNotBetween(Long value1, Long value2) { + addCriterion("serial_id not between", value1, value2, "serialId"); + return (Criteria) this; + } + + public Criteria andTaskIdIsNull() { + addCriterion("task_id is null"); + return (Criteria) this; + } + + public Criteria andTaskIdIsNotNull() { + addCriterion("task_id is not null"); + return (Criteria) this; + } + + public Criteria andTaskIdEqualTo(Long value) { + addCriterion("task_id =", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotEqualTo(Long value) { + addCriterion("task_id <>", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThan(Long value) { + addCriterion("task_id >", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThanOrEqualTo(Long value) { + addCriterion("task_id >=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThan(Long value) { + addCriterion("task_id <", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThanOrEqualTo(Long value) { + addCriterion("task_id <=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdIn(List values) { + addCriterion("task_id in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotIn(List values) { + addCriterion("task_id not in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdBetween(Long value1, Long value2) { + addCriterion("task_id between", value1, value2, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotBetween(Long value1, Long value2) { + addCriterion("task_id not between", value1, value2, "taskId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfo.java new file mode 100644 index 000000000..bfbdddf69 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfo.java @@ -0,0 +1,131 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class CheckPointInfo { + private Integer id; + + private Integer checkType; + + private String checkObj; + + private Integer checkCondition; + + private String checkContent; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getCheckType() { + return checkType; + } + + public void setCheckType(Integer checkType) { + this.checkType = checkType; + } + + public String getCheckObj() { + return checkObj; + } + + public void setCheckObj(String checkObj) { + this.checkObj = checkObj == null ? null : checkObj.trim(); + } + + public Integer getCheckCondition() { + return checkCondition; + } + + public void setCheckCondition(Integer checkCondition) { + this.checkCondition = checkCondition; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent == null ? null : checkContent.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + checkType("check_type", "checkType", "INTEGER", false), + checkObj("check_obj", "checkObj", "VARCHAR", false), + checkCondition("check_condition", "checkCondition", "INTEGER", false), + checkContent("check_content", "checkContent", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfoExample.java new file mode 100644 index 000000000..6efd991ec --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/CheckPointInfoExample.java @@ -0,0 +1,450 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class CheckPointInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public CheckPointInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCheckTypeIsNull() { + addCriterion("check_type is null"); + return (Criteria) this; + } + + public Criteria andCheckTypeIsNotNull() { + addCriterion("check_type is not null"); + return (Criteria) this; + } + + public Criteria andCheckTypeEqualTo(Integer value) { + addCriterion("check_type =", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeNotEqualTo(Integer value) { + addCriterion("check_type <>", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeGreaterThan(Integer value) { + addCriterion("check_type >", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("check_type >=", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeLessThan(Integer value) { + addCriterion("check_type <", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeLessThanOrEqualTo(Integer value) { + addCriterion("check_type <=", value, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeIn(List values) { + addCriterion("check_type in", values, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeNotIn(List values) { + addCriterion("check_type not in", values, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeBetween(Integer value1, Integer value2) { + addCriterion("check_type between", value1, value2, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckTypeNotBetween(Integer value1, Integer value2) { + addCriterion("check_type not between", value1, value2, "checkType"); + return (Criteria) this; + } + + public Criteria andCheckObjIsNull() { + addCriterion("check_obj is null"); + return (Criteria) this; + } + + public Criteria andCheckObjIsNotNull() { + addCriterion("check_obj is not null"); + return (Criteria) this; + } + + public Criteria andCheckObjEqualTo(String value) { + addCriterion("check_obj =", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjNotEqualTo(String value) { + addCriterion("check_obj <>", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjGreaterThan(String value) { + addCriterion("check_obj >", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjGreaterThanOrEqualTo(String value) { + addCriterion("check_obj >=", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjLessThan(String value) { + addCriterion("check_obj <", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjLessThanOrEqualTo(String value) { + addCriterion("check_obj <=", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjLike(String value) { + addCriterion("check_obj like", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjNotLike(String value) { + addCriterion("check_obj not like", value, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjIn(List values) { + addCriterion("check_obj in", values, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjNotIn(List values) { + addCriterion("check_obj not in", values, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjBetween(String value1, String value2) { + addCriterion("check_obj between", value1, value2, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckObjNotBetween(String value1, String value2) { + addCriterion("check_obj not between", value1, value2, "checkObj"); + return (Criteria) this; + } + + public Criteria andCheckConditionIsNull() { + addCriterion("check_condition is null"); + return (Criteria) this; + } + + public Criteria andCheckConditionIsNotNull() { + addCriterion("check_condition is not null"); + return (Criteria) this; + } + + public Criteria andCheckConditionEqualTo(Integer value) { + addCriterion("check_condition =", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionNotEqualTo(Integer value) { + addCriterion("check_condition <>", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionGreaterThan(Integer value) { + addCriterion("check_condition >", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionGreaterThanOrEqualTo(Integer value) { + addCriterion("check_condition >=", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionLessThan(Integer value) { + addCriterion("check_condition <", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionLessThanOrEqualTo(Integer value) { + addCriterion("check_condition <=", value, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionIn(List values) { + addCriterion("check_condition in", values, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionNotIn(List values) { + addCriterion("check_condition not in", values, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionBetween(Integer value1, Integer value2) { + addCriterion("check_condition between", value1, value2, "checkCondition"); + return (Criteria) this; + } + + public Criteria andCheckConditionNotBetween(Integer value1, Integer value2) { + addCriterion("check_condition not between", value1, value2, "checkCondition"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Dataset.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Dataset.java new file mode 100644 index 000000000..19282baed --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Dataset.java @@ -0,0 +1,296 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class Dataset { + private Integer id; + + private String name; + + private String note; + + private Integer type; + + private String defaultParamName; + + private Integer ignoreFirstRow; + + private String fileName; + + private String fileUrl; + + private String fileKsKey; + + private Long fileRows; + + private Long fileSize; + + private String interfaceUrl; + + private Integer trafficRecordId; + + private Long ctime; + + private Long utime; + + private String creator; + + private String updater; + + private String tenant; + + private String previewFileRows; + + private String header; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note == null ? null : note.trim(); + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getDefaultParamName() { + return defaultParamName; + } + + public void setDefaultParamName(String defaultParamName) { + this.defaultParamName = defaultParamName == null ? null : defaultParamName.trim(); + } + + public Integer getIgnoreFirstRow() { + return ignoreFirstRow; + } + + public void setIgnoreFirstRow(Integer ignoreFirstRow) { + this.ignoreFirstRow = ignoreFirstRow; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName == null ? null : fileName.trim(); + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl == null ? null : fileUrl.trim(); + } + + public String getFileKsKey() { + return fileKsKey; + } + + public void setFileKsKey(String fileKsKey) { + this.fileKsKey = fileKsKey == null ? null : fileKsKey.trim(); + } + + public Long getFileRows() { + return fileRows; + } + + public void setFileRows(Long fileRows) { + this.fileRows = fileRows; + } + + public Long getFileSize() { + return fileSize; + } + + public void setFileSize(Long fileSize) { + this.fileSize = fileSize; + } + + public String getInterfaceUrl() { + return interfaceUrl; + } + + public void setInterfaceUrl(String interfaceUrl) { + this.interfaceUrl = interfaceUrl == null ? null : interfaceUrl.trim(); + } + + public Integer getTrafficRecordId() { + return trafficRecordId; + } + + public void setTrafficRecordId(Integer trafficRecordId) { + this.trafficRecordId = trafficRecordId; + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public String getUpdater() { + return updater; + } + + public void setUpdater(String updater) { + this.updater = updater == null ? null : updater.trim(); + } + + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant == null ? null : tenant.trim(); + } + + public String getPreviewFileRows() { + return previewFileRows; + } + + public void setPreviewFileRows(String previewFileRows) { + this.previewFileRows = previewFileRows == null ? null : previewFileRows.trim(); + } + + public String getHeader() { + return header; + } + + public void setHeader(String header) { + this.header = header == null ? null : header.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", false), + note("note", "note", "VARCHAR", false), + type("type", "type", "INTEGER", false), + defaultParamName("default_param_name", "defaultParamName", "VARCHAR", false), + ignoreFirstRow("ignore_first_row", "ignoreFirstRow", "INTEGER", false), + fileName("file_name", "fileName", "VARCHAR", false), + fileUrl("file_url", "fileUrl", "VARCHAR", false), + fileKsKey("file_ks_key", "fileKsKey", "VARCHAR", false), + fileRows("file_rows", "fileRows", "BIGINT", false), + fileSize("file_size", "fileSize", "BIGINT", false), + interfaceUrl("interface_url", "interfaceUrl", "VARCHAR", false), + trafficRecordId("traffic_record_id", "trafficRecordId", "INTEGER", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + creator("creator", "creator", "VARCHAR", false), + updater("updater", "updater", "VARCHAR", false), + tenant("tenant", "tenant", "VARCHAR", false), + previewFileRows("preview_file_rows", "previewFileRows", "LONGVARCHAR", false), + header("header", "header", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetExample.java new file mode 100644 index 000000000..34981f96e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetExample.java @@ -0,0 +1,1380 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class DatasetExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DatasetExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNoteIsNull() { + addCriterion("note is null"); + return (Criteria) this; + } + + public Criteria andNoteIsNotNull() { + addCriterion("note is not null"); + return (Criteria) this; + } + + public Criteria andNoteEqualTo(String value) { + addCriterion("note =", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotEqualTo(String value) { + addCriterion("note <>", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThan(String value) { + addCriterion("note >", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThanOrEqualTo(String value) { + addCriterion("note >=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThan(String value) { + addCriterion("note <", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThanOrEqualTo(String value) { + addCriterion("note <=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLike(String value) { + addCriterion("note like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotLike(String value) { + addCriterion("note not like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteIn(List values) { + addCriterion("note in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotIn(List values) { + addCriterion("note not in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteBetween(String value1, String value2) { + addCriterion("note between", value1, value2, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotBetween(String value1, String value2) { + addCriterion("note not between", value1, value2, "note"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameIsNull() { + addCriterion("default_param_name is null"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameIsNotNull() { + addCriterion("default_param_name is not null"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameEqualTo(String value) { + addCriterion("default_param_name =", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameNotEqualTo(String value) { + addCriterion("default_param_name <>", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameGreaterThan(String value) { + addCriterion("default_param_name >", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameGreaterThanOrEqualTo(String value) { + addCriterion("default_param_name >=", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameLessThan(String value) { + addCriterion("default_param_name <", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameLessThanOrEqualTo(String value) { + addCriterion("default_param_name <=", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameLike(String value) { + addCriterion("default_param_name like", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameNotLike(String value) { + addCriterion("default_param_name not like", value, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameIn(List values) { + addCriterion("default_param_name in", values, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameNotIn(List values) { + addCriterion("default_param_name not in", values, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameBetween(String value1, String value2) { + addCriterion("default_param_name between", value1, value2, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andDefaultParamNameNotBetween(String value1, String value2) { + addCriterion("default_param_name not between", value1, value2, "defaultParamName"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowIsNull() { + addCriterion("ignore_first_row is null"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowIsNotNull() { + addCriterion("ignore_first_row is not null"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowEqualTo(Integer value) { + addCriterion("ignore_first_row =", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowNotEqualTo(Integer value) { + addCriterion("ignore_first_row <>", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowGreaterThan(Integer value) { + addCriterion("ignore_first_row >", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowGreaterThanOrEqualTo(Integer value) { + addCriterion("ignore_first_row >=", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowLessThan(Integer value) { + addCriterion("ignore_first_row <", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowLessThanOrEqualTo(Integer value) { + addCriterion("ignore_first_row <=", value, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowIn(List values) { + addCriterion("ignore_first_row in", values, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowNotIn(List values) { + addCriterion("ignore_first_row not in", values, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowBetween(Integer value1, Integer value2) { + addCriterion("ignore_first_row between", value1, value2, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andIgnoreFirstRowNotBetween(Integer value1, Integer value2) { + addCriterion("ignore_first_row not between", value1, value2, "ignoreFirstRow"); + return (Criteria) this; + } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileUrlIsNull() { + addCriterion("file_url is null"); + return (Criteria) this; + } + + public Criteria andFileUrlIsNotNull() { + addCriterion("file_url is not null"); + return (Criteria) this; + } + + public Criteria andFileUrlEqualTo(String value) { + addCriterion("file_url =", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotEqualTo(String value) { + addCriterion("file_url <>", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlGreaterThan(String value) { + addCriterion("file_url >", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlGreaterThanOrEqualTo(String value) { + addCriterion("file_url >=", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLessThan(String value) { + addCriterion("file_url <", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLessThanOrEqualTo(String value) { + addCriterion("file_url <=", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLike(String value) { + addCriterion("file_url like", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotLike(String value) { + addCriterion("file_url not like", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlIn(List values) { + addCriterion("file_url in", values, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotIn(List values) { + addCriterion("file_url not in", values, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlBetween(String value1, String value2) { + addCriterion("file_url between", value1, value2, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotBetween(String value1, String value2) { + addCriterion("file_url not between", value1, value2, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileKsKeyIsNull() { + addCriterion("file_ks_key is null"); + return (Criteria) this; + } + + public Criteria andFileKsKeyIsNotNull() { + addCriterion("file_ks_key is not null"); + return (Criteria) this; + } + + public Criteria andFileKsKeyEqualTo(String value) { + addCriterion("file_ks_key =", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyNotEqualTo(String value) { + addCriterion("file_ks_key <>", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyGreaterThan(String value) { + addCriterion("file_ks_key >", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyGreaterThanOrEqualTo(String value) { + addCriterion("file_ks_key >=", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyLessThan(String value) { + addCriterion("file_ks_key <", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyLessThanOrEqualTo(String value) { + addCriterion("file_ks_key <=", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyLike(String value) { + addCriterion("file_ks_key like", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyNotLike(String value) { + addCriterion("file_ks_key not like", value, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyIn(List values) { + addCriterion("file_ks_key in", values, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyNotIn(List values) { + addCriterion("file_ks_key not in", values, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyBetween(String value1, String value2) { + addCriterion("file_ks_key between", value1, value2, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileKsKeyNotBetween(String value1, String value2) { + addCriterion("file_ks_key not between", value1, value2, "fileKsKey"); + return (Criteria) this; + } + + public Criteria andFileRowsIsNull() { + addCriterion("file_rows is null"); + return (Criteria) this; + } + + public Criteria andFileRowsIsNotNull() { + addCriterion("file_rows is not null"); + return (Criteria) this; + } + + public Criteria andFileRowsEqualTo(Long value) { + addCriterion("file_rows =", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsNotEqualTo(Long value) { + addCriterion("file_rows <>", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsGreaterThan(Long value) { + addCriterion("file_rows >", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsGreaterThanOrEqualTo(Long value) { + addCriterion("file_rows >=", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsLessThan(Long value) { + addCriterion("file_rows <", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsLessThanOrEqualTo(Long value) { + addCriterion("file_rows <=", value, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsIn(List values) { + addCriterion("file_rows in", values, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsNotIn(List values) { + addCriterion("file_rows not in", values, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsBetween(Long value1, Long value2) { + addCriterion("file_rows between", value1, value2, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileRowsNotBetween(Long value1, Long value2) { + addCriterion("file_rows not between", value1, value2, "fileRows"); + return (Criteria) this; + } + + public Criteria andFileSizeIsNull() { + addCriterion("file_size is null"); + return (Criteria) this; + } + + public Criteria andFileSizeIsNotNull() { + addCriterion("file_size is not null"); + return (Criteria) this; + } + + public Criteria andFileSizeEqualTo(Long value) { + addCriterion("file_size =", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeNotEqualTo(Long value) { + addCriterion("file_size <>", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeGreaterThan(Long value) { + addCriterion("file_size >", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeGreaterThanOrEqualTo(Long value) { + addCriterion("file_size >=", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeLessThan(Long value) { + addCriterion("file_size <", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeLessThanOrEqualTo(Long value) { + addCriterion("file_size <=", value, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeIn(List values) { + addCriterion("file_size in", values, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeNotIn(List values) { + addCriterion("file_size not in", values, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeBetween(Long value1, Long value2) { + addCriterion("file_size between", value1, value2, "fileSize"); + return (Criteria) this; + } + + public Criteria andFileSizeNotBetween(Long value1, Long value2) { + addCriterion("file_size not between", value1, value2, "fileSize"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlIsNull() { + addCriterion("interface_url is null"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlIsNotNull() { + addCriterion("interface_url is not null"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlEqualTo(String value) { + addCriterion("interface_url =", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlNotEqualTo(String value) { + addCriterion("interface_url <>", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlGreaterThan(String value) { + addCriterion("interface_url >", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlGreaterThanOrEqualTo(String value) { + addCriterion("interface_url >=", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlLessThan(String value) { + addCriterion("interface_url <", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlLessThanOrEqualTo(String value) { + addCriterion("interface_url <=", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlLike(String value) { + addCriterion("interface_url like", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlNotLike(String value) { + addCriterion("interface_url not like", value, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlIn(List values) { + addCriterion("interface_url in", values, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlNotIn(List values) { + addCriterion("interface_url not in", values, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlBetween(String value1, String value2) { + addCriterion("interface_url between", value1, value2, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andInterfaceUrlNotBetween(String value1, String value2) { + addCriterion("interface_url not between", value1, value2, "interfaceUrl"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdIsNull() { + addCriterion("traffic_record_id is null"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdIsNotNull() { + addCriterion("traffic_record_id is not null"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdEqualTo(Integer value) { + addCriterion("traffic_record_id =", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdNotEqualTo(Integer value) { + addCriterion("traffic_record_id <>", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdGreaterThan(Integer value) { + addCriterion("traffic_record_id >", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdGreaterThanOrEqualTo(Integer value) { + addCriterion("traffic_record_id >=", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdLessThan(Integer value) { + addCriterion("traffic_record_id <", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdLessThanOrEqualTo(Integer value) { + addCriterion("traffic_record_id <=", value, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdIn(List values) { + addCriterion("traffic_record_id in", values, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdNotIn(List values) { + addCriterion("traffic_record_id not in", values, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdBetween(Integer value1, Integer value2) { + addCriterion("traffic_record_id between", value1, value2, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andTrafficRecordIdNotBetween(Integer value1, Integer value2) { + addCriterion("traffic_record_id not between", value1, value2, "trafficRecordId"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(String value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(String value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(String value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(String value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(String value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(String value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLike(String value) { + addCriterion("updater like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotLike(String value) { + addCriterion("updater not like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(String value1, String value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(String value1, String value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andTenantIsNull() { + addCriterion("tenant is null"); + return (Criteria) this; + } + + public Criteria andTenantIsNotNull() { + addCriterion("tenant is not null"); + return (Criteria) this; + } + + public Criteria andTenantEqualTo(String value) { + addCriterion("tenant =", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotEqualTo(String value) { + addCriterion("tenant <>", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThan(String value) { + addCriterion("tenant >", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThanOrEqualTo(String value) { + addCriterion("tenant >=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThan(String value) { + addCriterion("tenant <", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThanOrEqualTo(String value) { + addCriterion("tenant <=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLike(String value) { + addCriterion("tenant like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotLike(String value) { + addCriterion("tenant not like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantIn(List values) { + addCriterion("tenant in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotIn(List values) { + addCriterion("tenant not in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantBetween(String value1, String value2) { + addCriterion("tenant between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotBetween(String value1, String value2) { + addCriterion("tenant not between", value1, value2, "tenant"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelation.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelation.java new file mode 100644 index 000000000..35883f630 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelation.java @@ -0,0 +1,164 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class DatasetSceneRelation { + private Integer id; + + private Integer datasetId; + + private Integer sceneId; + + private Long ctime; + + private Long utime; + + private String creator; + + private String updater; + + private Boolean enable; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getDatasetId() { + return datasetId; + } + + public void setDatasetId(Integer datasetId) { + this.datasetId = datasetId; + } + + public Integer getSceneId() { + return sceneId; + } + + public void setSceneId(Integer sceneId) { + this.sceneId = sceneId; + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public String getUpdater() { + return updater; + } + + public void setUpdater(String updater) { + this.updater = updater == null ? null : updater.trim(); + } + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public enum Column { + id("id", "id", "INTEGER", false), + datasetId("dataset_id", "datasetId", "INTEGER", false), + sceneId("scene_id", "sceneId", "INTEGER", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + creator("creator", "creator", "VARCHAR", false), + updater("updater", "updater", "VARCHAR", false), + enable("enable", "enable", "BIT", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelationExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelationExample.java new file mode 100644 index 000000000..01a8101da --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DatasetSceneRelationExample.java @@ -0,0 +1,700 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class DatasetSceneRelationExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DatasetSceneRelationExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andDatasetIdIsNull() { + addCriterion("dataset_id is null"); + return (Criteria) this; + } + + public Criteria andDatasetIdIsNotNull() { + addCriterion("dataset_id is not null"); + return (Criteria) this; + } + + public Criteria andDatasetIdEqualTo(Integer value) { + addCriterion("dataset_id =", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdNotEqualTo(Integer value) { + addCriterion("dataset_id <>", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdGreaterThan(Integer value) { + addCriterion("dataset_id >", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdGreaterThanOrEqualTo(Integer value) { + addCriterion("dataset_id >=", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdLessThan(Integer value) { + addCriterion("dataset_id <", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdLessThanOrEqualTo(Integer value) { + addCriterion("dataset_id <=", value, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdIn(List values) { + addCriterion("dataset_id in", values, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdNotIn(List values) { + addCriterion("dataset_id not in", values, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdBetween(Integer value1, Integer value2) { + addCriterion("dataset_id between", value1, value2, "datasetId"); + return (Criteria) this; + } + + public Criteria andDatasetIdNotBetween(Integer value1, Integer value2) { + addCriterion("dataset_id not between", value1, value2, "datasetId"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Integer value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Integer value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Integer value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Integer value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Integer value1, Integer value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(String value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(String value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(String value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(String value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(String value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(String value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLike(String value) { + addCriterion("updater like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotLike(String value) { + addCriterion("updater not like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(String value1, String value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(String value1, String value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("enable is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("enable is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("enable =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("enable <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("enable >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("enable >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("enable <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("enable <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("enable in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("enable not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("enable between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("enable not between", value1, value2, "enable"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfo.java new file mode 100644 index 000000000..1edffe568 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfo.java @@ -0,0 +1,153 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class DomainApplyInfo { + private Integer id; + + private String applyUser; + + private String domain; + + private String ip; + + private Integer applyStatus; + + private Long ctime; + + private String agentIpList; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getApplyUser() { + return applyUser; + } + + public void setApplyUser(String applyUser) { + this.applyUser = applyUser == null ? null : applyUser.trim(); + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain == null ? null : domain.trim(); + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip == null ? null : ip.trim(); + } + + public Integer getApplyStatus() { + return applyStatus; + } + + public void setApplyStatus(Integer applyStatus) { + this.applyStatus = applyStatus; + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public String getAgentIpList() { + return agentIpList; + } + + public void setAgentIpList(String agentIpList) { + this.agentIpList = agentIpList == null ? null : agentIpList.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + applyUser("apply_user", "applyUser", "VARCHAR", false), + domain("domain", "domain", "VARCHAR", false), + ip("ip", "ip", "VARCHAR", false), + applyStatus("apply_status", "applyStatus", "INTEGER", false), + ctime("ctime", "ctime", "BIGINT", false), + agentIpList("agent_ip_list", "agentIpList", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfoExample.java new file mode 100644 index 000000000..d87d8627f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/DomainApplyInfoExample.java @@ -0,0 +1,590 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class DomainApplyInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DomainApplyInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andApplyUserIsNull() { + addCriterion("apply_user is null"); + return (Criteria) this; + } + + public Criteria andApplyUserIsNotNull() { + addCriterion("apply_user is not null"); + return (Criteria) this; + } + + public Criteria andApplyUserEqualTo(String value) { + addCriterion("apply_user =", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotEqualTo(String value) { + addCriterion("apply_user <>", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserGreaterThan(String value) { + addCriterion("apply_user >", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserGreaterThanOrEqualTo(String value) { + addCriterion("apply_user >=", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLessThan(String value) { + addCriterion("apply_user <", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLessThanOrEqualTo(String value) { + addCriterion("apply_user <=", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserLike(String value) { + addCriterion("apply_user like", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotLike(String value) { + addCriterion("apply_user not like", value, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserIn(List values) { + addCriterion("apply_user in", values, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotIn(List values) { + addCriterion("apply_user not in", values, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserBetween(String value1, String value2) { + addCriterion("apply_user between", value1, value2, "applyUser"); + return (Criteria) this; + } + + public Criteria andApplyUserNotBetween(String value1, String value2) { + addCriterion("apply_user not between", value1, value2, "applyUser"); + return (Criteria) this; + } + + public Criteria andDomainIsNull() { + addCriterion("domain is null"); + return (Criteria) this; + } + + public Criteria andDomainIsNotNull() { + addCriterion("domain is not null"); + return (Criteria) this; + } + + public Criteria andDomainEqualTo(String value) { + addCriterion("domain =", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainNotEqualTo(String value) { + addCriterion("domain <>", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainGreaterThan(String value) { + addCriterion("domain >", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainGreaterThanOrEqualTo(String value) { + addCriterion("domain >=", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainLessThan(String value) { + addCriterion("domain <", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainLessThanOrEqualTo(String value) { + addCriterion("domain <=", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainLike(String value) { + addCriterion("domain like", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainNotLike(String value) { + addCriterion("domain not like", value, "domain"); + return (Criteria) this; + } + + public Criteria andDomainIn(List values) { + addCriterion("domain in", values, "domain"); + return (Criteria) this; + } + + public Criteria andDomainNotIn(List values) { + addCriterion("domain not in", values, "domain"); + return (Criteria) this; + } + + public Criteria andDomainBetween(String value1, String value2) { + addCriterion("domain between", value1, value2, "domain"); + return (Criteria) this; + } + + public Criteria andDomainNotBetween(String value1, String value2) { + addCriterion("domain not between", value1, value2, "domain"); + return (Criteria) this; + } + + public Criteria andIpIsNull() { + addCriterion("ip is null"); + return (Criteria) this; + } + + public Criteria andIpIsNotNull() { + addCriterion("ip is not null"); + return (Criteria) this; + } + + public Criteria andIpEqualTo(String value) { + addCriterion("ip =", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotEqualTo(String value) { + addCriterion("ip <>", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThan(String value) { + addCriterion("ip >", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThanOrEqualTo(String value) { + addCriterion("ip >=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThan(String value) { + addCriterion("ip <", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThanOrEqualTo(String value) { + addCriterion("ip <=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLike(String value) { + addCriterion("ip like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotLike(String value) { + addCriterion("ip not like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpIn(List values) { + addCriterion("ip in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotIn(List values) { + addCriterion("ip not in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpBetween(String value1, String value2) { + addCriterion("ip between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotBetween(String value1, String value2) { + addCriterion("ip not between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andApplyStatusIsNull() { + addCriterion("apply_status is null"); + return (Criteria) this; + } + + public Criteria andApplyStatusIsNotNull() { + addCriterion("apply_status is not null"); + return (Criteria) this; + } + + public Criteria andApplyStatusEqualTo(Integer value) { + addCriterion("apply_status =", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotEqualTo(Integer value) { + addCriterion("apply_status <>", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusGreaterThan(Integer value) { + addCriterion("apply_status >", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("apply_status >=", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusLessThan(Integer value) { + addCriterion("apply_status <", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusLessThanOrEqualTo(Integer value) { + addCriterion("apply_status <=", value, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusIn(List values) { + addCriterion("apply_status in", values, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotIn(List values) { + addCriterion("apply_status not in", values, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusBetween(Integer value1, Integer value2) { + addCriterion("apply_status between", value1, value2, "applyStatus"); + return (Criteria) this; + } + + public Criteria andApplyStatusNotBetween(Integer value1, Integer value2) { + addCriterion("apply_status not between", value1, value2, "applyStatus"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Hello.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Hello.java new file mode 100644 index 000000000..913becba2 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Hello.java @@ -0,0 +1,98 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class Hello { + private Integer id; + + private String name; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/HelloExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/HelloExample.java new file mode 100644 index 000000000..853897c40 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/HelloExample.java @@ -0,0 +1,330 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class HelloExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public HelloExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTask.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTask.java new file mode 100644 index 000000000..c339f33cf --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTask.java @@ -0,0 +1,450 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class MibenchTask { + private Integer id; + + private Integer qps; + + private Integer originQps; + + private Integer maxQps; + + private Integer sceneId; + + private Integer serialLinkId; + + private Integer sceneApiId; + + private Integer time; + + private Integer agentNum; + + private Integer finishAgentNum; + + private Long ctime; + + private Long utime; + + private Integer state; + + private Integer version; + + private Long successNum; + + private Long failureNum; + + private Integer taskType; + + private Integer parentTaskId; + + private String reportId; + + private Integer reqParamType; + + private Boolean ok; + + private Integer connectTaskNum; + + private Integer debugRt; + + private Integer debugSize; + + private Integer benchMode; + + private Integer increaseMode; + + private Integer increasePercent; + + private String debugResult; + + private String debugResultHeader; + + private String requestParams; + + private String debugTriggerCp; + + private String debugTriggerFilterCondition; + + private String debugReqHeaders; + + private String debugUrl; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getQps() { + return qps; + } + + public void setQps(Integer qps) { + this.qps = qps; + } + + public Integer getOriginQps() { + return originQps; + } + + public void setOriginQps(Integer originQps) { + this.originQps = originQps; + } + + public Integer getMaxQps() { + return maxQps; + } + + public void setMaxQps(Integer maxQps) { + this.maxQps = maxQps; + } + + public Integer getSceneId() { + return sceneId; + } + + public void setSceneId(Integer sceneId) { + this.sceneId = sceneId; + } + + public Integer getSerialLinkId() { + return serialLinkId; + } + + public void setSerialLinkId(Integer serialLinkId) { + this.serialLinkId = serialLinkId; + } + + public Integer getSceneApiId() { + return sceneApiId; + } + + public void setSceneApiId(Integer sceneApiId) { + this.sceneApiId = sceneApiId; + } + + public Integer getTime() { + return time; + } + + public void setTime(Integer time) { + this.time = time; + } + + public Integer getAgentNum() { + return agentNum; + } + + public void setAgentNum(Integer agentNum) { + this.agentNum = agentNum; + } + + public Integer getFinishAgentNum() { + return finishAgentNum; + } + + public void setFinishAgentNum(Integer finishAgentNum) { + this.finishAgentNum = finishAgentNum; + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } + + public Long getSuccessNum() { + return successNum; + } + + public void setSuccessNum(Long successNum) { + this.successNum = successNum; + } + + public Long getFailureNum() { + return failureNum; + } + + public void setFailureNum(Long failureNum) { + this.failureNum = failureNum; + } + + public Integer getTaskType() { + return taskType; + } + + public void setTaskType(Integer taskType) { + this.taskType = taskType; + } + + public Integer getParentTaskId() { + return parentTaskId; + } + + public void setParentTaskId(Integer parentTaskId) { + this.parentTaskId = parentTaskId; + } + + public String getReportId() { + return reportId; + } + + public void setReportId(String reportId) { + this.reportId = reportId == null ? null : reportId.trim(); + } + + public Integer getReqParamType() { + return reqParamType; + } + + public void setReqParamType(Integer reqParamType) { + this.reqParamType = reqParamType; + } + + public Boolean getOk() { + return ok; + } + + public void setOk(Boolean ok) { + this.ok = ok; + } + + public Integer getConnectTaskNum() { + return connectTaskNum; + } + + public void setConnectTaskNum(Integer connectTaskNum) { + this.connectTaskNum = connectTaskNum; + } + + public Integer getDebugRt() { + return debugRt; + } + + public void setDebugRt(Integer debugRt) { + this.debugRt = debugRt; + } + + public Integer getDebugSize() { + return debugSize; + } + + public void setDebugSize(Integer debugSize) { + this.debugSize = debugSize; + } + + public Integer getBenchMode() { + return benchMode; + } + + public void setBenchMode(Integer benchMode) { + this.benchMode = benchMode; + } + + public Integer getIncreaseMode() { + return increaseMode; + } + + public void setIncreaseMode(Integer increaseMode) { + this.increaseMode = increaseMode; + } + + public Integer getIncreasePercent() { + return increasePercent; + } + + public void setIncreasePercent(Integer increasePercent) { + this.increasePercent = increasePercent; + } + + public String getDebugResult() { + return debugResult; + } + + public void setDebugResult(String debugResult) { + this.debugResult = debugResult == null ? null : debugResult.trim(); + } + + public String getDebugResultHeader() { + return debugResultHeader; + } + + public void setDebugResultHeader(String debugResultHeader) { + this.debugResultHeader = debugResultHeader == null ? null : debugResultHeader.trim(); + } + + public String getRequestParams() { + return requestParams; + } + + public void setRequestParams(String requestParams) { + this.requestParams = requestParams == null ? null : requestParams.trim(); + } + + public String getDebugTriggerCp() { + return debugTriggerCp; + } + + public void setDebugTriggerCp(String debugTriggerCp) { + this.debugTriggerCp = debugTriggerCp == null ? null : debugTriggerCp.trim(); + } + + public String getDebugTriggerFilterCondition() { + return debugTriggerFilterCondition; + } + + public void setDebugTriggerFilterCondition(String debugTriggerFilterCondition) { + this.debugTriggerFilterCondition = debugTriggerFilterCondition == null ? null : debugTriggerFilterCondition.trim(); + } + + public String getDebugReqHeaders() { + return debugReqHeaders; + } + + public void setDebugReqHeaders(String debugReqHeaders) { + this.debugReqHeaders = debugReqHeaders == null ? null : debugReqHeaders.trim(); + } + + public String getDebugUrl() { + return debugUrl; + } + + public void setDebugUrl(String debugUrl) { + this.debugUrl = debugUrl == null ? null : debugUrl.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + qps("qps", "qps", "INTEGER", false), + originQps("origin_qps", "originQps", "INTEGER", false), + maxQps("max_qps", "maxQps", "INTEGER", false), + sceneId("scene_id", "sceneId", "INTEGER", false), + serialLinkId("serial_link_id", "serialLinkId", "INTEGER", false), + sceneApiId("scene_api_id", "sceneApiId", "INTEGER", false), + time("time", "time", "INTEGER", false), + agentNum("agent_num", "agentNum", "INTEGER", false), + finishAgentNum("finish_agent_num", "finishAgentNum", "INTEGER", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + state("state", "state", "INTEGER", false), + version("version", "version", "INTEGER", false), + successNum("success_num", "successNum", "BIGINT", false), + failureNum("failure_num", "failureNum", "BIGINT", false), + taskType("task_type", "taskType", "INTEGER", false), + parentTaskId("parent_task_id", "parentTaskId", "INTEGER", false), + reportId("report_id", "reportId", "VARCHAR", false), + reqParamType("req_param_type", "reqParamType", "INTEGER", false), + ok("ok", "ok", "BIT", false), + connectTaskNum("connect_task_num", "connectTaskNum", "INTEGER", false), + debugRt("debug_rt", "debugRt", "INTEGER", false), + debugSize("debug_size", "debugSize", "INTEGER", false), + benchMode("bench_mode", "benchMode", "INTEGER", false), + increaseMode("increase_mode", "increaseMode", "INTEGER", false), + increasePercent("increase_percent", "increasePercent", "INTEGER", false), + debugResult("debug_result", "debugResult", "LONGVARCHAR", false), + debugResultHeader("debug_result_header", "debugResultHeader", "LONGVARCHAR", false), + requestParams("request_params", "requestParams", "LONGVARCHAR", false), + debugTriggerCp("debug_trigger_cp", "debugTriggerCp", "LONGVARCHAR", false), + debugTriggerFilterCondition("debug_trigger_filter_condition", "debugTriggerFilterCondition", "LONGVARCHAR", false), + debugReqHeaders("debug_req_headers", "debugReqHeaders", "LONGVARCHAR", false), + debugUrl("debug_url", "debugUrl", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTaskExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTaskExample.java new file mode 100644 index 000000000..c24dbf071 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/MibenchTaskExample.java @@ -0,0 +1,1830 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class MibenchTaskExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MibenchTaskExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andQpsIsNull() { + addCriterion("qps is null"); + return (Criteria) this; + } + + public Criteria andQpsIsNotNull() { + addCriterion("qps is not null"); + return (Criteria) this; + } + + public Criteria andQpsEqualTo(Integer value) { + addCriterion("qps =", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsNotEqualTo(Integer value) { + addCriterion("qps <>", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsGreaterThan(Integer value) { + addCriterion("qps >", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsGreaterThanOrEqualTo(Integer value) { + addCriterion("qps >=", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsLessThan(Integer value) { + addCriterion("qps <", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsLessThanOrEqualTo(Integer value) { + addCriterion("qps <=", value, "qps"); + return (Criteria) this; + } + + public Criteria andQpsIn(List values) { + addCriterion("qps in", values, "qps"); + return (Criteria) this; + } + + public Criteria andQpsNotIn(List values) { + addCriterion("qps not in", values, "qps"); + return (Criteria) this; + } + + public Criteria andQpsBetween(Integer value1, Integer value2) { + addCriterion("qps between", value1, value2, "qps"); + return (Criteria) this; + } + + public Criteria andQpsNotBetween(Integer value1, Integer value2) { + addCriterion("qps not between", value1, value2, "qps"); + return (Criteria) this; + } + + public Criteria andOriginQpsIsNull() { + addCriterion("origin_qps is null"); + return (Criteria) this; + } + + public Criteria andOriginQpsIsNotNull() { + addCriterion("origin_qps is not null"); + return (Criteria) this; + } + + public Criteria andOriginQpsEqualTo(Integer value) { + addCriterion("origin_qps =", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsNotEqualTo(Integer value) { + addCriterion("origin_qps <>", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsGreaterThan(Integer value) { + addCriterion("origin_qps >", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsGreaterThanOrEqualTo(Integer value) { + addCriterion("origin_qps >=", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsLessThan(Integer value) { + addCriterion("origin_qps <", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsLessThanOrEqualTo(Integer value) { + addCriterion("origin_qps <=", value, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsIn(List values) { + addCriterion("origin_qps in", values, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsNotIn(List values) { + addCriterion("origin_qps not in", values, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsBetween(Integer value1, Integer value2) { + addCriterion("origin_qps between", value1, value2, "originQps"); + return (Criteria) this; + } + + public Criteria andOriginQpsNotBetween(Integer value1, Integer value2) { + addCriterion("origin_qps not between", value1, value2, "originQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsIsNull() { + addCriterion("max_qps is null"); + return (Criteria) this; + } + + public Criteria andMaxQpsIsNotNull() { + addCriterion("max_qps is not null"); + return (Criteria) this; + } + + public Criteria andMaxQpsEqualTo(Integer value) { + addCriterion("max_qps =", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsNotEqualTo(Integer value) { + addCriterion("max_qps <>", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsGreaterThan(Integer value) { + addCriterion("max_qps >", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsGreaterThanOrEqualTo(Integer value) { + addCriterion("max_qps >=", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsLessThan(Integer value) { + addCriterion("max_qps <", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsLessThanOrEqualTo(Integer value) { + addCriterion("max_qps <=", value, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsIn(List values) { + addCriterion("max_qps in", values, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsNotIn(List values) { + addCriterion("max_qps not in", values, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsBetween(Integer value1, Integer value2) { + addCriterion("max_qps between", value1, value2, "maxQps"); + return (Criteria) this; + } + + public Criteria andMaxQpsNotBetween(Integer value1, Integer value2) { + addCriterion("max_qps not between", value1, value2, "maxQps"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Integer value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Integer value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Integer value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Integer value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Integer value1, Integer value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIsNull() { + addCriterion("serial_link_id is null"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIsNotNull() { + addCriterion("serial_link_id is not null"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdEqualTo(Integer value) { + addCriterion("serial_link_id =", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotEqualTo(Integer value) { + addCriterion("serial_link_id <>", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdGreaterThan(Integer value) { + addCriterion("serial_link_id >", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdGreaterThanOrEqualTo(Integer value) { + addCriterion("serial_link_id >=", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdLessThan(Integer value) { + addCriterion("serial_link_id <", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdLessThanOrEqualTo(Integer value) { + addCriterion("serial_link_id <=", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIn(List values) { + addCriterion("serial_link_id in", values, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotIn(List values) { + addCriterion("serial_link_id not in", values, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdBetween(Integer value1, Integer value2) { + addCriterion("serial_link_id between", value1, value2, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotBetween(Integer value1, Integer value2) { + addCriterion("serial_link_id not between", value1, value2, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdIsNull() { + addCriterion("scene_api_id is null"); + return (Criteria) this; + } + + public Criteria andSceneApiIdIsNotNull() { + addCriterion("scene_api_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneApiIdEqualTo(Integer value) { + addCriterion("scene_api_id =", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdNotEqualTo(Integer value) { + addCriterion("scene_api_id <>", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdGreaterThan(Integer value) { + addCriterion("scene_api_id >", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_api_id >=", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdLessThan(Integer value) { + addCriterion("scene_api_id <", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_api_id <=", value, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdIn(List values) { + addCriterion("scene_api_id in", values, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdNotIn(List values) { + addCriterion("scene_api_id not in", values, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdBetween(Integer value1, Integer value2) { + addCriterion("scene_api_id between", value1, value2, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andSceneApiIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_api_id not between", value1, value2, "sceneApiId"); + return (Criteria) this; + } + + public Criteria andTimeIsNull() { + addCriterion("time is null"); + return (Criteria) this; + } + + public Criteria andTimeIsNotNull() { + addCriterion("time is not null"); + return (Criteria) this; + } + + public Criteria andTimeEqualTo(Integer value) { + addCriterion("time =", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotEqualTo(Integer value) { + addCriterion("time <>", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeGreaterThan(Integer value) { + addCriterion("time >", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeGreaterThanOrEqualTo(Integer value) { + addCriterion("time >=", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeLessThan(Integer value) { + addCriterion("time <", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeLessThanOrEqualTo(Integer value) { + addCriterion("time <=", value, "time"); + return (Criteria) this; + } + + public Criteria andTimeIn(List values) { + addCriterion("time in", values, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotIn(List values) { + addCriterion("time not in", values, "time"); + return (Criteria) this; + } + + public Criteria andTimeBetween(Integer value1, Integer value2) { + addCriterion("time between", value1, value2, "time"); + return (Criteria) this; + } + + public Criteria andTimeNotBetween(Integer value1, Integer value2) { + addCriterion("time not between", value1, value2, "time"); + return (Criteria) this; + } + + public Criteria andAgentNumIsNull() { + addCriterion("agent_num is null"); + return (Criteria) this; + } + + public Criteria andAgentNumIsNotNull() { + addCriterion("agent_num is not null"); + return (Criteria) this; + } + + public Criteria andAgentNumEqualTo(Integer value) { + addCriterion("agent_num =", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumNotEqualTo(Integer value) { + addCriterion("agent_num <>", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumGreaterThan(Integer value) { + addCriterion("agent_num >", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumGreaterThanOrEqualTo(Integer value) { + addCriterion("agent_num >=", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumLessThan(Integer value) { + addCriterion("agent_num <", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumLessThanOrEqualTo(Integer value) { + addCriterion("agent_num <=", value, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumIn(List values) { + addCriterion("agent_num in", values, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumNotIn(List values) { + addCriterion("agent_num not in", values, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumBetween(Integer value1, Integer value2) { + addCriterion("agent_num between", value1, value2, "agentNum"); + return (Criteria) this; + } + + public Criteria andAgentNumNotBetween(Integer value1, Integer value2) { + addCriterion("agent_num not between", value1, value2, "agentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumIsNull() { + addCriterion("finish_agent_num is null"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumIsNotNull() { + addCriterion("finish_agent_num is not null"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumEqualTo(Integer value) { + addCriterion("finish_agent_num =", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumNotEqualTo(Integer value) { + addCriterion("finish_agent_num <>", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumGreaterThan(Integer value) { + addCriterion("finish_agent_num >", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumGreaterThanOrEqualTo(Integer value) { + addCriterion("finish_agent_num >=", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumLessThan(Integer value) { + addCriterion("finish_agent_num <", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumLessThanOrEqualTo(Integer value) { + addCriterion("finish_agent_num <=", value, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumIn(List values) { + addCriterion("finish_agent_num in", values, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumNotIn(List values) { + addCriterion("finish_agent_num not in", values, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumBetween(Integer value1, Integer value2) { + addCriterion("finish_agent_num between", value1, value2, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andFinishAgentNumNotBetween(Integer value1, Integer value2) { + addCriterion("finish_agent_num not between", value1, value2, "finishAgentNum"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andStateIsNull() { + addCriterion("state is null"); + return (Criteria) this; + } + + public Criteria andStateIsNotNull() { + addCriterion("state is not null"); + return (Criteria) this; + } + + public Criteria andStateEqualTo(Integer value) { + addCriterion("state =", value, "state"); + return (Criteria) this; + } + + public Criteria andStateNotEqualTo(Integer value) { + addCriterion("state <>", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThan(Integer value) { + addCriterion("state >", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThanOrEqualTo(Integer value) { + addCriterion("state >=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThan(Integer value) { + addCriterion("state <", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThanOrEqualTo(Integer value) { + addCriterion("state <=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateIn(List values) { + addCriterion("state in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateNotIn(List values) { + addCriterion("state not in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateBetween(Integer value1, Integer value2) { + addCriterion("state between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andStateNotBetween(Integer value1, Integer value2) { + addCriterion("state not between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(Integer value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(Integer value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(Integer value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(Integer value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(Integer value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(Integer value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(Integer value1, Integer value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(Integer value1, Integer value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andSuccessNumIsNull() { + addCriterion("success_num is null"); + return (Criteria) this; + } + + public Criteria andSuccessNumIsNotNull() { + addCriterion("success_num is not null"); + return (Criteria) this; + } + + public Criteria andSuccessNumEqualTo(Long value) { + addCriterion("success_num =", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumNotEqualTo(Long value) { + addCriterion("success_num <>", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumGreaterThan(Long value) { + addCriterion("success_num >", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumGreaterThanOrEqualTo(Long value) { + addCriterion("success_num >=", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumLessThan(Long value) { + addCriterion("success_num <", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumLessThanOrEqualTo(Long value) { + addCriterion("success_num <=", value, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumIn(List values) { + addCriterion("success_num in", values, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumNotIn(List values) { + addCriterion("success_num not in", values, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumBetween(Long value1, Long value2) { + addCriterion("success_num between", value1, value2, "successNum"); + return (Criteria) this; + } + + public Criteria andSuccessNumNotBetween(Long value1, Long value2) { + addCriterion("success_num not between", value1, value2, "successNum"); + return (Criteria) this; + } + + public Criteria andFailureNumIsNull() { + addCriterion("failure_num is null"); + return (Criteria) this; + } + + public Criteria andFailureNumIsNotNull() { + addCriterion("failure_num is not null"); + return (Criteria) this; + } + + public Criteria andFailureNumEqualTo(Long value) { + addCriterion("failure_num =", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumNotEqualTo(Long value) { + addCriterion("failure_num <>", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumGreaterThan(Long value) { + addCriterion("failure_num >", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumGreaterThanOrEqualTo(Long value) { + addCriterion("failure_num >=", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumLessThan(Long value) { + addCriterion("failure_num <", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumLessThanOrEqualTo(Long value) { + addCriterion("failure_num <=", value, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumIn(List values) { + addCriterion("failure_num in", values, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumNotIn(List values) { + addCriterion("failure_num not in", values, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumBetween(Long value1, Long value2) { + addCriterion("failure_num between", value1, value2, "failureNum"); + return (Criteria) this; + } + + public Criteria andFailureNumNotBetween(Long value1, Long value2) { + addCriterion("failure_num not between", value1, value2, "failureNum"); + return (Criteria) this; + } + + public Criteria andTaskTypeIsNull() { + addCriterion("task_type is null"); + return (Criteria) this; + } + + public Criteria andTaskTypeIsNotNull() { + addCriterion("task_type is not null"); + return (Criteria) this; + } + + public Criteria andTaskTypeEqualTo(Integer value) { + addCriterion("task_type =", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeNotEqualTo(Integer value) { + addCriterion("task_type <>", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeGreaterThan(Integer value) { + addCriterion("task_type >", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("task_type >=", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeLessThan(Integer value) { + addCriterion("task_type <", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeLessThanOrEqualTo(Integer value) { + addCriterion("task_type <=", value, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeIn(List values) { + addCriterion("task_type in", values, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeNotIn(List values) { + addCriterion("task_type not in", values, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeBetween(Integer value1, Integer value2) { + addCriterion("task_type between", value1, value2, "taskType"); + return (Criteria) this; + } + + public Criteria andTaskTypeNotBetween(Integer value1, Integer value2) { + addCriterion("task_type not between", value1, value2, "taskType"); + return (Criteria) this; + } + + public Criteria andParentTaskIdIsNull() { + addCriterion("parent_task_id is null"); + return (Criteria) this; + } + + public Criteria andParentTaskIdIsNotNull() { + addCriterion("parent_task_id is not null"); + return (Criteria) this; + } + + public Criteria andParentTaskIdEqualTo(Integer value) { + addCriterion("parent_task_id =", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdNotEqualTo(Integer value) { + addCriterion("parent_task_id <>", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdGreaterThan(Integer value) { + addCriterion("parent_task_id >", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdGreaterThanOrEqualTo(Integer value) { + addCriterion("parent_task_id >=", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdLessThan(Integer value) { + addCriterion("parent_task_id <", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdLessThanOrEqualTo(Integer value) { + addCriterion("parent_task_id <=", value, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdIn(List values) { + addCriterion("parent_task_id in", values, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdNotIn(List values) { + addCriterion("parent_task_id not in", values, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdBetween(Integer value1, Integer value2) { + addCriterion("parent_task_id between", value1, value2, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andParentTaskIdNotBetween(Integer value1, Integer value2) { + addCriterion("parent_task_id not between", value1, value2, "parentTaskId"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReqParamTypeIsNull() { + addCriterion("req_param_type is null"); + return (Criteria) this; + } + + public Criteria andReqParamTypeIsNotNull() { + addCriterion("req_param_type is not null"); + return (Criteria) this; + } + + public Criteria andReqParamTypeEqualTo(Integer value) { + addCriterion("req_param_type =", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeNotEqualTo(Integer value) { + addCriterion("req_param_type <>", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeGreaterThan(Integer value) { + addCriterion("req_param_type >", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("req_param_type >=", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeLessThan(Integer value) { + addCriterion("req_param_type <", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeLessThanOrEqualTo(Integer value) { + addCriterion("req_param_type <=", value, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeIn(List values) { + addCriterion("req_param_type in", values, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeNotIn(List values) { + addCriterion("req_param_type not in", values, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeBetween(Integer value1, Integer value2) { + addCriterion("req_param_type between", value1, value2, "reqParamType"); + return (Criteria) this; + } + + public Criteria andReqParamTypeNotBetween(Integer value1, Integer value2) { + addCriterion("req_param_type not between", value1, value2, "reqParamType"); + return (Criteria) this; + } + + public Criteria andOkIsNull() { + addCriterion("ok is null"); + return (Criteria) this; + } + + public Criteria andOkIsNotNull() { + addCriterion("ok is not null"); + return (Criteria) this; + } + + public Criteria andOkEqualTo(Boolean value) { + addCriterion("ok =", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkNotEqualTo(Boolean value) { + addCriterion("ok <>", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkGreaterThan(Boolean value) { + addCriterion("ok >", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkGreaterThanOrEqualTo(Boolean value) { + addCriterion("ok >=", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkLessThan(Boolean value) { + addCriterion("ok <", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkLessThanOrEqualTo(Boolean value) { + addCriterion("ok <=", value, "ok"); + return (Criteria) this; + } + + public Criteria andOkIn(List values) { + addCriterion("ok in", values, "ok"); + return (Criteria) this; + } + + public Criteria andOkNotIn(List values) { + addCriterion("ok not in", values, "ok"); + return (Criteria) this; + } + + public Criteria andOkBetween(Boolean value1, Boolean value2) { + addCriterion("ok between", value1, value2, "ok"); + return (Criteria) this; + } + + public Criteria andOkNotBetween(Boolean value1, Boolean value2) { + addCriterion("ok not between", value1, value2, "ok"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumIsNull() { + addCriterion("connect_task_num is null"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumIsNotNull() { + addCriterion("connect_task_num is not null"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumEqualTo(Integer value) { + addCriterion("connect_task_num =", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumNotEqualTo(Integer value) { + addCriterion("connect_task_num <>", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumGreaterThan(Integer value) { + addCriterion("connect_task_num >", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumGreaterThanOrEqualTo(Integer value) { + addCriterion("connect_task_num >=", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumLessThan(Integer value) { + addCriterion("connect_task_num <", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumLessThanOrEqualTo(Integer value) { + addCriterion("connect_task_num <=", value, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumIn(List values) { + addCriterion("connect_task_num in", values, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumNotIn(List values) { + addCriterion("connect_task_num not in", values, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumBetween(Integer value1, Integer value2) { + addCriterion("connect_task_num between", value1, value2, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andConnectTaskNumNotBetween(Integer value1, Integer value2) { + addCriterion("connect_task_num not between", value1, value2, "connectTaskNum"); + return (Criteria) this; + } + + public Criteria andDebugRtIsNull() { + addCriterion("debug_rt is null"); + return (Criteria) this; + } + + public Criteria andDebugRtIsNotNull() { + addCriterion("debug_rt is not null"); + return (Criteria) this; + } + + public Criteria andDebugRtEqualTo(Integer value) { + addCriterion("debug_rt =", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtNotEqualTo(Integer value) { + addCriterion("debug_rt <>", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtGreaterThan(Integer value) { + addCriterion("debug_rt >", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtGreaterThanOrEqualTo(Integer value) { + addCriterion("debug_rt >=", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtLessThan(Integer value) { + addCriterion("debug_rt <", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtLessThanOrEqualTo(Integer value) { + addCriterion("debug_rt <=", value, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtIn(List values) { + addCriterion("debug_rt in", values, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtNotIn(List values) { + addCriterion("debug_rt not in", values, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtBetween(Integer value1, Integer value2) { + addCriterion("debug_rt between", value1, value2, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugRtNotBetween(Integer value1, Integer value2) { + addCriterion("debug_rt not between", value1, value2, "debugRt"); + return (Criteria) this; + } + + public Criteria andDebugSizeIsNull() { + addCriterion("debug_size is null"); + return (Criteria) this; + } + + public Criteria andDebugSizeIsNotNull() { + addCriterion("debug_size is not null"); + return (Criteria) this; + } + + public Criteria andDebugSizeEqualTo(Integer value) { + addCriterion("debug_size =", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeNotEqualTo(Integer value) { + addCriterion("debug_size <>", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeGreaterThan(Integer value) { + addCriterion("debug_size >", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeGreaterThanOrEqualTo(Integer value) { + addCriterion("debug_size >=", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeLessThan(Integer value) { + addCriterion("debug_size <", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeLessThanOrEqualTo(Integer value) { + addCriterion("debug_size <=", value, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeIn(List values) { + addCriterion("debug_size in", values, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeNotIn(List values) { + addCriterion("debug_size not in", values, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeBetween(Integer value1, Integer value2) { + addCriterion("debug_size between", value1, value2, "debugSize"); + return (Criteria) this; + } + + public Criteria andDebugSizeNotBetween(Integer value1, Integer value2) { + addCriterion("debug_size not between", value1, value2, "debugSize"); + return (Criteria) this; + } + + public Criteria andBenchModeIsNull() { + addCriterion("bench_mode is null"); + return (Criteria) this; + } + + public Criteria andBenchModeIsNotNull() { + addCriterion("bench_mode is not null"); + return (Criteria) this; + } + + public Criteria andBenchModeEqualTo(Integer value) { + addCriterion("bench_mode =", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotEqualTo(Integer value) { + addCriterion("bench_mode <>", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeGreaterThan(Integer value) { + addCriterion("bench_mode >", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeGreaterThanOrEqualTo(Integer value) { + addCriterion("bench_mode >=", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeLessThan(Integer value) { + addCriterion("bench_mode <", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeLessThanOrEqualTo(Integer value) { + addCriterion("bench_mode <=", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeIn(List values) { + addCriterion("bench_mode in", values, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotIn(List values) { + addCriterion("bench_mode not in", values, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeBetween(Integer value1, Integer value2) { + addCriterion("bench_mode between", value1, value2, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotBetween(Integer value1, Integer value2) { + addCriterion("bench_mode not between", value1, value2, "benchMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeIsNull() { + addCriterion("increase_mode is null"); + return (Criteria) this; + } + + public Criteria andIncreaseModeIsNotNull() { + addCriterion("increase_mode is not null"); + return (Criteria) this; + } + + public Criteria andIncreaseModeEqualTo(Integer value) { + addCriterion("increase_mode =", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeNotEqualTo(Integer value) { + addCriterion("increase_mode <>", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeGreaterThan(Integer value) { + addCriterion("increase_mode >", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeGreaterThanOrEqualTo(Integer value) { + addCriterion("increase_mode >=", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeLessThan(Integer value) { + addCriterion("increase_mode <", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeLessThanOrEqualTo(Integer value) { + addCriterion("increase_mode <=", value, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeIn(List values) { + addCriterion("increase_mode in", values, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeNotIn(List values) { + addCriterion("increase_mode not in", values, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeBetween(Integer value1, Integer value2) { + addCriterion("increase_mode between", value1, value2, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreaseModeNotBetween(Integer value1, Integer value2) { + addCriterion("increase_mode not between", value1, value2, "increaseMode"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIsNull() { + addCriterion("increase_percent is null"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIsNotNull() { + addCriterion("increase_percent is not null"); + return (Criteria) this; + } + + public Criteria andIncreasePercentEqualTo(Integer value) { + addCriterion("increase_percent =", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotEqualTo(Integer value) { + addCriterion("increase_percent <>", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentGreaterThan(Integer value) { + addCriterion("increase_percent >", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentGreaterThanOrEqualTo(Integer value) { + addCriterion("increase_percent >=", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentLessThan(Integer value) { + addCriterion("increase_percent <", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentLessThanOrEqualTo(Integer value) { + addCriterion("increase_percent <=", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIn(List values) { + addCriterion("increase_percent in", values, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotIn(List values) { + addCriterion("increase_percent not in", values, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentBetween(Integer value1, Integer value2) { + addCriterion("increase_percent between", value1, value2, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotBetween(Integer value1, Integer value2) { + addCriterion("increase_percent not between", value1, value2, "increasePercent"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLog.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLog.java new file mode 100644 index 000000000..137a75a5a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLog.java @@ -0,0 +1,175 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class OperationLog { + private Long id; + + private String reportId; + + private Integer sceneId; + + private Integer type; + + private String createBy; + + private Long createTime; + + private Long updateTime; + + private String content; + + private String supportOperation; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getReportId() { + return reportId; + } + + public void setReportId(String reportId) { + this.reportId = reportId == null ? null : reportId.trim(); + } + + public Integer getSceneId() { + return sceneId; + } + + public void setSceneId(Integer sceneId) { + this.sceneId = sceneId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Long updateTime) { + this.updateTime = updateTime; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + public String getSupportOperation() { + return supportOperation; + } + + public void setSupportOperation(String supportOperation) { + this.supportOperation = supportOperation == null ? null : supportOperation.trim(); + } + + public enum Column { + id("id", "id", "BIGINT", false), + reportId("report_id", "reportId", "VARCHAR", false), + sceneId("scene_id", "sceneId", "INTEGER", false), + type("type", "type", "INTEGER", false), + createBy("create_by", "createBy", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + content("content", "content", "LONGVARCHAR", false), + supportOperation("support_operation", "supportOperation", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLogExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLogExample.java new file mode 100644 index 000000000..2ff36783b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/OperationLogExample.java @@ -0,0 +1,640 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class OperationLogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public OperationLogExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Integer value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Integer value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Integer value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Integer value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Integer value1, Integer value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfo.java new file mode 100644 index 000000000..0dadcbf07 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfo.java @@ -0,0 +1,308 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +public class ReportInfo { + private Long id; + + private Long sceneId; + + private String snapshotId; + + private String reportId; + + private String reportName; + + private Integer duration; + + private Integer concurrency; + + private Integer concurrencyMax; + + private String createBy; + + private Date createTime; + + private Date updateTime; + + private Integer status; + + private Long taskId; + + private String filePath; + + private Long finishTime; + + private String tenant; + + private String agents; + + private String extra; + + private String slaEventList; + + private String totalStatAnalysisEventList; + + private String linkToDagId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSceneId() { + return sceneId; + } + + public void setSceneId(Long sceneId) { + this.sceneId = sceneId; + } + + public String getSnapshotId() { + return snapshotId; + } + + public void setSnapshotId(String snapshotId) { + this.snapshotId = snapshotId == null ? null : snapshotId.trim(); + } + + public String getReportId() { + return reportId; + } + + public void setReportId(String reportId) { + this.reportId = reportId == null ? null : reportId.trim(); + } + + public String getReportName() { + return reportName; + } + + public void setReportName(String reportName) { + this.reportName = reportName == null ? null : reportName.trim(); + } + + public Integer getDuration() { + return duration; + } + + public void setDuration(Integer duration) { + this.duration = duration; + } + + public Integer getConcurrency() { + return concurrency; + } + + public void setConcurrency(Integer concurrency) { + this.concurrency = concurrency; + } + + public Integer getConcurrencyMax() { + return concurrencyMax; + } + + public void setConcurrencyMax(Integer concurrencyMax) { + this.concurrencyMax = concurrencyMax; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath == null ? null : filePath.trim(); + } + + public Long getFinishTime() { + return finishTime; + } + + public void setFinishTime(Long finishTime) { + this.finishTime = finishTime; + } + + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant == null ? null : tenant.trim(); + } + + public String getAgents() { + return agents; + } + + public void setAgents(String agents) { + this.agents = agents == null ? null : agents.trim(); + } + + public String getExtra() { + return extra; + } + + public void setExtra(String extra) { + this.extra = extra == null ? null : extra.trim(); + } + + public String getSlaEventList() { + return slaEventList; + } + + public void setSlaEventList(String slaEventList) { + this.slaEventList = slaEventList == null ? null : slaEventList.trim(); + } + + public String getTotalStatAnalysisEventList() { + return totalStatAnalysisEventList; + } + + public void setTotalStatAnalysisEventList(String totalStatAnalysisEventList) { + this.totalStatAnalysisEventList = totalStatAnalysisEventList == null ? null : totalStatAnalysisEventList.trim(); + } + + public String getLinkToDagId() { + return linkToDagId; + } + + public void setLinkToDagId(String linkToDagId) { + this.linkToDagId = linkToDagId == null ? null : linkToDagId.trim(); + } + + public enum Column { + id("id", "id", "BIGINT", false), + sceneId("scene_id", "sceneId", "BIGINT", false), + snapshotId("snapshot_id", "snapshotId", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + reportName("report_name", "reportName", "VARCHAR", false), + duration("duration", "duration", "INTEGER", false), + concurrency("concurrency", "concurrency", "INTEGER", false), + concurrencyMax("concurrency_max", "concurrencyMax", "INTEGER", false), + createBy("create_by", "createBy", "VARCHAR", false), + createTime("create_time", "createTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + status("status", "status", "INTEGER", false), + taskId("task_id", "taskId", "BIGINT", false), + filePath("file_path", "filePath", "VARCHAR", false), + finishTime("finish_time", "finishTime", "BIGINT", false), + tenant("tenant", "tenant", "VARCHAR", false), + agents("agents", "agents", "LONGVARCHAR", false), + extra("extra", "extra", "LONGVARCHAR", false), + slaEventList("sla_event_list", "slaEventList", "LONGVARCHAR", false), + totalStatAnalysisEventList("total_stat_analysis_event_list", "totalStatAnalysisEventList", "LONGVARCHAR", false), + linkToDagId("link_to_dag_id", "linkToDagId", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfoExample.java new file mode 100644 index 000000000..50c14fdcd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportInfoExample.java @@ -0,0 +1,1242 @@ +package run.mone.mimeter.dashboard.pojo; + +import run.mone.mimeter.dashboard.pojo.common.Pageable; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ReportInfoExample implements Pageable { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + private Long offset; + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + public ReportInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Long value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Long value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Long value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Long value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Long value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Long value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Long value1, Long value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Long value1, Long value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIsNull() { + addCriterion("snapshot_id is null"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIsNotNull() { + addCriterion("snapshot_id is not null"); + return (Criteria) this; + } + + public Criteria andSnapshotIdEqualTo(String value) { + addCriterion("snapshot_id =", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotEqualTo(String value) { + addCriterion("snapshot_id <>", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdGreaterThan(String value) { + addCriterion("snapshot_id >", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdGreaterThanOrEqualTo(String value) { + addCriterion("snapshot_id >=", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLessThan(String value) { + addCriterion("snapshot_id <", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLessThanOrEqualTo(String value) { + addCriterion("snapshot_id <=", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLike(String value) { + addCriterion("snapshot_id like", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotLike(String value) { + addCriterion("snapshot_id not like", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIn(List values) { + addCriterion("snapshot_id in", values, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotIn(List values) { + addCriterion("snapshot_id not in", values, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdBetween(String value1, String value2) { + addCriterion("snapshot_id between", value1, value2, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotBetween(String value1, String value2) { + addCriterion("snapshot_id not between", value1, value2, "snapshotId"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportNameIsNull() { + addCriterion("report_name is null"); + return (Criteria) this; + } + + public Criteria andReportNameIsNotNull() { + addCriterion("report_name is not null"); + return (Criteria) this; + } + + public Criteria andReportNameEqualTo(String value) { + addCriterion("report_name =", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameNotEqualTo(String value) { + addCriterion("report_name <>", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameGreaterThan(String value) { + addCriterion("report_name >", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameGreaterThanOrEqualTo(String value) { + addCriterion("report_name >=", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameLessThan(String value) { + addCriterion("report_name <", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameLessThanOrEqualTo(String value) { + addCriterion("report_name <=", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameLike(String value) { + addCriterion("report_name like", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameNotLike(String value) { + addCriterion("report_name not like", value, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameIn(List values) { + addCriterion("report_name in", values, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameNotIn(List values) { + addCriterion("report_name not in", values, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameBetween(String value1, String value2) { + addCriterion("report_name between", value1, value2, "reportName"); + return (Criteria) this; + } + + public Criteria andReportNameNotBetween(String value1, String value2) { + addCriterion("report_name not between", value1, value2, "reportName"); + return (Criteria) this; + } + + public Criteria andDurationIsNull() { + addCriterion("duration is null"); + return (Criteria) this; + } + + public Criteria andDurationIsNotNull() { + addCriterion("duration is not null"); + return (Criteria) this; + } + + public Criteria andDurationEqualTo(Integer value) { + addCriterion("duration =", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotEqualTo(Integer value) { + addCriterion("duration <>", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThan(Integer value) { + addCriterion("duration >", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("duration >=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThan(Integer value) { + addCriterion("duration <", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThanOrEqualTo(Integer value) { + addCriterion("duration <=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationIn(List values) { + addCriterion("duration in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotIn(List values) { + addCriterion("duration not in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationBetween(Integer value1, Integer value2) { + addCriterion("duration between", value1, value2, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotBetween(Integer value1, Integer value2) { + addCriterion("duration not between", value1, value2, "duration"); + return (Criteria) this; + } + + public Criteria andConcurrencyIsNull() { + addCriterion("concurrency is null"); + return (Criteria) this; + } + + public Criteria andConcurrencyIsNotNull() { + addCriterion("concurrency is not null"); + return (Criteria) this; + } + + public Criteria andConcurrencyEqualTo(Integer value) { + addCriterion("concurrency =", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyNotEqualTo(Integer value) { + addCriterion("concurrency <>", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyGreaterThan(Integer value) { + addCriterion("concurrency >", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyGreaterThanOrEqualTo(Integer value) { + addCriterion("concurrency >=", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyLessThan(Integer value) { + addCriterion("concurrency <", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyLessThanOrEqualTo(Integer value) { + addCriterion("concurrency <=", value, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyIn(List values) { + addCriterion("concurrency in", values, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyNotIn(List values) { + addCriterion("concurrency not in", values, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyBetween(Integer value1, Integer value2) { + addCriterion("concurrency between", value1, value2, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyNotBetween(Integer value1, Integer value2) { + addCriterion("concurrency not between", value1, value2, "concurrency"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxIsNull() { + addCriterion("concurrency_max is null"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxIsNotNull() { + addCriterion("concurrency_max is not null"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxEqualTo(Integer value) { + addCriterion("concurrency_max =", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxNotEqualTo(Integer value) { + addCriterion("concurrency_max <>", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxGreaterThan(Integer value) { + addCriterion("concurrency_max >", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxGreaterThanOrEqualTo(Integer value) { + addCriterion("concurrency_max >=", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxLessThan(Integer value) { + addCriterion("concurrency_max <", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxLessThanOrEqualTo(Integer value) { + addCriterion("concurrency_max <=", value, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxIn(List values) { + addCriterion("concurrency_max in", values, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxNotIn(List values) { + addCriterion("concurrency_max not in", values, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxBetween(Integer value1, Integer value2) { + addCriterion("concurrency_max between", value1, value2, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andConcurrencyMaxNotBetween(Integer value1, Integer value2) { + addCriterion("concurrency_max not between", value1, value2, "concurrencyMax"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andTaskIdIsNull() { + addCriterion("task_id is null"); + return (Criteria) this; + } + + public Criteria andTaskIdIsNotNull() { + addCriterion("task_id is not null"); + return (Criteria) this; + } + + public Criteria andTaskIdEqualTo(Long value) { + addCriterion("task_id =", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotEqualTo(Long value) { + addCriterion("task_id <>", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThan(Long value) { + addCriterion("task_id >", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThanOrEqualTo(Long value) { + addCriterion("task_id >=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThan(Long value) { + addCriterion("task_id <", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThanOrEqualTo(Long value) { + addCriterion("task_id <=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdIn(List values) { + addCriterion("task_id in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotIn(List values) { + addCriterion("task_id not in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdBetween(Long value1, Long value2) { + addCriterion("task_id between", value1, value2, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotBetween(Long value1, Long value2) { + addCriterion("task_id not between", value1, value2, "taskId"); + return (Criteria) this; + } + + public Criteria andFilePathIsNull() { + addCriterion("file_path is null"); + return (Criteria) this; + } + + public Criteria andFilePathIsNotNull() { + addCriterion("file_path is not null"); + return (Criteria) this; + } + + public Criteria andFilePathEqualTo(String value) { + addCriterion("file_path =", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathNotEqualTo(String value) { + addCriterion("file_path <>", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathGreaterThan(String value) { + addCriterion("file_path >", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathGreaterThanOrEqualTo(String value) { + addCriterion("file_path >=", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathLessThan(String value) { + addCriterion("file_path <", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathLessThanOrEqualTo(String value) { + addCriterion("file_path <=", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathLike(String value) { + addCriterion("file_path like", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathNotLike(String value) { + addCriterion("file_path not like", value, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathIn(List values) { + addCriterion("file_path in", values, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathNotIn(List values) { + addCriterion("file_path not in", values, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathBetween(String value1, String value2) { + addCriterion("file_path between", value1, value2, "filePath"); + return (Criteria) this; + } + + public Criteria andFilePathNotBetween(String value1, String value2) { + addCriterion("file_path not between", value1, value2, "filePath"); + return (Criteria) this; + } + + public Criteria andFinishTimeIsNull() { + addCriterion("finish_time is null"); + return (Criteria) this; + } + + public Criteria andFinishTimeIsNotNull() { + addCriterion("finish_time is not null"); + return (Criteria) this; + } + + public Criteria andFinishTimeEqualTo(Long value) { + addCriterion("finish_time =", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotEqualTo(Long value) { + addCriterion("finish_time <>", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeGreaterThan(Long value) { + addCriterion("finish_time >", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeGreaterThanOrEqualTo(Long value) { + addCriterion("finish_time >=", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeLessThan(Long value) { + addCriterion("finish_time <", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeLessThanOrEqualTo(Long value) { + addCriterion("finish_time <=", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeIn(List values) { + addCriterion("finish_time in", values, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotIn(List values) { + addCriterion("finish_time not in", values, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeBetween(Long value1, Long value2) { + addCriterion("finish_time between", value1, value2, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotBetween(Long value1, Long value2) { + addCriterion("finish_time not between", value1, value2, "finishTime"); + return (Criteria) this; + } + + public Criteria andTenantIsNull() { + addCriterion("tenant is null"); + return (Criteria) this; + } + + public Criteria andTenantIsNotNull() { + addCriterion("tenant is not null"); + return (Criteria) this; + } + + public Criteria andTenantEqualTo(String value) { + addCriterion("tenant =", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotEqualTo(String value) { + addCriterion("tenant <>", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThan(String value) { + addCriterion("tenant >", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThanOrEqualTo(String value) { + addCriterion("tenant >=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThan(String value) { + addCriterion("tenant <", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThanOrEqualTo(String value) { + addCriterion("tenant <=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLike(String value) { + addCriterion("tenant like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotLike(String value) { + addCriterion("tenant not like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantIn(List values) { + addCriterion("tenant in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotIn(List values) { + addCriterion("tenant not in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantBetween(String value1, String value2) { + addCriterion("tenant between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotBetween(String value1, String value2) { + addCriterion("tenant not between", value1, value2, "tenant"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStat.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStat.java new file mode 100644 index 000000000..bdaec4390 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStat.java @@ -0,0 +1,242 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +public class ReportStat { + private Long id; + + private Long sceneId; + + private String reportId; + + private Integer bizSucc; + + private Integer bizFail; + + private Integer reqSucc; + + private Integer reqFail; + + private Integer tps; + + private Integer tpsMax; + + private Integer rt; + + private Integer rtMax; + + private Integer rt99; + + private Integer rt90; + + private Date createTime; + + private Date updateTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSceneId() { + return sceneId; + } + + public void setSceneId(Long sceneId) { + this.sceneId = sceneId; + } + + public String getReportId() { + return reportId; + } + + public void setReportId(String reportId) { + this.reportId = reportId == null ? null : reportId.trim(); + } + + public Integer getBizSucc() { + return bizSucc; + } + + public void setBizSucc(Integer bizSucc) { + this.bizSucc = bizSucc; + } + + public Integer getBizFail() { + return bizFail; + } + + public void setBizFail(Integer bizFail) { + this.bizFail = bizFail; + } + + public Integer getReqSucc() { + return reqSucc; + } + + public void setReqSucc(Integer reqSucc) { + this.reqSucc = reqSucc; + } + + public Integer getReqFail() { + return reqFail; + } + + public void setReqFail(Integer reqFail) { + this.reqFail = reqFail; + } + + public Integer getTps() { + return tps; + } + + public void setTps(Integer tps) { + this.tps = tps; + } + + public Integer getTpsMax() { + return tpsMax; + } + + public void setTpsMax(Integer tpsMax) { + this.tpsMax = tpsMax; + } + + public Integer getRt() { + return rt; + } + + public void setRt(Integer rt) { + this.rt = rt; + } + + public Integer getRtMax() { + return rtMax; + } + + public void setRtMax(Integer rtMax) { + this.rtMax = rtMax; + } + + public Integer getRt99() { + return rt99; + } + + public void setRt99(Integer rt99) { + this.rt99 = rt99; + } + + public Integer getRt90() { + return rt90; + } + + public void setRt90(Integer rt90) { + this.rt90 = rt90; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public enum Column { + id("id", "id", "BIGINT", false), + sceneId("scene_id", "sceneId", "BIGINT", false), + reportId("report_id", "reportId", "VARCHAR", false), + bizSucc("biz_succ", "bizSucc", "INTEGER", false), + bizFail("biz_fail", "bizFail", "INTEGER", false), + reqSucc("req_succ", "reqSucc", "INTEGER", false), + reqFail("req_fail", "reqFail", "INTEGER", false), + tps("tps", "tps", "INTEGER", false), + tpsMax("tps_max", "tpsMax", "INTEGER", false), + rt("rt", "rt", "INTEGER", false), + rtMax("rt_max", "rtMax", "INTEGER", false), + rt99("rt99", "rt99", "INTEGER", false), + rt90("rt90", "rt90", "INTEGER", false), + createTime("create_time", "createTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStatExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStatExample.java new file mode 100644 index 000000000..029d406d0 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/ReportStatExample.java @@ -0,0 +1,1131 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ReportStatExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + public ReportStatExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Long value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Long value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Long value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Long value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Long value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Long value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Long value1, Long value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Long value1, Long value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andBizSuccIsNull() { + addCriterion("biz_succ is null"); + return (Criteria) this; + } + + public Criteria andBizSuccIsNotNull() { + addCriterion("biz_succ is not null"); + return (Criteria) this; + } + + public Criteria andBizSuccEqualTo(Integer value) { + addCriterion("biz_succ =", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccNotEqualTo(Integer value) { + addCriterion("biz_succ <>", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccGreaterThan(Integer value) { + addCriterion("biz_succ >", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccGreaterThanOrEqualTo(Integer value) { + addCriterion("biz_succ >=", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccLessThan(Integer value) { + addCriterion("biz_succ <", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccLessThanOrEqualTo(Integer value) { + addCriterion("biz_succ <=", value, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccIn(List values) { + addCriterion("biz_succ in", values, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccNotIn(List values) { + addCriterion("biz_succ not in", values, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccBetween(Integer value1, Integer value2) { + addCriterion("biz_succ between", value1, value2, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizSuccNotBetween(Integer value1, Integer value2) { + addCriterion("biz_succ not between", value1, value2, "bizSucc"); + return (Criteria) this; + } + + public Criteria andBizFailIsNull() { + addCriterion("biz_fail is null"); + return (Criteria) this; + } + + public Criteria andBizFailIsNotNull() { + addCriterion("biz_fail is not null"); + return (Criteria) this; + } + + public Criteria andBizFailEqualTo(Integer value) { + addCriterion("biz_fail =", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailNotEqualTo(Integer value) { + addCriterion("biz_fail <>", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailGreaterThan(Integer value) { + addCriterion("biz_fail >", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailGreaterThanOrEqualTo(Integer value) { + addCriterion("biz_fail >=", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailLessThan(Integer value) { + addCriterion("biz_fail <", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailLessThanOrEqualTo(Integer value) { + addCriterion("biz_fail <=", value, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailIn(List values) { + addCriterion("biz_fail in", values, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailNotIn(List values) { + addCriterion("biz_fail not in", values, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailBetween(Integer value1, Integer value2) { + addCriterion("biz_fail between", value1, value2, "bizFail"); + return (Criteria) this; + } + + public Criteria andBizFailNotBetween(Integer value1, Integer value2) { + addCriterion("biz_fail not between", value1, value2, "bizFail"); + return (Criteria) this; + } + + public Criteria andReqSuccIsNull() { + addCriterion("req_succ is null"); + return (Criteria) this; + } + + public Criteria andReqSuccIsNotNull() { + addCriterion("req_succ is not null"); + return (Criteria) this; + } + + public Criteria andReqSuccEqualTo(Integer value) { + addCriterion("req_succ =", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotEqualTo(Integer value) { + addCriterion("req_succ <>", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccGreaterThan(Integer value) { + addCriterion("req_succ >", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccGreaterThanOrEqualTo(Integer value) { + addCriterion("req_succ >=", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccLessThan(Integer value) { + addCriterion("req_succ <", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccLessThanOrEqualTo(Integer value) { + addCriterion("req_succ <=", value, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccIn(List values) { + addCriterion("req_succ in", values, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotIn(List values) { + addCriterion("req_succ not in", values, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccBetween(Integer value1, Integer value2) { + addCriterion("req_succ between", value1, value2, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqSuccNotBetween(Integer value1, Integer value2) { + addCriterion("req_succ not between", value1, value2, "reqSucc"); + return (Criteria) this; + } + + public Criteria andReqFailIsNull() { + addCriterion("req_fail is null"); + return (Criteria) this; + } + + public Criteria andReqFailIsNotNull() { + addCriterion("req_fail is not null"); + return (Criteria) this; + } + + public Criteria andReqFailEqualTo(Integer value) { + addCriterion("req_fail =", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotEqualTo(Integer value) { + addCriterion("req_fail <>", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailGreaterThan(Integer value) { + addCriterion("req_fail >", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailGreaterThanOrEqualTo(Integer value) { + addCriterion("req_fail >=", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailLessThan(Integer value) { + addCriterion("req_fail <", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailLessThanOrEqualTo(Integer value) { + addCriterion("req_fail <=", value, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailIn(List values) { + addCriterion("req_fail in", values, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotIn(List values) { + addCriterion("req_fail not in", values, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailBetween(Integer value1, Integer value2) { + addCriterion("req_fail between", value1, value2, "reqFail"); + return (Criteria) this; + } + + public Criteria andReqFailNotBetween(Integer value1, Integer value2) { + addCriterion("req_fail not between", value1, value2, "reqFail"); + return (Criteria) this; + } + + public Criteria andTpsIsNull() { + addCriterion("tps is null"); + return (Criteria) this; + } + + public Criteria andTpsIsNotNull() { + addCriterion("tps is not null"); + return (Criteria) this; + } + + public Criteria andTpsEqualTo(Integer value) { + addCriterion("tps =", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotEqualTo(Integer value) { + addCriterion("tps <>", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsGreaterThan(Integer value) { + addCriterion("tps >", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsGreaterThanOrEqualTo(Integer value) { + addCriterion("tps >=", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsLessThan(Integer value) { + addCriterion("tps <", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsLessThanOrEqualTo(Integer value) { + addCriterion("tps <=", value, "tps"); + return (Criteria) this; + } + + public Criteria andTpsIn(List values) { + addCriterion("tps in", values, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotIn(List values) { + addCriterion("tps not in", values, "tps"); + return (Criteria) this; + } + + public Criteria andTpsBetween(Integer value1, Integer value2) { + addCriterion("tps between", value1, value2, "tps"); + return (Criteria) this; + } + + public Criteria andTpsNotBetween(Integer value1, Integer value2) { + addCriterion("tps not between", value1, value2, "tps"); + return (Criteria) this; + } + + public Criteria andTpsMaxIsNull() { + addCriterion("tps_max is null"); + return (Criteria) this; + } + + public Criteria andTpsMaxIsNotNull() { + addCriterion("tps_max is not null"); + return (Criteria) this; + } + + public Criteria andTpsMaxEqualTo(Integer value) { + addCriterion("tps_max =", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotEqualTo(Integer value) { + addCriterion("tps_max <>", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxGreaterThan(Integer value) { + addCriterion("tps_max >", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxGreaterThanOrEqualTo(Integer value) { + addCriterion("tps_max >=", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxLessThan(Integer value) { + addCriterion("tps_max <", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxLessThanOrEqualTo(Integer value) { + addCriterion("tps_max <=", value, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxIn(List values) { + addCriterion("tps_max in", values, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotIn(List values) { + addCriterion("tps_max not in", values, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxBetween(Integer value1, Integer value2) { + addCriterion("tps_max between", value1, value2, "tpsMax"); + return (Criteria) this; + } + + public Criteria andTpsMaxNotBetween(Integer value1, Integer value2) { + addCriterion("tps_max not between", value1, value2, "tpsMax"); + return (Criteria) this; + } + + public Criteria andRtIsNull() { + addCriterion("rt is null"); + return (Criteria) this; + } + + public Criteria andRtIsNotNull() { + addCriterion("rt is not null"); + return (Criteria) this; + } + + public Criteria andRtEqualTo(Integer value) { + addCriterion("rt =", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotEqualTo(Integer value) { + addCriterion("rt <>", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtGreaterThan(Integer value) { + addCriterion("rt >", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtGreaterThanOrEqualTo(Integer value) { + addCriterion("rt >=", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtLessThan(Integer value) { + addCriterion("rt <", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtLessThanOrEqualTo(Integer value) { + addCriterion("rt <=", value, "rt"); + return (Criteria) this; + } + + public Criteria andRtIn(List values) { + addCriterion("rt in", values, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotIn(List values) { + addCriterion("rt not in", values, "rt"); + return (Criteria) this; + } + + public Criteria andRtBetween(Integer value1, Integer value2) { + addCriterion("rt between", value1, value2, "rt"); + return (Criteria) this; + } + + public Criteria andRtNotBetween(Integer value1, Integer value2) { + addCriterion("rt not between", value1, value2, "rt"); + return (Criteria) this; + } + + public Criteria andRtMaxIsNull() { + addCriterion("rt_max is null"); + return (Criteria) this; + } + + public Criteria andRtMaxIsNotNull() { + addCriterion("rt_max is not null"); + return (Criteria) this; + } + + public Criteria andRtMaxEqualTo(Integer value) { + addCriterion("rt_max =", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotEqualTo(Integer value) { + addCriterion("rt_max <>", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxGreaterThan(Integer value) { + addCriterion("rt_max >", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxGreaterThanOrEqualTo(Integer value) { + addCriterion("rt_max >=", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxLessThan(Integer value) { + addCriterion("rt_max <", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxLessThanOrEqualTo(Integer value) { + addCriterion("rt_max <=", value, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxIn(List values) { + addCriterion("rt_max in", values, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotIn(List values) { + addCriterion("rt_max not in", values, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxBetween(Integer value1, Integer value2) { + addCriterion("rt_max between", value1, value2, "rtMax"); + return (Criteria) this; + } + + public Criteria andRtMaxNotBetween(Integer value1, Integer value2) { + addCriterion("rt_max not between", value1, value2, "rtMax"); + return (Criteria) this; + } + + public Criteria andRt99IsNull() { + addCriterion("rt99 is null"); + return (Criteria) this; + } + + public Criteria andRt99IsNotNull() { + addCriterion("rt99 is not null"); + return (Criteria) this; + } + + public Criteria andRt99EqualTo(Integer value) { + addCriterion("rt99 =", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotEqualTo(Integer value) { + addCriterion("rt99 <>", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99GreaterThan(Integer value) { + addCriterion("rt99 >", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99GreaterThanOrEqualTo(Integer value) { + addCriterion("rt99 >=", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99LessThan(Integer value) { + addCriterion("rt99 <", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99LessThanOrEqualTo(Integer value) { + addCriterion("rt99 <=", value, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99In(List values) { + addCriterion("rt99 in", values, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotIn(List values) { + addCriterion("rt99 not in", values, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99Between(Integer value1, Integer value2) { + addCriterion("rt99 between", value1, value2, "rt99"); + return (Criteria) this; + } + + public Criteria andRt99NotBetween(Integer value1, Integer value2) { + addCriterion("rt99 not between", value1, value2, "rt99"); + return (Criteria) this; + } + + public Criteria andRt90IsNull() { + addCriterion("rt90 is null"); + return (Criteria) this; + } + + public Criteria andRt90IsNotNull() { + addCriterion("rt90 is not null"); + return (Criteria) this; + } + + public Criteria andRt90EqualTo(Integer value) { + addCriterion("rt90 =", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotEqualTo(Integer value) { + addCriterion("rt90 <>", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90GreaterThan(Integer value) { + addCriterion("rt90 >", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90GreaterThanOrEqualTo(Integer value) { + addCriterion("rt90 >=", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90LessThan(Integer value) { + addCriterion("rt90 <", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90LessThanOrEqualTo(Integer value) { + addCriterion("rt90 <=", value, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90In(List values) { + addCriterion("rt90 in", values, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotIn(List values) { + addCriterion("rt90 not in", values, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90Between(Integer value1, Integer value2) { + addCriterion("rt90 between", value1, value2, "rt90"); + return (Criteria) this; + } + + public Criteria andRt90NotBetween(Integer value1, Integer value2) { + addCriterion("rt90 not between", value1, value2, "rt90"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfo.java new file mode 100644 index 000000000..ce8b912ae --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfo.java @@ -0,0 +1,395 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class SceneApiInfo { + private Integer id; + + private Integer sceneId; + + private Integer apiOrder; + + private String apiName; + + private Integer sourceType; + + private Integer apiType; + + private Integer requestMethod; + + private Integer requestTimeout; + + private Boolean needLogin; + + private Integer tokenType; + + private String contentType; + + private Integer nacosType; + + private String serviceName; + + private String methodName; + + private String paramTypeList; + + private String dubboGroup; + + private String dubboVersion; + + private Integer serialLinkId; + + private String apiUrl; + + private String apiHeader; + + private String requestParamInfo; + + private String outputParamInfo; + + private String requestBody; + + private String dubboParamJson; + + private String checkPoint; + + private String filterCondition; + + private String apiTspAuth; + + private String apiTrafficInfo; + + private String apiX5Info; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getSceneId() { + return sceneId; + } + + public void setSceneId(Integer sceneId) { + this.sceneId = sceneId; + } + + public Integer getApiOrder() { + return apiOrder; + } + + public void setApiOrder(Integer apiOrder) { + this.apiOrder = apiOrder; + } + + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName == null ? null : apiName.trim(); + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Integer getApiType() { + return apiType; + } + + public void setApiType(Integer apiType) { + this.apiType = apiType; + } + + public Integer getRequestMethod() { + return requestMethod; + } + + public void setRequestMethod(Integer requestMethod) { + this.requestMethod = requestMethod; + } + + public Integer getRequestTimeout() { + return requestTimeout; + } + + public void setRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + } + + public Boolean getNeedLogin() { + return needLogin; + } + + public void setNeedLogin(Boolean needLogin) { + this.needLogin = needLogin; + } + + public Integer getTokenType() { + return tokenType; + } + + public void setTokenType(Integer tokenType) { + this.tokenType = tokenType; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType == null ? null : contentType.trim(); + } + + public Integer getNacosType() { + return nacosType; + } + + public void setNacosType(Integer nacosType) { + this.nacosType = nacosType; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName == null ? null : serviceName.trim(); + } + + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName == null ? null : methodName.trim(); + } + + public String getParamTypeList() { + return paramTypeList; + } + + public void setParamTypeList(String paramTypeList) { + this.paramTypeList = paramTypeList == null ? null : paramTypeList.trim(); + } + + public String getDubboGroup() { + return dubboGroup; + } + + public void setDubboGroup(String dubboGroup) { + this.dubboGroup = dubboGroup == null ? null : dubboGroup.trim(); + } + + public String getDubboVersion() { + return dubboVersion; + } + + public void setDubboVersion(String dubboVersion) { + this.dubboVersion = dubboVersion == null ? null : dubboVersion.trim(); + } + + public Integer getSerialLinkId() { + return serialLinkId; + } + + public void setSerialLinkId(Integer serialLinkId) { + this.serialLinkId = serialLinkId; + } + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl == null ? null : apiUrl.trim(); + } + + public String getApiHeader() { + return apiHeader; + } + + public void setApiHeader(String apiHeader) { + this.apiHeader = apiHeader == null ? null : apiHeader.trim(); + } + + public String getRequestParamInfo() { + return requestParamInfo; + } + + public void setRequestParamInfo(String requestParamInfo) { + this.requestParamInfo = requestParamInfo == null ? null : requestParamInfo.trim(); + } + + public String getOutputParamInfo() { + return outputParamInfo; + } + + public void setOutputParamInfo(String outputParamInfo) { + this.outputParamInfo = outputParamInfo == null ? null : outputParamInfo.trim(); + } + + public String getRequestBody() { + return requestBody; + } + + public void setRequestBody(String requestBody) { + this.requestBody = requestBody == null ? null : requestBody.trim(); + } + + public String getDubboParamJson() { + return dubboParamJson; + } + + public void setDubboParamJson(String dubboParamJson) { + this.dubboParamJson = dubboParamJson == null ? null : dubboParamJson.trim(); + } + + public String getCheckPoint() { + return checkPoint; + } + + public void setCheckPoint(String checkPoint) { + this.checkPoint = checkPoint == null ? null : checkPoint.trim(); + } + + public String getFilterCondition() { + return filterCondition; + } + + public void setFilterCondition(String filterCondition) { + this.filterCondition = filterCondition == null ? null : filterCondition.trim(); + } + + public String getApiTspAuth() { + return apiTspAuth; + } + + public void setApiTspAuth(String apiTspAuth) { + this.apiTspAuth = apiTspAuth == null ? null : apiTspAuth.trim(); + } + + public String getApiTrafficInfo() { + return apiTrafficInfo; + } + + public void setApiTrafficInfo(String apiTrafficInfo) { + this.apiTrafficInfo = apiTrafficInfo == null ? null : apiTrafficInfo.trim(); + } + + public String getApiX5Info() { + return apiX5Info; + } + + public void setApiX5Info(String apiX5Info) { + this.apiX5Info = apiX5Info == null ? null : apiX5Info.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + sceneId("scene_id", "sceneId", "INTEGER", false), + apiOrder("api_order", "apiOrder", "INTEGER", false), + apiName("api_name", "apiName", "VARCHAR", false), + sourceType("source_type", "sourceType", "INTEGER", false), + apiType("api_type", "apiType", "INTEGER", false), + requestMethod("request_method", "requestMethod", "INTEGER", false), + requestTimeout("request_timeout", "requestTimeout", "INTEGER", false), + needLogin("need_login", "needLogin", "BIT", false), + tokenType("token_type", "tokenType", "INTEGER", false), + contentType("content_type", "contentType", "VARCHAR", false), + nacosType("nacos_type", "nacosType", "INTEGER", false), + serviceName("service_name", "serviceName", "VARCHAR", false), + methodName("method_name", "methodName", "VARCHAR", false), + paramTypeList("param_type_list", "paramTypeList", "VARCHAR", false), + dubboGroup("dubbo_group", "dubboGroup", "VARCHAR", false), + dubboVersion("dubbo_version", "dubboVersion", "VARCHAR", false), + serialLinkId("serial_link_id", "serialLinkId", "INTEGER", false), + apiUrl("api_url", "apiUrl", "LONGVARCHAR", false), + apiHeader("api_header", "apiHeader", "LONGVARCHAR", false), + requestParamInfo("request_param_info", "requestParamInfo", "LONGVARCHAR", false), + outputParamInfo("output_param_info", "outputParamInfo", "LONGVARCHAR", false), + requestBody("request_body", "requestBody", "LONGVARCHAR", false), + dubboParamJson("dubbo_param_json", "dubboParamJson", "LONGVARCHAR", false), + checkPoint("check_point", "checkPoint", "LONGVARCHAR", false), + filterCondition("filter_condition", "filterCondition", "LONGVARCHAR", false), + apiTspAuth("api_tsp_auth", "apiTspAuth", "LONGVARCHAR", false), + apiTrafficInfo("api_traffic_info", "apiTrafficInfo", "LONGVARCHAR", false), + apiX5Info("api_x5_info", "apiX5Info", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfoExample.java new file mode 100644 index 000000000..7ce33cc13 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneApiInfoExample.java @@ -0,0 +1,1350 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SceneApiInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SceneApiInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Integer value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Integer value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Integer value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Integer value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Integer value1, Integer value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andApiOrderIsNull() { + addCriterion("api_order is null"); + return (Criteria) this; + } + + public Criteria andApiOrderIsNotNull() { + addCriterion("api_order is not null"); + return (Criteria) this; + } + + public Criteria andApiOrderEqualTo(Integer value) { + addCriterion("api_order =", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderNotEqualTo(Integer value) { + addCriterion("api_order <>", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderGreaterThan(Integer value) { + addCriterion("api_order >", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderGreaterThanOrEqualTo(Integer value) { + addCriterion("api_order >=", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderLessThan(Integer value) { + addCriterion("api_order <", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderLessThanOrEqualTo(Integer value) { + addCriterion("api_order <=", value, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderIn(List values) { + addCriterion("api_order in", values, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderNotIn(List values) { + addCriterion("api_order not in", values, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderBetween(Integer value1, Integer value2) { + addCriterion("api_order between", value1, value2, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiOrderNotBetween(Integer value1, Integer value2) { + addCriterion("api_order not between", value1, value2, "apiOrder"); + return (Criteria) this; + } + + public Criteria andApiNameIsNull() { + addCriterion("api_name is null"); + return (Criteria) this; + } + + public Criteria andApiNameIsNotNull() { + addCriterion("api_name is not null"); + return (Criteria) this; + } + + public Criteria andApiNameEqualTo(String value) { + addCriterion("api_name =", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameNotEqualTo(String value) { + addCriterion("api_name <>", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameGreaterThan(String value) { + addCriterion("api_name >", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameGreaterThanOrEqualTo(String value) { + addCriterion("api_name >=", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameLessThan(String value) { + addCriterion("api_name <", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameLessThanOrEqualTo(String value) { + addCriterion("api_name <=", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameLike(String value) { + addCriterion("api_name like", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameNotLike(String value) { + addCriterion("api_name not like", value, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameIn(List values) { + addCriterion("api_name in", values, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameNotIn(List values) { + addCriterion("api_name not in", values, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameBetween(String value1, String value2) { + addCriterion("api_name between", value1, value2, "apiName"); + return (Criteria) this; + } + + public Criteria andApiNameNotBetween(String value1, String value2) { + addCriterion("api_name not between", value1, value2, "apiName"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andApiTypeIsNull() { + addCriterion("api_type is null"); + return (Criteria) this; + } + + public Criteria andApiTypeIsNotNull() { + addCriterion("api_type is not null"); + return (Criteria) this; + } + + public Criteria andApiTypeEqualTo(Integer value) { + addCriterion("api_type =", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeNotEqualTo(Integer value) { + addCriterion("api_type <>", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeGreaterThan(Integer value) { + addCriterion("api_type >", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("api_type >=", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeLessThan(Integer value) { + addCriterion("api_type <", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeLessThanOrEqualTo(Integer value) { + addCriterion("api_type <=", value, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeIn(List values) { + addCriterion("api_type in", values, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeNotIn(List values) { + addCriterion("api_type not in", values, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeBetween(Integer value1, Integer value2) { + addCriterion("api_type between", value1, value2, "apiType"); + return (Criteria) this; + } + + public Criteria andApiTypeNotBetween(Integer value1, Integer value2) { + addCriterion("api_type not between", value1, value2, "apiType"); + return (Criteria) this; + } + + public Criteria andRequestMethodIsNull() { + addCriterion("request_method is null"); + return (Criteria) this; + } + + public Criteria andRequestMethodIsNotNull() { + addCriterion("request_method is not null"); + return (Criteria) this; + } + + public Criteria andRequestMethodEqualTo(Integer value) { + addCriterion("request_method =", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodNotEqualTo(Integer value) { + addCriterion("request_method <>", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodGreaterThan(Integer value) { + addCriterion("request_method >", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodGreaterThanOrEqualTo(Integer value) { + addCriterion("request_method >=", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodLessThan(Integer value) { + addCriterion("request_method <", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodLessThanOrEqualTo(Integer value) { + addCriterion("request_method <=", value, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodIn(List values) { + addCriterion("request_method in", values, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodNotIn(List values) { + addCriterion("request_method not in", values, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodBetween(Integer value1, Integer value2) { + addCriterion("request_method between", value1, value2, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestMethodNotBetween(Integer value1, Integer value2) { + addCriterion("request_method not between", value1, value2, "requestMethod"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIsNull() { + addCriterion("request_timeout is null"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIsNotNull() { + addCriterion("request_timeout is not null"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutEqualTo(Integer value) { + addCriterion("request_timeout =", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotEqualTo(Integer value) { + addCriterion("request_timeout <>", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutGreaterThan(Integer value) { + addCriterion("request_timeout >", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutGreaterThanOrEqualTo(Integer value) { + addCriterion("request_timeout >=", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutLessThan(Integer value) { + addCriterion("request_timeout <", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutLessThanOrEqualTo(Integer value) { + addCriterion("request_timeout <=", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIn(List values) { + addCriterion("request_timeout in", values, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotIn(List values) { + addCriterion("request_timeout not in", values, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutBetween(Integer value1, Integer value2) { + addCriterion("request_timeout between", value1, value2, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotBetween(Integer value1, Integer value2) { + addCriterion("request_timeout not between", value1, value2, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andNeedLoginIsNull() { + addCriterion("need_login is null"); + return (Criteria) this; + } + + public Criteria andNeedLoginIsNotNull() { + addCriterion("need_login is not null"); + return (Criteria) this; + } + + public Criteria andNeedLoginEqualTo(Boolean value) { + addCriterion("need_login =", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginNotEqualTo(Boolean value) { + addCriterion("need_login <>", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginGreaterThan(Boolean value) { + addCriterion("need_login >", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginGreaterThanOrEqualTo(Boolean value) { + addCriterion("need_login >=", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginLessThan(Boolean value) { + addCriterion("need_login <", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginLessThanOrEqualTo(Boolean value) { + addCriterion("need_login <=", value, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginIn(List values) { + addCriterion("need_login in", values, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginNotIn(List values) { + addCriterion("need_login not in", values, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginBetween(Boolean value1, Boolean value2) { + addCriterion("need_login between", value1, value2, "needLogin"); + return (Criteria) this; + } + + public Criteria andNeedLoginNotBetween(Boolean value1, Boolean value2) { + addCriterion("need_login not between", value1, value2, "needLogin"); + return (Criteria) this; + } + + public Criteria andTokenTypeIsNull() { + addCriterion("token_type is null"); + return (Criteria) this; + } + + public Criteria andTokenTypeIsNotNull() { + addCriterion("token_type is not null"); + return (Criteria) this; + } + + public Criteria andTokenTypeEqualTo(Integer value) { + addCriterion("token_type =", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeNotEqualTo(Integer value) { + addCriterion("token_type <>", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeGreaterThan(Integer value) { + addCriterion("token_type >", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("token_type >=", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeLessThan(Integer value) { + addCriterion("token_type <", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeLessThanOrEqualTo(Integer value) { + addCriterion("token_type <=", value, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeIn(List values) { + addCriterion("token_type in", values, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeNotIn(List values) { + addCriterion("token_type not in", values, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeBetween(Integer value1, Integer value2) { + addCriterion("token_type between", value1, value2, "tokenType"); + return (Criteria) this; + } + + public Criteria andTokenTypeNotBetween(Integer value1, Integer value2) { + addCriterion("token_type not between", value1, value2, "tokenType"); + return (Criteria) this; + } + + public Criteria andContentTypeIsNull() { + addCriterion("content_type is null"); + return (Criteria) this; + } + + public Criteria andContentTypeIsNotNull() { + addCriterion("content_type is not null"); + return (Criteria) this; + } + + public Criteria andContentTypeEqualTo(String value) { + addCriterion("content_type =", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeNotEqualTo(String value) { + addCriterion("content_type <>", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeGreaterThan(String value) { + addCriterion("content_type >", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeGreaterThanOrEqualTo(String value) { + addCriterion("content_type >=", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeLessThan(String value) { + addCriterion("content_type <", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeLessThanOrEqualTo(String value) { + addCriterion("content_type <=", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeLike(String value) { + addCriterion("content_type like", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeNotLike(String value) { + addCriterion("content_type not like", value, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeIn(List values) { + addCriterion("content_type in", values, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeNotIn(List values) { + addCriterion("content_type not in", values, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeBetween(String value1, String value2) { + addCriterion("content_type between", value1, value2, "contentType"); + return (Criteria) this; + } + + public Criteria andContentTypeNotBetween(String value1, String value2) { + addCriterion("content_type not between", value1, value2, "contentType"); + return (Criteria) this; + } + + public Criteria andNacosTypeIsNull() { + addCriterion("nacos_type is null"); + return (Criteria) this; + } + + public Criteria andNacosTypeIsNotNull() { + addCriterion("nacos_type is not null"); + return (Criteria) this; + } + + public Criteria andNacosTypeEqualTo(Integer value) { + addCriterion("nacos_type =", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeNotEqualTo(Integer value) { + addCriterion("nacos_type <>", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeGreaterThan(Integer value) { + addCriterion("nacos_type >", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("nacos_type >=", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeLessThan(Integer value) { + addCriterion("nacos_type <", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeLessThanOrEqualTo(Integer value) { + addCriterion("nacos_type <=", value, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeIn(List values) { + addCriterion("nacos_type in", values, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeNotIn(List values) { + addCriterion("nacos_type not in", values, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeBetween(Integer value1, Integer value2) { + addCriterion("nacos_type between", value1, value2, "nacosType"); + return (Criteria) this; + } + + public Criteria andNacosTypeNotBetween(Integer value1, Integer value2) { + addCriterion("nacos_type not between", value1, value2, "nacosType"); + return (Criteria) this; + } + + public Criteria andServiceNameIsNull() { + addCriterion("service_name is null"); + return (Criteria) this; + } + + public Criteria andServiceNameIsNotNull() { + addCriterion("service_name is not null"); + return (Criteria) this; + } + + public Criteria andServiceNameEqualTo(String value) { + addCriterion("service_name =", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameNotEqualTo(String value) { + addCriterion("service_name <>", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameGreaterThan(String value) { + addCriterion("service_name >", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameGreaterThanOrEqualTo(String value) { + addCriterion("service_name >=", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameLessThan(String value) { + addCriterion("service_name <", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameLessThanOrEqualTo(String value) { + addCriterion("service_name <=", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameLike(String value) { + addCriterion("service_name like", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameNotLike(String value) { + addCriterion("service_name not like", value, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameIn(List values) { + addCriterion("service_name in", values, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameNotIn(List values) { + addCriterion("service_name not in", values, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameBetween(String value1, String value2) { + addCriterion("service_name between", value1, value2, "serviceName"); + return (Criteria) this; + } + + public Criteria andServiceNameNotBetween(String value1, String value2) { + addCriterion("service_name not between", value1, value2, "serviceName"); + return (Criteria) this; + } + + public Criteria andMethodNameIsNull() { + addCriterion("method_name is null"); + return (Criteria) this; + } + + public Criteria andMethodNameIsNotNull() { + addCriterion("method_name is not null"); + return (Criteria) this; + } + + public Criteria andMethodNameEqualTo(String value) { + addCriterion("method_name =", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotEqualTo(String value) { + addCriterion("method_name <>", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameGreaterThan(String value) { + addCriterion("method_name >", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameGreaterThanOrEqualTo(String value) { + addCriterion("method_name >=", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLessThan(String value) { + addCriterion("method_name <", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLessThanOrEqualTo(String value) { + addCriterion("method_name <=", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameLike(String value) { + addCriterion("method_name like", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotLike(String value) { + addCriterion("method_name not like", value, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameIn(List values) { + addCriterion("method_name in", values, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotIn(List values) { + addCriterion("method_name not in", values, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameBetween(String value1, String value2) { + addCriterion("method_name between", value1, value2, "methodName"); + return (Criteria) this; + } + + public Criteria andMethodNameNotBetween(String value1, String value2) { + addCriterion("method_name not between", value1, value2, "methodName"); + return (Criteria) this; + } + + public Criteria andParamTypeListIsNull() { + addCriterion("param_type_list is null"); + return (Criteria) this; + } + + public Criteria andParamTypeListIsNotNull() { + addCriterion("param_type_list is not null"); + return (Criteria) this; + } + + public Criteria andParamTypeListEqualTo(String value) { + addCriterion("param_type_list =", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListNotEqualTo(String value) { + addCriterion("param_type_list <>", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListGreaterThan(String value) { + addCriterion("param_type_list >", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListGreaterThanOrEqualTo(String value) { + addCriterion("param_type_list >=", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListLessThan(String value) { + addCriterion("param_type_list <", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListLessThanOrEqualTo(String value) { + addCriterion("param_type_list <=", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListLike(String value) { + addCriterion("param_type_list like", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListNotLike(String value) { + addCriterion("param_type_list not like", value, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListIn(List values) { + addCriterion("param_type_list in", values, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListNotIn(List values) { + addCriterion("param_type_list not in", values, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListBetween(String value1, String value2) { + addCriterion("param_type_list between", value1, value2, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andParamTypeListNotBetween(String value1, String value2) { + addCriterion("param_type_list not between", value1, value2, "paramTypeList"); + return (Criteria) this; + } + + public Criteria andDubboGroupIsNull() { + addCriterion("dubbo_group is null"); + return (Criteria) this; + } + + public Criteria andDubboGroupIsNotNull() { + addCriterion("dubbo_group is not null"); + return (Criteria) this; + } + + public Criteria andDubboGroupEqualTo(String value) { + addCriterion("dubbo_group =", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupNotEqualTo(String value) { + addCriterion("dubbo_group <>", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupGreaterThan(String value) { + addCriterion("dubbo_group >", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupGreaterThanOrEqualTo(String value) { + addCriterion("dubbo_group >=", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupLessThan(String value) { + addCriterion("dubbo_group <", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupLessThanOrEqualTo(String value) { + addCriterion("dubbo_group <=", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupLike(String value) { + addCriterion("dubbo_group like", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupNotLike(String value) { + addCriterion("dubbo_group not like", value, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupIn(List values) { + addCriterion("dubbo_group in", values, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupNotIn(List values) { + addCriterion("dubbo_group not in", values, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupBetween(String value1, String value2) { + addCriterion("dubbo_group between", value1, value2, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboGroupNotBetween(String value1, String value2) { + addCriterion("dubbo_group not between", value1, value2, "dubboGroup"); + return (Criteria) this; + } + + public Criteria andDubboVersionIsNull() { + addCriterion("dubbo_version is null"); + return (Criteria) this; + } + + public Criteria andDubboVersionIsNotNull() { + addCriterion("dubbo_version is not null"); + return (Criteria) this; + } + + public Criteria andDubboVersionEqualTo(String value) { + addCriterion("dubbo_version =", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionNotEqualTo(String value) { + addCriterion("dubbo_version <>", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionGreaterThan(String value) { + addCriterion("dubbo_version >", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionGreaterThanOrEqualTo(String value) { + addCriterion("dubbo_version >=", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionLessThan(String value) { + addCriterion("dubbo_version <", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionLessThanOrEqualTo(String value) { + addCriterion("dubbo_version <=", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionLike(String value) { + addCriterion("dubbo_version like", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionNotLike(String value) { + addCriterion("dubbo_version not like", value, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionIn(List values) { + addCriterion("dubbo_version in", values, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionNotIn(List values) { + addCriterion("dubbo_version not in", values, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionBetween(String value1, String value2) { + addCriterion("dubbo_version between", value1, value2, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andDubboVersionNotBetween(String value1, String value2) { + addCriterion("dubbo_version not between", value1, value2, "dubboVersion"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIsNull() { + addCriterion("serial_link_id is null"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIsNotNull() { + addCriterion("serial_link_id is not null"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdEqualTo(Integer value) { + addCriterion("serial_link_id =", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotEqualTo(Integer value) { + addCriterion("serial_link_id <>", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdGreaterThan(Integer value) { + addCriterion("serial_link_id >", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdGreaterThanOrEqualTo(Integer value) { + addCriterion("serial_link_id >=", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdLessThan(Integer value) { + addCriterion("serial_link_id <", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdLessThanOrEqualTo(Integer value) { + addCriterion("serial_link_id <=", value, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdIn(List values) { + addCriterion("serial_link_id in", values, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotIn(List values) { + addCriterion("serial_link_id not in", values, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdBetween(Integer value1, Integer value2) { + addCriterion("serial_link_id between", value1, value2, "serialLinkId"); + return (Criteria) this; + } + + public Criteria andSerialLinkIdNotBetween(Integer value1, Integer value2) { + addCriterion("serial_link_id not between", value1, value2, "serialLinkId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroup.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroup.java new file mode 100644 index 000000000..8894d213a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroup.java @@ -0,0 +1,142 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class SceneGroup { + private Integer id; + + private String groupName; + + private String groupDesc; + + private String creator; + + private Long ctime; + + private String tenant; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getGroupName() { + return groupName; + } + + public void setGroupName(String groupName) { + this.groupName = groupName == null ? null : groupName.trim(); + } + + public String getGroupDesc() { + return groupDesc; + } + + public void setGroupDesc(String groupDesc) { + this.groupDesc = groupDesc == null ? null : groupDesc.trim(); + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant == null ? null : tenant.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + groupName("group_name", "groupName", "VARCHAR", false), + groupDesc("group_desc", "groupDesc", "VARCHAR", false), + creator("creator", "creator", "VARCHAR", false), + ctime("ctime", "ctime", "BIGINT", false), + tenant("tenant", "tenant", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroupExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroupExample.java new file mode 100644 index 000000000..d8fcbc2a2 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneGroupExample.java @@ -0,0 +1,600 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SceneGroupExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SceneGroupExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andGroupNameIsNull() { + addCriterion("group_name is null"); + return (Criteria) this; + } + + public Criteria andGroupNameIsNotNull() { + addCriterion("group_name is not null"); + return (Criteria) this; + } + + public Criteria andGroupNameEqualTo(String value) { + addCriterion("group_name =", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameNotEqualTo(String value) { + addCriterion("group_name <>", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameGreaterThan(String value) { + addCriterion("group_name >", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameGreaterThanOrEqualTo(String value) { + addCriterion("group_name >=", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameLessThan(String value) { + addCriterion("group_name <", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameLessThanOrEqualTo(String value) { + addCriterion("group_name <=", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameLike(String value) { + addCriterion("group_name like", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameNotLike(String value) { + addCriterion("group_name not like", value, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameIn(List values) { + addCriterion("group_name in", values, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameNotIn(List values) { + addCriterion("group_name not in", values, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameBetween(String value1, String value2) { + addCriterion("group_name between", value1, value2, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupNameNotBetween(String value1, String value2) { + addCriterion("group_name not between", value1, value2, "groupName"); + return (Criteria) this; + } + + public Criteria andGroupDescIsNull() { + addCriterion("group_desc is null"); + return (Criteria) this; + } + + public Criteria andGroupDescIsNotNull() { + addCriterion("group_desc is not null"); + return (Criteria) this; + } + + public Criteria andGroupDescEqualTo(String value) { + addCriterion("group_desc =", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescNotEqualTo(String value) { + addCriterion("group_desc <>", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescGreaterThan(String value) { + addCriterion("group_desc >", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescGreaterThanOrEqualTo(String value) { + addCriterion("group_desc >=", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescLessThan(String value) { + addCriterion("group_desc <", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescLessThanOrEqualTo(String value) { + addCriterion("group_desc <=", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescLike(String value) { + addCriterion("group_desc like", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescNotLike(String value) { + addCriterion("group_desc not like", value, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescIn(List values) { + addCriterion("group_desc in", values, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescNotIn(List values) { + addCriterion("group_desc not in", values, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescBetween(String value1, String value2) { + addCriterion("group_desc between", value1, value2, "groupDesc"); + return (Criteria) this; + } + + public Criteria andGroupDescNotBetween(String value1, String value2) { + addCriterion("group_desc not between", value1, value2, "groupDesc"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andTenantIsNull() { + addCriterion("tenant is null"); + return (Criteria) this; + } + + public Criteria andTenantIsNotNull() { + addCriterion("tenant is not null"); + return (Criteria) this; + } + + public Criteria andTenantEqualTo(String value) { + addCriterion("tenant =", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotEqualTo(String value) { + addCriterion("tenant <>", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThan(String value) { + addCriterion("tenant >", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThanOrEqualTo(String value) { + addCriterion("tenant >=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThan(String value) { + addCriterion("tenant <", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThanOrEqualTo(String value) { + addCriterion("tenant <=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLike(String value) { + addCriterion("tenant like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotLike(String value) { + addCriterion("tenant not like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantIn(List values) { + addCriterion("tenant in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotIn(List values) { + addCriterion("tenant not in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantBetween(String value1, String value2) { + addCriterion("tenant between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotBetween(String value1, String value2) { + addCriterion("tenant not between", value1, value2, "tenant"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfo.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfo.java new file mode 100644 index 000000000..84100b211 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfo.java @@ -0,0 +1,450 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class SceneInfo { + private Integer id; + + private String name; + + private Integer sceneStatus; + + private String creator; + + private String updator; + + private Integer apinum; + + private String remark; + + private Integer sceneType; + + private Integer benchMode; + + private Integer incrementMode; + + private Integer increasePercent; + + private Integer benchTime; + + private Integer maxBenchQps; + + private Integer rpsRate; + + private Integer logRate; + + private Integer requestTimeout; + + private String successCode; + + private Long ctime; + + private Long utime; + + private Integer sceneGroupId; + + private String curReportId; + + private Integer sceneEnv; + + private String tenant; + + private Integer benchCount; + + private Integer sceneSource; + + private Long lastBenchTime; + + private String apiBenchInfos; + + private String sla; + + private String globalHeader; + + private String agentList; + + private String refDatasetIds; + + private String personInCharge; + + private String benchCalendar; + + private String globalTspAuth; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Integer getSceneStatus() { + return sceneStatus; + } + + public void setSceneStatus(Integer sceneStatus) { + this.sceneStatus = sceneStatus; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public String getUpdator() { + return updator; + } + + public void setUpdator(String updator) { + this.updator = updator == null ? null : updator.trim(); + } + + public Integer getApinum() { + return apinum; + } + + public void setApinum(Integer apinum) { + this.apinum = apinum; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Integer getSceneType() { + return sceneType; + } + + public void setSceneType(Integer sceneType) { + this.sceneType = sceneType; + } + + public Integer getBenchMode() { + return benchMode; + } + + public void setBenchMode(Integer benchMode) { + this.benchMode = benchMode; + } + + public Integer getIncrementMode() { + return incrementMode; + } + + public void setIncrementMode(Integer incrementMode) { + this.incrementMode = incrementMode; + } + + public Integer getIncreasePercent() { + return increasePercent; + } + + public void setIncreasePercent(Integer increasePercent) { + this.increasePercent = increasePercent; + } + + public Integer getBenchTime() { + return benchTime; + } + + public void setBenchTime(Integer benchTime) { + this.benchTime = benchTime; + } + + public Integer getMaxBenchQps() { + return maxBenchQps; + } + + public void setMaxBenchQps(Integer maxBenchQps) { + this.maxBenchQps = maxBenchQps; + } + + public Integer getRpsRate() { + return rpsRate; + } + + public void setRpsRate(Integer rpsRate) { + this.rpsRate = rpsRate; + } + + public Integer getLogRate() { + return logRate; + } + + public void setLogRate(Integer logRate) { + this.logRate = logRate; + } + + public Integer getRequestTimeout() { + return requestTimeout; + } + + public void setRequestTimeout(Integer requestTimeout) { + this.requestTimeout = requestTimeout; + } + + public String getSuccessCode() { + return successCode; + } + + public void setSuccessCode(String successCode) { + this.successCode = successCode == null ? null : successCode.trim(); + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public Integer getSceneGroupId() { + return sceneGroupId; + } + + public void setSceneGroupId(Integer sceneGroupId) { + this.sceneGroupId = sceneGroupId; + } + + public String getCurReportId() { + return curReportId; + } + + public void setCurReportId(String curReportId) { + this.curReportId = curReportId == null ? null : curReportId.trim(); + } + + public Integer getSceneEnv() { + return sceneEnv; + } + + public void setSceneEnv(Integer sceneEnv) { + this.sceneEnv = sceneEnv; + } + + public String getTenant() { + return tenant; + } + + public void setTenant(String tenant) { + this.tenant = tenant == null ? null : tenant.trim(); + } + + public Integer getBenchCount() { + return benchCount; + } + + public void setBenchCount(Integer benchCount) { + this.benchCount = benchCount; + } + + public Integer getSceneSource() { + return sceneSource; + } + + public void setSceneSource(Integer sceneSource) { + this.sceneSource = sceneSource; + } + + public Long getLastBenchTime() { + return lastBenchTime; + } + + public void setLastBenchTime(Long lastBenchTime) { + this.lastBenchTime = lastBenchTime; + } + + public String getApiBenchInfos() { + return apiBenchInfos; + } + + public void setApiBenchInfos(String apiBenchInfos) { + this.apiBenchInfos = apiBenchInfos == null ? null : apiBenchInfos.trim(); + } + + public String getSla() { + return sla; + } + + public void setSla(String sla) { + this.sla = sla == null ? null : sla.trim(); + } + + public String getGlobalHeader() { + return globalHeader; + } + + public void setGlobalHeader(String globalHeader) { + this.globalHeader = globalHeader == null ? null : globalHeader.trim(); + } + + public String getAgentList() { + return agentList; + } + + public void setAgentList(String agentList) { + this.agentList = agentList == null ? null : agentList.trim(); + } + + public String getRefDatasetIds() { + return refDatasetIds; + } + + public void setRefDatasetIds(String refDatasetIds) { + this.refDatasetIds = refDatasetIds == null ? null : refDatasetIds.trim(); + } + + public String getPersonInCharge() { + return personInCharge; + } + + public void setPersonInCharge(String personInCharge) { + this.personInCharge = personInCharge == null ? null : personInCharge.trim(); + } + + public String getBenchCalendar() { + return benchCalendar; + } + + public void setBenchCalendar(String benchCalendar) { + this.benchCalendar = benchCalendar == null ? null : benchCalendar.trim(); + } + + public String getGlobalTspAuth() { + return globalTspAuth; + } + + public void setGlobalTspAuth(String globalTspAuth) { + this.globalTspAuth = globalTspAuth == null ? null : globalTspAuth.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", false), + sceneStatus("scene_status", "sceneStatus", "INTEGER", false), + creator("creator", "creator", "VARCHAR", false), + updator("updator", "updator", "VARCHAR", false), + apinum("apiNum", "apinum", "INTEGER", false), + remark("remark", "remark", "VARCHAR", false), + sceneType("scene_type", "sceneType", "INTEGER", false), + benchMode("bench_mode", "benchMode", "INTEGER", false), + incrementMode("Increment_mode", "incrementMode", "INTEGER", false), + increasePercent("increase_percent", "increasePercent", "INTEGER", false), + benchTime("bench_time", "benchTime", "INTEGER", false), + maxBenchQps("max_bench_qps", "maxBenchQps", "INTEGER", false), + rpsRate("rps_rate", "rpsRate", "INTEGER", false), + logRate("log_rate", "logRate", "INTEGER", false), + requestTimeout("request_timeout", "requestTimeout", "INTEGER", false), + successCode("success_code", "successCode", "VARCHAR", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + sceneGroupId("scene_group_id", "sceneGroupId", "INTEGER", false), + curReportId("cur_report_id", "curReportId", "VARCHAR", false), + sceneEnv("scene_env", "sceneEnv", "INTEGER", false), + tenant("tenant", "tenant", "VARCHAR", false), + benchCount("bench_count", "benchCount", "INTEGER", false), + sceneSource("scene_source", "sceneSource", "INTEGER", false), + lastBenchTime("last_bench_time", "lastBenchTime", "BIGINT", false), + apiBenchInfos("api_bench_infos", "apiBenchInfos", "LONGVARCHAR", false), + sla("sla", "sla", "LONGVARCHAR", false), + globalHeader("global_header", "globalHeader", "LONGVARCHAR", false), + agentList("agent_list", "agentList", "LONGVARCHAR", false), + refDatasetIds("ref_dataset_ids", "refDatasetIds", "LONGVARCHAR", false), + personInCharge("person_in_charge", "personInCharge", "LONGVARCHAR", false), + benchCalendar("bench_calendar", "benchCalendar", "LONGVARCHAR", false), + globalTspAuth("global_tsp_auth", "globalTspAuth", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfoExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfoExample.java new file mode 100644 index 000000000..c1fb796e1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneInfoExample.java @@ -0,0 +1,1830 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SceneInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SceneInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andSceneStatusIsNull() { + addCriterion("scene_status is null"); + return (Criteria) this; + } + + public Criteria andSceneStatusIsNotNull() { + addCriterion("scene_status is not null"); + return (Criteria) this; + } + + public Criteria andSceneStatusEqualTo(Integer value) { + addCriterion("scene_status =", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusNotEqualTo(Integer value) { + addCriterion("scene_status <>", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusGreaterThan(Integer value) { + addCriterion("scene_status >", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_status >=", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusLessThan(Integer value) { + addCriterion("scene_status <", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusLessThanOrEqualTo(Integer value) { + addCriterion("scene_status <=", value, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusIn(List values) { + addCriterion("scene_status in", values, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusNotIn(List values) { + addCriterion("scene_status not in", values, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusBetween(Integer value1, Integer value2) { + addCriterion("scene_status between", value1, value2, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andSceneStatusNotBetween(Integer value1, Integer value2) { + addCriterion("scene_status not between", value1, value2, "sceneStatus"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdatorIsNull() { + addCriterion("updator is null"); + return (Criteria) this; + } + + public Criteria andUpdatorIsNotNull() { + addCriterion("updator is not null"); + return (Criteria) this; + } + + public Criteria andUpdatorEqualTo(String value) { + addCriterion("updator =", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorNotEqualTo(String value) { + addCriterion("updator <>", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorGreaterThan(String value) { + addCriterion("updator >", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorGreaterThanOrEqualTo(String value) { + addCriterion("updator >=", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorLessThan(String value) { + addCriterion("updator <", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorLessThanOrEqualTo(String value) { + addCriterion("updator <=", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorLike(String value) { + addCriterion("updator like", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorNotLike(String value) { + addCriterion("updator not like", value, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorIn(List values) { + addCriterion("updator in", values, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorNotIn(List values) { + addCriterion("updator not in", values, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorBetween(String value1, String value2) { + addCriterion("updator between", value1, value2, "updator"); + return (Criteria) this; + } + + public Criteria andUpdatorNotBetween(String value1, String value2) { + addCriterion("updator not between", value1, value2, "updator"); + return (Criteria) this; + } + + public Criteria andApinumIsNull() { + addCriterion("apiNum is null"); + return (Criteria) this; + } + + public Criteria andApinumIsNotNull() { + addCriterion("apiNum is not null"); + return (Criteria) this; + } + + public Criteria andApinumEqualTo(Integer value) { + addCriterion("apiNum =", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumNotEqualTo(Integer value) { + addCriterion("apiNum <>", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumGreaterThan(Integer value) { + addCriterion("apiNum >", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumGreaterThanOrEqualTo(Integer value) { + addCriterion("apiNum >=", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumLessThan(Integer value) { + addCriterion("apiNum <", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumLessThanOrEqualTo(Integer value) { + addCriterion("apiNum <=", value, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumIn(List values) { + addCriterion("apiNum in", values, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumNotIn(List values) { + addCriterion("apiNum not in", values, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumBetween(Integer value1, Integer value2) { + addCriterion("apiNum between", value1, value2, "apinum"); + return (Criteria) this; + } + + public Criteria andApinumNotBetween(Integer value1, Integer value2) { + addCriterion("apiNum not between", value1, value2, "apinum"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andSceneTypeIsNull() { + addCriterion("scene_type is null"); + return (Criteria) this; + } + + public Criteria andSceneTypeIsNotNull() { + addCriterion("scene_type is not null"); + return (Criteria) this; + } + + public Criteria andSceneTypeEqualTo(Integer value) { + addCriterion("scene_type =", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeNotEqualTo(Integer value) { + addCriterion("scene_type <>", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeGreaterThan(Integer value) { + addCriterion("scene_type >", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_type >=", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeLessThan(Integer value) { + addCriterion("scene_type <", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeLessThanOrEqualTo(Integer value) { + addCriterion("scene_type <=", value, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeIn(List values) { + addCriterion("scene_type in", values, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeNotIn(List values) { + addCriterion("scene_type not in", values, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeBetween(Integer value1, Integer value2) { + addCriterion("scene_type between", value1, value2, "sceneType"); + return (Criteria) this; + } + + public Criteria andSceneTypeNotBetween(Integer value1, Integer value2) { + addCriterion("scene_type not between", value1, value2, "sceneType"); + return (Criteria) this; + } + + public Criteria andBenchModeIsNull() { + addCriterion("bench_mode is null"); + return (Criteria) this; + } + + public Criteria andBenchModeIsNotNull() { + addCriterion("bench_mode is not null"); + return (Criteria) this; + } + + public Criteria andBenchModeEqualTo(Integer value) { + addCriterion("bench_mode =", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotEqualTo(Integer value) { + addCriterion("bench_mode <>", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeGreaterThan(Integer value) { + addCriterion("bench_mode >", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeGreaterThanOrEqualTo(Integer value) { + addCriterion("bench_mode >=", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeLessThan(Integer value) { + addCriterion("bench_mode <", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeLessThanOrEqualTo(Integer value) { + addCriterion("bench_mode <=", value, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeIn(List values) { + addCriterion("bench_mode in", values, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotIn(List values) { + addCriterion("bench_mode not in", values, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeBetween(Integer value1, Integer value2) { + addCriterion("bench_mode between", value1, value2, "benchMode"); + return (Criteria) this; + } + + public Criteria andBenchModeNotBetween(Integer value1, Integer value2) { + addCriterion("bench_mode not between", value1, value2, "benchMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeIsNull() { + addCriterion("Increment_mode is null"); + return (Criteria) this; + } + + public Criteria andIncrementModeIsNotNull() { + addCriterion("Increment_mode is not null"); + return (Criteria) this; + } + + public Criteria andIncrementModeEqualTo(Integer value) { + addCriterion("Increment_mode =", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeNotEqualTo(Integer value) { + addCriterion("Increment_mode <>", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeGreaterThan(Integer value) { + addCriterion("Increment_mode >", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeGreaterThanOrEqualTo(Integer value) { + addCriterion("Increment_mode >=", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeLessThan(Integer value) { + addCriterion("Increment_mode <", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeLessThanOrEqualTo(Integer value) { + addCriterion("Increment_mode <=", value, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeIn(List values) { + addCriterion("Increment_mode in", values, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeNotIn(List values) { + addCriterion("Increment_mode not in", values, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeBetween(Integer value1, Integer value2) { + addCriterion("Increment_mode between", value1, value2, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncrementModeNotBetween(Integer value1, Integer value2) { + addCriterion("Increment_mode not between", value1, value2, "incrementMode"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIsNull() { + addCriterion("increase_percent is null"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIsNotNull() { + addCriterion("increase_percent is not null"); + return (Criteria) this; + } + + public Criteria andIncreasePercentEqualTo(Integer value) { + addCriterion("increase_percent =", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotEqualTo(Integer value) { + addCriterion("increase_percent <>", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentGreaterThan(Integer value) { + addCriterion("increase_percent >", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentGreaterThanOrEqualTo(Integer value) { + addCriterion("increase_percent >=", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentLessThan(Integer value) { + addCriterion("increase_percent <", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentLessThanOrEqualTo(Integer value) { + addCriterion("increase_percent <=", value, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentIn(List values) { + addCriterion("increase_percent in", values, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotIn(List values) { + addCriterion("increase_percent not in", values, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentBetween(Integer value1, Integer value2) { + addCriterion("increase_percent between", value1, value2, "increasePercent"); + return (Criteria) this; + } + + public Criteria andIncreasePercentNotBetween(Integer value1, Integer value2) { + addCriterion("increase_percent not between", value1, value2, "increasePercent"); + return (Criteria) this; + } + + public Criteria andBenchTimeIsNull() { + addCriterion("bench_time is null"); + return (Criteria) this; + } + + public Criteria andBenchTimeIsNotNull() { + addCriterion("bench_time is not null"); + return (Criteria) this; + } + + public Criteria andBenchTimeEqualTo(Integer value) { + addCriterion("bench_time =", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeNotEqualTo(Integer value) { + addCriterion("bench_time <>", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeGreaterThan(Integer value) { + addCriterion("bench_time >", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeGreaterThanOrEqualTo(Integer value) { + addCriterion("bench_time >=", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeLessThan(Integer value) { + addCriterion("bench_time <", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeLessThanOrEqualTo(Integer value) { + addCriterion("bench_time <=", value, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeIn(List values) { + addCriterion("bench_time in", values, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeNotIn(List values) { + addCriterion("bench_time not in", values, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeBetween(Integer value1, Integer value2) { + addCriterion("bench_time between", value1, value2, "benchTime"); + return (Criteria) this; + } + + public Criteria andBenchTimeNotBetween(Integer value1, Integer value2) { + addCriterion("bench_time not between", value1, value2, "benchTime"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsIsNull() { + addCriterion("max_bench_qps is null"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsIsNotNull() { + addCriterion("max_bench_qps is not null"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsEqualTo(Integer value) { + addCriterion("max_bench_qps =", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsNotEqualTo(Integer value) { + addCriterion("max_bench_qps <>", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsGreaterThan(Integer value) { + addCriterion("max_bench_qps >", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsGreaterThanOrEqualTo(Integer value) { + addCriterion("max_bench_qps >=", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsLessThan(Integer value) { + addCriterion("max_bench_qps <", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsLessThanOrEqualTo(Integer value) { + addCriterion("max_bench_qps <=", value, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsIn(List values) { + addCriterion("max_bench_qps in", values, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsNotIn(List values) { + addCriterion("max_bench_qps not in", values, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsBetween(Integer value1, Integer value2) { + addCriterion("max_bench_qps between", value1, value2, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andMaxBenchQpsNotBetween(Integer value1, Integer value2) { + addCriterion("max_bench_qps not between", value1, value2, "maxBenchQps"); + return (Criteria) this; + } + + public Criteria andRpsRateIsNull() { + addCriterion("rps_rate is null"); + return (Criteria) this; + } + + public Criteria andRpsRateIsNotNull() { + addCriterion("rps_rate is not null"); + return (Criteria) this; + } + + public Criteria andRpsRateEqualTo(Integer value) { + addCriterion("rps_rate =", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateNotEqualTo(Integer value) { + addCriterion("rps_rate <>", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateGreaterThan(Integer value) { + addCriterion("rps_rate >", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateGreaterThanOrEqualTo(Integer value) { + addCriterion("rps_rate >=", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateLessThan(Integer value) { + addCriterion("rps_rate <", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateLessThanOrEqualTo(Integer value) { + addCriterion("rps_rate <=", value, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateIn(List values) { + addCriterion("rps_rate in", values, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateNotIn(List values) { + addCriterion("rps_rate not in", values, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateBetween(Integer value1, Integer value2) { + addCriterion("rps_rate between", value1, value2, "rpsRate"); + return (Criteria) this; + } + + public Criteria andRpsRateNotBetween(Integer value1, Integer value2) { + addCriterion("rps_rate not between", value1, value2, "rpsRate"); + return (Criteria) this; + } + + public Criteria andLogRateIsNull() { + addCriterion("log_rate is null"); + return (Criteria) this; + } + + public Criteria andLogRateIsNotNull() { + addCriterion("log_rate is not null"); + return (Criteria) this; + } + + public Criteria andLogRateEqualTo(Integer value) { + addCriterion("log_rate =", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateNotEqualTo(Integer value) { + addCriterion("log_rate <>", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateGreaterThan(Integer value) { + addCriterion("log_rate >", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateGreaterThanOrEqualTo(Integer value) { + addCriterion("log_rate >=", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateLessThan(Integer value) { + addCriterion("log_rate <", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateLessThanOrEqualTo(Integer value) { + addCriterion("log_rate <=", value, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateIn(List values) { + addCriterion("log_rate in", values, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateNotIn(List values) { + addCriterion("log_rate not in", values, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateBetween(Integer value1, Integer value2) { + addCriterion("log_rate between", value1, value2, "logRate"); + return (Criteria) this; + } + + public Criteria andLogRateNotBetween(Integer value1, Integer value2) { + addCriterion("log_rate not between", value1, value2, "logRate"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIsNull() { + addCriterion("request_timeout is null"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIsNotNull() { + addCriterion("request_timeout is not null"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutEqualTo(Integer value) { + addCriterion("request_timeout =", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotEqualTo(Integer value) { + addCriterion("request_timeout <>", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutGreaterThan(Integer value) { + addCriterion("request_timeout >", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutGreaterThanOrEqualTo(Integer value) { + addCriterion("request_timeout >=", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutLessThan(Integer value) { + addCriterion("request_timeout <", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutLessThanOrEqualTo(Integer value) { + addCriterion("request_timeout <=", value, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutIn(List values) { + addCriterion("request_timeout in", values, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotIn(List values) { + addCriterion("request_timeout not in", values, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutBetween(Integer value1, Integer value2) { + addCriterion("request_timeout between", value1, value2, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andRequestTimeoutNotBetween(Integer value1, Integer value2) { + addCriterion("request_timeout not between", value1, value2, "requestTimeout"); + return (Criteria) this; + } + + public Criteria andSuccessCodeIsNull() { + addCriterion("success_code is null"); + return (Criteria) this; + } + + public Criteria andSuccessCodeIsNotNull() { + addCriterion("success_code is not null"); + return (Criteria) this; + } + + public Criteria andSuccessCodeEqualTo(String value) { + addCriterion("success_code =", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeNotEqualTo(String value) { + addCriterion("success_code <>", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeGreaterThan(String value) { + addCriterion("success_code >", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeGreaterThanOrEqualTo(String value) { + addCriterion("success_code >=", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeLessThan(String value) { + addCriterion("success_code <", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeLessThanOrEqualTo(String value) { + addCriterion("success_code <=", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeLike(String value) { + addCriterion("success_code like", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeNotLike(String value) { + addCriterion("success_code not like", value, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeIn(List values) { + addCriterion("success_code in", values, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeNotIn(List values) { + addCriterion("success_code not in", values, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeBetween(String value1, String value2) { + addCriterion("success_code between", value1, value2, "successCode"); + return (Criteria) this; + } + + public Criteria andSuccessCodeNotBetween(String value1, String value2) { + addCriterion("success_code not between", value1, value2, "successCode"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdIsNull() { + addCriterion("scene_group_id is null"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdIsNotNull() { + addCriterion("scene_group_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdEqualTo(Integer value) { + addCriterion("scene_group_id =", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdNotEqualTo(Integer value) { + addCriterion("scene_group_id <>", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdGreaterThan(Integer value) { + addCriterion("scene_group_id >", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_group_id >=", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdLessThan(Integer value) { + addCriterion("scene_group_id <", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_group_id <=", value, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdIn(List values) { + addCriterion("scene_group_id in", values, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdNotIn(List values) { + addCriterion("scene_group_id not in", values, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdBetween(Integer value1, Integer value2) { + addCriterion("scene_group_id between", value1, value2, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andSceneGroupIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_group_id not between", value1, value2, "sceneGroupId"); + return (Criteria) this; + } + + public Criteria andCurReportIdIsNull() { + addCriterion("cur_report_id is null"); + return (Criteria) this; + } + + public Criteria andCurReportIdIsNotNull() { + addCriterion("cur_report_id is not null"); + return (Criteria) this; + } + + public Criteria andCurReportIdEqualTo(String value) { + addCriterion("cur_report_id =", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdNotEqualTo(String value) { + addCriterion("cur_report_id <>", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdGreaterThan(String value) { + addCriterion("cur_report_id >", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdGreaterThanOrEqualTo(String value) { + addCriterion("cur_report_id >=", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdLessThan(String value) { + addCriterion("cur_report_id <", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdLessThanOrEqualTo(String value) { + addCriterion("cur_report_id <=", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdLike(String value) { + addCriterion("cur_report_id like", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdNotLike(String value) { + addCriterion("cur_report_id not like", value, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdIn(List values) { + addCriterion("cur_report_id in", values, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdNotIn(List values) { + addCriterion("cur_report_id not in", values, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdBetween(String value1, String value2) { + addCriterion("cur_report_id between", value1, value2, "curReportId"); + return (Criteria) this; + } + + public Criteria andCurReportIdNotBetween(String value1, String value2) { + addCriterion("cur_report_id not between", value1, value2, "curReportId"); + return (Criteria) this; + } + + public Criteria andSceneEnvIsNull() { + addCriterion("scene_env is null"); + return (Criteria) this; + } + + public Criteria andSceneEnvIsNotNull() { + addCriterion("scene_env is not null"); + return (Criteria) this; + } + + public Criteria andSceneEnvEqualTo(Integer value) { + addCriterion("scene_env =", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvNotEqualTo(Integer value) { + addCriterion("scene_env <>", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvGreaterThan(Integer value) { + addCriterion("scene_env >", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_env >=", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvLessThan(Integer value) { + addCriterion("scene_env <", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvLessThanOrEqualTo(Integer value) { + addCriterion("scene_env <=", value, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvIn(List values) { + addCriterion("scene_env in", values, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvNotIn(List values) { + addCriterion("scene_env not in", values, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvBetween(Integer value1, Integer value2) { + addCriterion("scene_env between", value1, value2, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andSceneEnvNotBetween(Integer value1, Integer value2) { + addCriterion("scene_env not between", value1, value2, "sceneEnv"); + return (Criteria) this; + } + + public Criteria andTenantIsNull() { + addCriterion("tenant is null"); + return (Criteria) this; + } + + public Criteria andTenantIsNotNull() { + addCriterion("tenant is not null"); + return (Criteria) this; + } + + public Criteria andTenantEqualTo(String value) { + addCriterion("tenant =", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotEqualTo(String value) { + addCriterion("tenant <>", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThan(String value) { + addCriterion("tenant >", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantGreaterThanOrEqualTo(String value) { + addCriterion("tenant >=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThan(String value) { + addCriterion("tenant <", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLessThanOrEqualTo(String value) { + addCriterion("tenant <=", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantLike(String value) { + addCriterion("tenant like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotLike(String value) { + addCriterion("tenant not like", value, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantIn(List values) { + addCriterion("tenant in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotIn(List values) { + addCriterion("tenant not in", values, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantBetween(String value1, String value2) { + addCriterion("tenant between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andTenantNotBetween(String value1, String value2) { + addCriterion("tenant not between", value1, value2, "tenant"); + return (Criteria) this; + } + + public Criteria andBenchCountIsNull() { + addCriterion("bench_count is null"); + return (Criteria) this; + } + + public Criteria andBenchCountIsNotNull() { + addCriterion("bench_count is not null"); + return (Criteria) this; + } + + public Criteria andBenchCountEqualTo(Integer value) { + addCriterion("bench_count =", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountNotEqualTo(Integer value) { + addCriterion("bench_count <>", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountGreaterThan(Integer value) { + addCriterion("bench_count >", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountGreaterThanOrEqualTo(Integer value) { + addCriterion("bench_count >=", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountLessThan(Integer value) { + addCriterion("bench_count <", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountLessThanOrEqualTo(Integer value) { + addCriterion("bench_count <=", value, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountIn(List values) { + addCriterion("bench_count in", values, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountNotIn(List values) { + addCriterion("bench_count not in", values, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountBetween(Integer value1, Integer value2) { + addCriterion("bench_count between", value1, value2, "benchCount"); + return (Criteria) this; + } + + public Criteria andBenchCountNotBetween(Integer value1, Integer value2) { + addCriterion("bench_count not between", value1, value2, "benchCount"); + return (Criteria) this; + } + + public Criteria andSceneSourceIsNull() { + addCriterion("scene_source is null"); + return (Criteria) this; + } + + public Criteria andSceneSourceIsNotNull() { + addCriterion("scene_source is not null"); + return (Criteria) this; + } + + public Criteria andSceneSourceEqualTo(Integer value) { + addCriterion("scene_source =", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceNotEqualTo(Integer value) { + addCriterion("scene_source <>", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceGreaterThan(Integer value) { + addCriterion("scene_source >", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_source >=", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceLessThan(Integer value) { + addCriterion("scene_source <", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceLessThanOrEqualTo(Integer value) { + addCriterion("scene_source <=", value, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceIn(List values) { + addCriterion("scene_source in", values, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceNotIn(List values) { + addCriterion("scene_source not in", values, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceBetween(Integer value1, Integer value2) { + addCriterion("scene_source between", value1, value2, "sceneSource"); + return (Criteria) this; + } + + public Criteria andSceneSourceNotBetween(Integer value1, Integer value2) { + addCriterion("scene_source not between", value1, value2, "sceneSource"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeIsNull() { + addCriterion("last_bench_time is null"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeIsNotNull() { + addCriterion("last_bench_time is not null"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeEqualTo(Long value) { + addCriterion("last_bench_time =", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeNotEqualTo(Long value) { + addCriterion("last_bench_time <>", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeGreaterThan(Long value) { + addCriterion("last_bench_time >", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeGreaterThanOrEqualTo(Long value) { + addCriterion("last_bench_time >=", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeLessThan(Long value) { + addCriterion("last_bench_time <", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeLessThanOrEqualTo(Long value) { + addCriterion("last_bench_time <=", value, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeIn(List values) { + addCriterion("last_bench_time in", values, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeNotIn(List values) { + addCriterion("last_bench_time not in", values, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeBetween(Long value1, Long value2) { + addCriterion("last_bench_time between", value1, value2, "lastBenchTime"); + return (Criteria) this; + } + + public Criteria andLastBenchTimeNotBetween(Long value1, Long value2) { + addCriterion("last_bench_time not between", value1, value2, "lastBenchTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshot.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshot.java new file mode 100644 index 000000000..2aa200f97 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshot.java @@ -0,0 +1,187 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +public class SceneSnapshot { + private Long id; + + private Long sceneId; + + private String snapshotId; + + private Date createTime; + + private Date updateTime; + + private String createBy; + + private Integer version; + + private String md5; + + private Integer type; + + private String scene; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSceneId() { + return sceneId; + } + + public void setSceneId(Long sceneId) { + this.sceneId = sceneId; + } + + public String getSnapshotId() { + return snapshotId; + } + + public void setSnapshotId(String snapshotId) { + this.snapshotId = snapshotId == null ? null : snapshotId.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } + + public String getMd5() { + return md5; + } + + public void setMd5(String md5) { + this.md5 = md5 == null ? null : md5.trim(); + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getScene() { + return scene; + } + + public void setScene(String scene) { + this.scene = scene == null ? null : scene.trim(); + } + + public enum Column { + id("id", "id", "BIGINT", false), + sceneId("scene_id", "sceneId", "BIGINT", false), + snapshotId("snapshot_id", "snapshotId", "VARCHAR", false), + createTime("create_time", "createTime", "TIMESTAMP", false), + updateTime("update_time", "updateTime", "TIMESTAMP", false), + createBy("create_by", "createBy", "VARCHAR", false), + version("version", "version", "INTEGER", false), + md5("md5", "md5", "VARCHAR", false), + type("type", "type", "INTEGER", false), + scene("scene", "scene", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshotExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshotExample.java new file mode 100644 index 000000000..66ce719dd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SceneSnapshotExample.java @@ -0,0 +1,794 @@ +package run.mone.mimeter.dashboard.pojo; + +import run.mone.mimeter.dashboard.pojo.common.Pageable; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SceneSnapshotExample implements Pageable { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + + private Integer limit; + + private Long offset; + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + public SceneSnapshotExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Long value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Long value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Long value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Long value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Long value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Long value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Long value1, Long value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Long value1, Long value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIsNull() { + addCriterion("snapshot_id is null"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIsNotNull() { + addCriterion("snapshot_id is not null"); + return (Criteria) this; + } + + public Criteria andSnapshotIdEqualTo(String value) { + addCriterion("snapshot_id =", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotEqualTo(String value) { + addCriterion("snapshot_id <>", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdGreaterThan(String value) { + addCriterion("snapshot_id >", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdGreaterThanOrEqualTo(String value) { + addCriterion("snapshot_id >=", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLessThan(String value) { + addCriterion("snapshot_id <", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLessThanOrEqualTo(String value) { + addCriterion("snapshot_id <=", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdLike(String value) { + addCriterion("snapshot_id like", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotLike(String value) { + addCriterion("snapshot_id not like", value, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdIn(List values) { + addCriterion("snapshot_id in", values, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotIn(List values) { + addCriterion("snapshot_id not in", values, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdBetween(String value1, String value2) { + addCriterion("snapshot_id between", value1, value2, "snapshotId"); + return (Criteria) this; + } + + public Criteria andSnapshotIdNotBetween(String value1, String value2) { + addCriterion("snapshot_id not between", value1, value2, "snapshotId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(Integer value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(Integer value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(Integer value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(Integer value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(Integer value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(Integer value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(Integer value1, Integer value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(Integer value1, Integer value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andMd5IsNull() { + addCriterion("md5 is null"); + return (Criteria) this; + } + + public Criteria andMd5IsNotNull() { + addCriterion("md5 is not null"); + return (Criteria) this; + } + + public Criteria andMd5EqualTo(String value) { + addCriterion("md5 =", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5NotEqualTo(String value) { + addCriterion("md5 <>", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5GreaterThan(String value) { + addCriterion("md5 >", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5GreaterThanOrEqualTo(String value) { + addCriterion("md5 >=", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5LessThan(String value) { + addCriterion("md5 <", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5LessThanOrEqualTo(String value) { + addCriterion("md5 <=", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5Like(String value) { + addCriterion("md5 like", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5NotLike(String value) { + addCriterion("md5 not like", value, "md5"); + return (Criteria) this; + } + + public Criteria andMd5In(List values) { + addCriterion("md5 in", values, "md5"); + return (Criteria) this; + } + + public Criteria andMd5NotIn(List values) { + addCriterion("md5 not in", values, "md5"); + return (Criteria) this; + } + + public Criteria andMd5Between(String value1, String value2) { + addCriterion("md5 between", value1, value2, "md5"); + return (Criteria) this; + } + + public Criteria andMd5NotBetween(String value1, String value2) { + addCriterion("md5 not between", value1, value2, "md5"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLink.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLink.java new file mode 100644 index 000000000..e77bede89 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLink.java @@ -0,0 +1,120 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class SerialLink { + private Integer id; + + private String name; + + private Integer sceneId; + + private Boolean enable; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Integer getSceneId() { + return sceneId; + } + + public void setSceneId(Integer sceneId) { + this.sceneId = sceneId; + } + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", false), + sceneId("scene_id", "sceneId", "INTEGER", false), + enable("enable", "enable", "BIT", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLinkExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLinkExample.java new file mode 100644 index 000000000..51cbd022b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SerialLinkExample.java @@ -0,0 +1,450 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SerialLinkExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SerialLinkExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(Integer value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(Integer value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(Integer value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(Integer value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(Integer value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(Integer value1, Integer value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(Integer value1, Integer value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("enable is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("enable is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("enable =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("enable <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("enable >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("enable >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("enable <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("enable <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("enable in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("enable not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("enable between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("enable not between", value1, value2, "enable"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Sla.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Sla.java new file mode 100644 index 000000000..4c1a18cc3 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/Sla.java @@ -0,0 +1,164 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class Sla { + private Integer id; + + private String name; + + private String note; + + private String businessGroup; + + private Long ctime; + + private Long utime; + + private String creator; + + private String updater; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note == null ? null : note.trim(); + } + + public String getBusinessGroup() { + return businessGroup; + } + + public void setBusinessGroup(String businessGroup) { + this.businessGroup = businessGroup == null ? null : businessGroup.trim(); + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public String getUpdater() { + return updater; + } + + public void setUpdater(String updater) { + this.updater = updater == null ? null : updater.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + name("name", "name", "VARCHAR", false), + note("note", "note", "VARCHAR", false), + businessGroup("business_group", "businessGroup", "VARCHAR", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + creator("creator", "creator", "VARCHAR", false), + updater("updater", "updater", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaExample.java new file mode 100644 index 000000000..e4c9c2c9c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaExample.java @@ -0,0 +1,730 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SlaExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SlaExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNoteIsNull() { + addCriterion("note is null"); + return (Criteria) this; + } + + public Criteria andNoteIsNotNull() { + addCriterion("note is not null"); + return (Criteria) this; + } + + public Criteria andNoteEqualTo(String value) { + addCriterion("note =", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotEqualTo(String value) { + addCriterion("note <>", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThan(String value) { + addCriterion("note >", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteGreaterThanOrEqualTo(String value) { + addCriterion("note >=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThan(String value) { + addCriterion("note <", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLessThanOrEqualTo(String value) { + addCriterion("note <=", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteLike(String value) { + addCriterion("note like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotLike(String value) { + addCriterion("note not like", value, "note"); + return (Criteria) this; + } + + public Criteria andNoteIn(List values) { + addCriterion("note in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotIn(List values) { + addCriterion("note not in", values, "note"); + return (Criteria) this; + } + + public Criteria andNoteBetween(String value1, String value2) { + addCriterion("note between", value1, value2, "note"); + return (Criteria) this; + } + + public Criteria andNoteNotBetween(String value1, String value2) { + addCriterion("note not between", value1, value2, "note"); + return (Criteria) this; + } + + public Criteria andBusinessGroupIsNull() { + addCriterion("business_group is null"); + return (Criteria) this; + } + + public Criteria andBusinessGroupIsNotNull() { + addCriterion("business_group is not null"); + return (Criteria) this; + } + + public Criteria andBusinessGroupEqualTo(String value) { + addCriterion("business_group =", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupNotEqualTo(String value) { + addCriterion("business_group <>", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupGreaterThan(String value) { + addCriterion("business_group >", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupGreaterThanOrEqualTo(String value) { + addCriterion("business_group >=", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupLessThan(String value) { + addCriterion("business_group <", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupLessThanOrEqualTo(String value) { + addCriterion("business_group <=", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupLike(String value) { + addCriterion("business_group like", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupNotLike(String value) { + addCriterion("business_group not like", value, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupIn(List values) { + addCriterion("business_group in", values, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupNotIn(List values) { + addCriterion("business_group not in", values, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupBetween(String value1, String value2) { + addCriterion("business_group between", value1, value2, "businessGroup"); + return (Criteria) this; + } + + public Criteria andBusinessGroupNotBetween(String value1, String value2) { + addCriterion("business_group not between", value1, value2, "businessGroup"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(String value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(String value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(String value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(String value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(String value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(String value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLike(String value) { + addCriterion("updater like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotLike(String value) { + addCriterion("updater not like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(String value1, String value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(String value1, String value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRule.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRule.java new file mode 100644 index 000000000..92502052a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRule.java @@ -0,0 +1,219 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.Arrays; + +public class SlaRule { + private Integer id; + + private Integer slaId; + + private String name; + + private String ruleItemType; + + private String ruleItem; + + private String compareCondition; + + private Integer compareValue; + + private Integer degree; + + private String actionLevel; + + private Long ctime; + + private Long utime; + + private String creator; + + private String updater; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getSlaId() { + return slaId; + } + + public void setSlaId(Integer slaId) { + this.slaId = slaId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getRuleItemType() { + return ruleItemType; + } + + public void setRuleItemType(String ruleItemType) { + this.ruleItemType = ruleItemType == null ? null : ruleItemType.trim(); + } + + public String getRuleItem() { + return ruleItem; + } + + public void setRuleItem(String ruleItem) { + this.ruleItem = ruleItem == null ? null : ruleItem.trim(); + } + + public String getCompareCondition() { + return compareCondition; + } + + public void setCompareCondition(String compareCondition) { + this.compareCondition = compareCondition == null ? null : compareCondition.trim(); + } + + public Integer getCompareValue() { + return compareValue; + } + + public void setCompareValue(Integer compareValue) { + this.compareValue = compareValue; + } + + public Integer getDegree() { + return degree; + } + + public void setDegree(Integer degree) { + this.degree = degree; + } + + public String getActionLevel() { + return actionLevel; + } + + public void setActionLevel(String actionLevel) { + this.actionLevel = actionLevel == null ? null : actionLevel.trim(); + } + + public Long getCtime() { + return ctime; + } + + public void setCtime(Long ctime) { + this.ctime = ctime; + } + + public Long getUtime() { + return utime; + } + + public void setUtime(Long utime) { + this.utime = utime; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator == null ? null : creator.trim(); + } + + public String getUpdater() { + return updater; + } + + public void setUpdater(String updater) { + this.updater = updater == null ? null : updater.trim(); + } + + public enum Column { + id("id", "id", "INTEGER", false), + slaId("sla_id", "slaId", "INTEGER", false), + name("name", "name", "VARCHAR", false), + ruleItemType("rule_item_type", "ruleItemType", "VARCHAR", false), + ruleItem("rule_item", "ruleItem", "VARCHAR", false), + compareCondition("compare_condition", "compareCondition", "VARCHAR", false), + compareValue("compare_value", "compareValue", "INTEGER", false), + degree("degree", "degree", "INTEGER", false), + actionLevel("action_level", "actionLevel", "VARCHAR", false), + ctime("ctime", "ctime", "BIGINT", false), + utime("utime", "utime", "BIGINT", false), + creator("creator", "creator", "VARCHAR", false), + updater("updater", "updater", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRuleExample.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRuleExample.java new file mode 100644 index 000000000..4b970defd --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/SlaRuleExample.java @@ -0,0 +1,1050 @@ +package run.mone.mimeter.dashboard.pojo; + +import java.util.ArrayList; +import java.util.List; + +public class SlaRuleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SlaRuleExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSlaIdIsNull() { + addCriterion("sla_id is null"); + return (Criteria) this; + } + + public Criteria andSlaIdIsNotNull() { + addCriterion("sla_id is not null"); + return (Criteria) this; + } + + public Criteria andSlaIdEqualTo(Integer value) { + addCriterion("sla_id =", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdNotEqualTo(Integer value) { + addCriterion("sla_id <>", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdGreaterThan(Integer value) { + addCriterion("sla_id >", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdGreaterThanOrEqualTo(Integer value) { + addCriterion("sla_id >=", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdLessThan(Integer value) { + addCriterion("sla_id <", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdLessThanOrEqualTo(Integer value) { + addCriterion("sla_id <=", value, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdIn(List values) { + addCriterion("sla_id in", values, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdNotIn(List values) { + addCriterion("sla_id not in", values, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdBetween(Integer value1, Integer value2) { + addCriterion("sla_id between", value1, value2, "slaId"); + return (Criteria) this; + } + + public Criteria andSlaIdNotBetween(Integer value1, Integer value2) { + addCriterion("sla_id not between", value1, value2, "slaId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeIsNull() { + addCriterion("rule_item_type is null"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeIsNotNull() { + addCriterion("rule_item_type is not null"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeEqualTo(String value) { + addCriterion("rule_item_type =", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeNotEqualTo(String value) { + addCriterion("rule_item_type <>", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeGreaterThan(String value) { + addCriterion("rule_item_type >", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeGreaterThanOrEqualTo(String value) { + addCriterion("rule_item_type >=", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeLessThan(String value) { + addCriterion("rule_item_type <", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeLessThanOrEqualTo(String value) { + addCriterion("rule_item_type <=", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeLike(String value) { + addCriterion("rule_item_type like", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeNotLike(String value) { + addCriterion("rule_item_type not like", value, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeIn(List values) { + addCriterion("rule_item_type in", values, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeNotIn(List values) { + addCriterion("rule_item_type not in", values, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeBetween(String value1, String value2) { + addCriterion("rule_item_type between", value1, value2, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemTypeNotBetween(String value1, String value2) { + addCriterion("rule_item_type not between", value1, value2, "ruleItemType"); + return (Criteria) this; + } + + public Criteria andRuleItemIsNull() { + addCriterion("rule_item is null"); + return (Criteria) this; + } + + public Criteria andRuleItemIsNotNull() { + addCriterion("rule_item is not null"); + return (Criteria) this; + } + + public Criteria andRuleItemEqualTo(String value) { + addCriterion("rule_item =", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemNotEqualTo(String value) { + addCriterion("rule_item <>", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemGreaterThan(String value) { + addCriterion("rule_item >", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemGreaterThanOrEqualTo(String value) { + addCriterion("rule_item >=", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemLessThan(String value) { + addCriterion("rule_item <", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemLessThanOrEqualTo(String value) { + addCriterion("rule_item <=", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemLike(String value) { + addCriterion("rule_item like", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemNotLike(String value) { + addCriterion("rule_item not like", value, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemIn(List values) { + addCriterion("rule_item in", values, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemNotIn(List values) { + addCriterion("rule_item not in", values, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemBetween(String value1, String value2) { + addCriterion("rule_item between", value1, value2, "ruleItem"); + return (Criteria) this; + } + + public Criteria andRuleItemNotBetween(String value1, String value2) { + addCriterion("rule_item not between", value1, value2, "ruleItem"); + return (Criteria) this; + } + + public Criteria andCompareConditionIsNull() { + addCriterion("compare_condition is null"); + return (Criteria) this; + } + + public Criteria andCompareConditionIsNotNull() { + addCriterion("compare_condition is not null"); + return (Criteria) this; + } + + public Criteria andCompareConditionEqualTo(String value) { + addCriterion("compare_condition =", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionNotEqualTo(String value) { + addCriterion("compare_condition <>", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionGreaterThan(String value) { + addCriterion("compare_condition >", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionGreaterThanOrEqualTo(String value) { + addCriterion("compare_condition >=", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionLessThan(String value) { + addCriterion("compare_condition <", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionLessThanOrEqualTo(String value) { + addCriterion("compare_condition <=", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionLike(String value) { + addCriterion("compare_condition like", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionNotLike(String value) { + addCriterion("compare_condition not like", value, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionIn(List values) { + addCriterion("compare_condition in", values, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionNotIn(List values) { + addCriterion("compare_condition not in", values, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionBetween(String value1, String value2) { + addCriterion("compare_condition between", value1, value2, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareConditionNotBetween(String value1, String value2) { + addCriterion("compare_condition not between", value1, value2, "compareCondition"); + return (Criteria) this; + } + + public Criteria andCompareValueIsNull() { + addCriterion("compare_value is null"); + return (Criteria) this; + } + + public Criteria andCompareValueIsNotNull() { + addCriterion("compare_value is not null"); + return (Criteria) this; + } + + public Criteria andCompareValueEqualTo(Integer value) { + addCriterion("compare_value =", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueNotEqualTo(Integer value) { + addCriterion("compare_value <>", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueGreaterThan(Integer value) { + addCriterion("compare_value >", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueGreaterThanOrEqualTo(Integer value) { + addCriterion("compare_value >=", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueLessThan(Integer value) { + addCriterion("compare_value <", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueLessThanOrEqualTo(Integer value) { + addCriterion("compare_value <=", value, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueIn(List values) { + addCriterion("compare_value in", values, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueNotIn(List values) { + addCriterion("compare_value not in", values, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueBetween(Integer value1, Integer value2) { + addCriterion("compare_value between", value1, value2, "compareValue"); + return (Criteria) this; + } + + public Criteria andCompareValueNotBetween(Integer value1, Integer value2) { + addCriterion("compare_value not between", value1, value2, "compareValue"); + return (Criteria) this; + } + + public Criteria andDegreeIsNull() { + addCriterion("degree is null"); + return (Criteria) this; + } + + public Criteria andDegreeIsNotNull() { + addCriterion("degree is not null"); + return (Criteria) this; + } + + public Criteria andDegreeEqualTo(Integer value) { + addCriterion("degree =", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeNotEqualTo(Integer value) { + addCriterion("degree <>", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeGreaterThan(Integer value) { + addCriterion("degree >", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeGreaterThanOrEqualTo(Integer value) { + addCriterion("degree >=", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeLessThan(Integer value) { + addCriterion("degree <", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeLessThanOrEqualTo(Integer value) { + addCriterion("degree <=", value, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeIn(List values) { + addCriterion("degree in", values, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeNotIn(List values) { + addCriterion("degree not in", values, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeBetween(Integer value1, Integer value2) { + addCriterion("degree between", value1, value2, "degree"); + return (Criteria) this; + } + + public Criteria andDegreeNotBetween(Integer value1, Integer value2) { + addCriterion("degree not between", value1, value2, "degree"); + return (Criteria) this; + } + + public Criteria andActionLevelIsNull() { + addCriterion("action_level is null"); + return (Criteria) this; + } + + public Criteria andActionLevelIsNotNull() { + addCriterion("action_level is not null"); + return (Criteria) this; + } + + public Criteria andActionLevelEqualTo(String value) { + addCriterion("action_level =", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelNotEqualTo(String value) { + addCriterion("action_level <>", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelGreaterThan(String value) { + addCriterion("action_level >", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelGreaterThanOrEqualTo(String value) { + addCriterion("action_level >=", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelLessThan(String value) { + addCriterion("action_level <", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelLessThanOrEqualTo(String value) { + addCriterion("action_level <=", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelLike(String value) { + addCriterion("action_level like", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelNotLike(String value) { + addCriterion("action_level not like", value, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelIn(List values) { + addCriterion("action_level in", values, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelNotIn(List values) { + addCriterion("action_level not in", values, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelBetween(String value1, String value2) { + addCriterion("action_level between", value1, value2, "actionLevel"); + return (Criteria) this; + } + + public Criteria andActionLevelNotBetween(String value1, String value2) { + addCriterion("action_level not between", value1, value2, "actionLevel"); + return (Criteria) this; + } + + public Criteria andCtimeIsNull() { + addCriterion("ctime is null"); + return (Criteria) this; + } + + public Criteria andCtimeIsNotNull() { + addCriterion("ctime is not null"); + return (Criteria) this; + } + + public Criteria andCtimeEqualTo(Long value) { + addCriterion("ctime =", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotEqualTo(Long value) { + addCriterion("ctime <>", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThan(Long value) { + addCriterion("ctime >", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeGreaterThanOrEqualTo(Long value) { + addCriterion("ctime >=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThan(Long value) { + addCriterion("ctime <", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeLessThanOrEqualTo(Long value) { + addCriterion("ctime <=", value, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeIn(List values) { + addCriterion("ctime in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotIn(List values) { + addCriterion("ctime not in", values, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeBetween(Long value1, Long value2) { + addCriterion("ctime between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andCtimeNotBetween(Long value1, Long value2) { + addCriterion("ctime not between", value1, value2, "ctime"); + return (Criteria) this; + } + + public Criteria andUtimeIsNull() { + addCriterion("utime is null"); + return (Criteria) this; + } + + public Criteria andUtimeIsNotNull() { + addCriterion("utime is not null"); + return (Criteria) this; + } + + public Criteria andUtimeEqualTo(Long value) { + addCriterion("utime =", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotEqualTo(Long value) { + addCriterion("utime <>", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThan(Long value) { + addCriterion("utime >", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeGreaterThanOrEqualTo(Long value) { + addCriterion("utime >=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThan(Long value) { + addCriterion("utime <", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeLessThanOrEqualTo(Long value) { + addCriterion("utime <=", value, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeIn(List values) { + addCriterion("utime in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotIn(List values) { + addCriterion("utime not in", values, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeBetween(Long value1, Long value2) { + addCriterion("utime between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andUtimeNotBetween(Long value1, Long value2) { + addCriterion("utime not between", value1, value2, "utime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(String value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(String value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(String value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(String value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(String value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(String value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLike(String value) { + addCriterion("updater like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotLike(String value) { + addCriterion("updater not like", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(String value1, String value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(String value1, String value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/common/Pageable.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/common/Pageable.java new file mode 100644 index 000000000..2963666ae --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/pojo/common/Pageable.java @@ -0,0 +1,13 @@ +package run.mone.mimeter.dashboard.pojo.common; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +public interface Pageable { + + void setLimit(Integer limit); + + void setOffset(Long offset); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/AgentService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/AgentService.java new file mode 100644 index 000000000..1a2d2599a --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/AgentService.java @@ -0,0 +1,46 @@ +package run.mone.mimeter.dashboard.service; + +import com.xiaomi.mone.tpc.common.vo.OrgInfoVo; +import run.mone.mimeter.dashboard.bo.agent.*; +import run.mone.mimeter.dashboard.bo.common.Result; + +import java.util.List; + +public interface AgentService { + Result> getAgentListByTenant(String tenant); + + Result getAllAgentList(GetAgentListReq req); + + Result getApplyList(GetApplyListReq req); + + Result> getOrgList(String keyword); + + Result> getAllAvailableAgentList(); + + Result applyAgent(AgentApplyReq req); + + Result refuseApply(Integer applyID); + + Result approveApply(Integer applyID); + + Result tenantForAgent(TenantForAgentReq req); + + Result applyAgentDomain(List req); + + Result applyAgentDomainByRate(DomainApplyByRateReq req); + + Result getDomainApplyList(GetApplyListReq req); + + Result approveDomainApply(Integer applyID); + + Result refuseDomainApply(Integer applyID); + + Result hostForAgent(HostForAgentReq req); + + Result delHostForAgents(DelHostForAgentsReq req); + + Result getAgentHostsFile(LoadHostsFileReq req); + + Result syncDomainConf(); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/BenchMonitorService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/BenchMonitorService.java new file mode 100644 index 000000000..16533b445 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/BenchMonitorService.java @@ -0,0 +1,12 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.scene.SceneTaskAppsBo; +import run.mone.mimeter.dashboard.bo.agent.AgentMonitorBo; +import run.mone.mimeter.dashboard.bo.common.Result; + +public interface BenchMonitorService { + Result getAppListByReportID(Integer sceneId,String reportId,Boolean realTime); + + Result getAgentInfosByReport(String reportId, Boolean realTime); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/DatasetService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/DatasetService.java new file mode 100644 index 000000000..7b33305f5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/DatasetService.java @@ -0,0 +1,54 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.*; +import run.mone.mimeter.dashboard.pojo.Dataset; + +import java.util.List; +import java.util.Set; +import java.util.TreeMap; + +public interface DatasetService { + + /** + * sla + */ + Result newDataset(DatasetDto param); + + Result> multiNewDataset(List param); + + Result updateDataset(DatasetDto param); + + Result multiUpdateDataset(List param); + + Result getDatasetList(GetDatasetListReq req); + + Result> getDatasetListByIds(List datasetIds); + + Result getDatasetById(int id); + + Result delDataset(int id); + + Result multiDelDataset(List ids); + + Result bindScene(int datasetId, int sceneId); + + Result bindDataSetsByScene(List datasetIds, Set refDatasetIds, int sceneId); + + Result unbindScene(int datasetId, int sceneId); + + Result filePreview(int id); + + Result> getParamDataByIds(List ids); + + Result> getParamDataBySceneId(Integer sceneId); + + List getDatasetIdsBySceneId(Integer sceneId); + + Result sceneFileDetail(Integer sceneId); + + TreeMap> getParamDataMap(List reqList); + + boolean syncTenant(); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/EsLogService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/EsLogService.java new file mode 100644 index 000000000..3ebd32e0e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/EsLogService.java @@ -0,0 +1,18 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.PagedResp; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReqRespLogRecord; +import run.mone.mimeter.dashboard.bo.report.SearchApiLogReq; + +import java.util.List; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/6 + */ +public interface EsLogService { + + Result>> searchApiLogs(SearchApiLogReq req); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/OperationLogService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/OperationLogService.java new file mode 100644 index 000000000..d47b7c99f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/OperationLogService.java @@ -0,0 +1,22 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.operationlog.GetOperationLogListReq; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogDto; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogList; +import run.mone.mimeter.dashboard.bo.sla.GetSlaListReq; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; +import run.mone.mimeter.dashboard.bo.sla.SlaList; + +import java.util.List; + +public interface OperationLogService { + + /** + * sla + */ + void newOperationLog(OperationLogDto param); + + Result getOperationLogList(GetOperationLogListReq req); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/ReportInfoService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/ReportInfoService.java new file mode 100644 index 000000000..00dde1c47 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/ReportInfoService.java @@ -0,0 +1,26 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; + +import java.util.List; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/22 + */ +public interface ReportInfoService { + + Result> listReports(String tenant, String keyword, Integer pageNo, Integer pageSize); + + Result countReports(String tenant, String keyword, Integer pageNo, Integer pageSize); + + Result getReportDetails(Long sceneId, String reportId); + + Result createReport(ReportInfoBo bo); + + Result removeReports(List reportIds); + + Result updateReport(ReportInfoBo bo); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneApiService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneApiService.java new file mode 100644 index 000000000..ad1feb3da --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneApiService.java @@ -0,0 +1,41 @@ +package run.mone.mimeter.dashboard.service; + +import com.alibaba.nacos.api.exception.NacosException; +import run.mone.mimeter.dashboard.bo.DubboService; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.DefaultSceneInfo; +import run.mone.mimeter.dashboard.bo.scene.DubboApiInfoDTO; +import run.mone.mimeter.dashboard.bo.scene.HttpApiInfoDTO; +import run.mone.mimeter.dashboard.bo.sceneapi.GetApiDetailReq; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneApiInfoItemBasic; + +import java.util.List; + +public interface SceneApiService { + Result searchApiFromMiApi(String keyword, Integer apiProtocol); + + Result getApiDetailFromMiApi(GetApiDetailReq getApiDetailReq); + + Result getSceneBasicInfoFromApiID(GetApiDetailReq req); + + boolean newHttpSceneApis(List httpApiInfoDTOS, int sceneId,int serialLinkId); + + boolean updateHttpSceneApi(HttpApiInfoDTO httpApiInfoDTO); + + boolean updateDubboSceneApi(DubboApiInfoDTO dubboApiInfoDTO); + + boolean newDubboSceneApis(List dubboApiInfoDTOS, int sceneId,int serialLinkId); + + boolean deleteSceneApisBySceneId(int sceneId); + + boolean deleteSceneApisBySerialLinkId(int serialLinkId); + + Result> loadDubboApiServices(String keyword, String env); + + Result> getServiceMethod(String serviceName, String env) throws NacosException; + + List getBasicInfosByIds(List apiIdList); + + Result getApiUrlById(Integer apiId); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneGroupService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneGroupService.java new file mode 100644 index 000000000..7697a9fd2 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneGroupService.java @@ -0,0 +1,14 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.CreateSceneDTO; +import run.mone.mimeter.dashboard.bo.scene.EditSceneDTO; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupDTO; + +public interface SceneGroupService { + Result newSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser); + + Result delSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser); + + Result editSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneService.java new file mode 100644 index 000000000..79b0a39ad --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneService.java @@ -0,0 +1,34 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.SceneParamData; +import run.mone.mimeter.dashboard.bo.scene.*; +import run.mone.mimeter.dashboard.bo.scenegroup.GetSceneGroupListReq; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupList; +import run.mone.mimeter.dashboard.pojo.SceneInfo; + +import java.util.List; + +public interface SceneService { + Result newScene(CreateSceneDTO createSceneReq, String opUser); + + Result delScene(Integer sceneID, String opUser); + + Result editScene(EditSceneDTO editSceneReq, String opUser); + + Result getSceneByID(Integer sceneID,boolean engine); + + Result getSceneList(GetSceneListReq req); + + Result> getSceneListByIds(GetSceneListByIdsReq req); + + Result getSceneListByGroup(GetSceneGroupListReq req); + + Result> getSceneInfoByIds(List sceneIds); + + Result getSceneParamData(Integer sceneId); + + Result getSceneListByKeyword(GetSceneListReq req); + + List getSerialLinksByIds(List serialIds); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneSnapshotService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneSnapshotService.java new file mode 100644 index 000000000..5a92d418e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SceneSnapshotService.java @@ -0,0 +1,31 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.SceneSnapshotBo; + +import java.util.List; +import java.util.Map; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/23 + */ +public interface SceneSnapshotService { + + Result getSceneSnapshotById(String snapshotId); + + /** + * only return meta data; does not contain scene data + */ + Result getSceneSnapshotByScene(Long sceneId); + + /** + * return scene data as well + */ + Result getSceneSnapshotDetailByScene(Long sceneId); + + Result createSnapshot(SceneSnapshotBo bo); + + Map sceneNameMapFromIds(List snapshotIds); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SlaService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SlaService.java new file mode 100644 index 000000000..0e94eadae --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/SlaService.java @@ -0,0 +1,27 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.sla.GetSlaListReq; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; +import run.mone.mimeter.dashboard.bo.sla.SlaList; + +import java.util.List; + +public interface SlaService { + + /** + * sla + */ + Result newSla(SlaDto param); + + Result updateSla(SlaDto param); + + Result getSlaList(GetSlaListReq req); + + Result getSlaById(int id); + + Result delSla(int id); + + Result multiDelSla(List ids); + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/TaskService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/TaskService.java new file mode 100644 index 000000000..3baa182da --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/TaskService.java @@ -0,0 +1,30 @@ +package run.mone.mimeter.dashboard.service; + +import run.mone.mimeter.dashboard.bo.ChangeQpsReq; +import run.mone.mimeter.dashboard.bo.DubboSceneDebugResult; +import run.mone.mimeter.dashboard.bo.HttpSceneDebugResult; +import run.mone.mimeter.dashboard.bo.SubmitTaskRes; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.task.SceneRpsRateReq; +import run.mone.mimeter.dashboard.bo.task.TaskDTO; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.util.List; +import java.util.TreeMap; + +public interface TaskService { + + Result submitTask(TaskDTO taskDTO, String opUser); + + Result stopTask(Integer type,TaskDTO taskDTO,String opUser); + + Result manualUpdateRps(ChangeQpsReq req); + + Result manualUpdateSceneRpsRate(SceneRpsRateReq req); + + Result>> getHttpSceneDebugResultByTaskId(String reportId, String opUser); + + Result>> getDubboSceneDebugResultByTaskId(String reportId, String opUser); + + SseEmitter stream(String reportId, String username); +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/AgentServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/AgentServiceImpl.java new file mode 100644 index 000000000..48c2ff2ba --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/AgentServiceImpl.java @@ -0,0 +1,680 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.mone.tpc.api.service.NodeFacade; +import com.xiaomi.mone.tpc.api.service.UserOrgFacade; +import com.xiaomi.mone.tpc.common.param.NodeOrgQryParam; +import com.xiaomi.mone.tpc.common.param.NullParam; +import com.xiaomi.mone.tpc.common.vo.OrgInfoVo; +import com.xiaomi.mone.tpc.common.vo.PageDataVo; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import run.mone.mimeter.dashboard.bo.agent.*; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.common.HttpDao; +import run.mone.mimeter.dashboard.common.HttpResult; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.AgentApplyInfoMapper; +import run.mone.mimeter.dashboard.mapper.AgentInfoMapper; +import run.mone.mimeter.dashboard.mapper.DomainApplyInfoMapper; +import run.mone.mimeter.dashboard.service.AgentService; +import run.mone.mimeter.dashboard.pojo.*; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.DEFAULT_PAGE_SIZE; + +@Service +@Slf4j +public class AgentServiceImpl implements AgentService { + + private final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + + private final ExecutorService pool = Executors.newSingleThreadExecutor(); + + @Autowired + private AgentInfoMapper agentInfoMapper; + + @Autowired + private AgentApplyInfoMapper agentApplyInfoMapper; + + @Autowired + private DomainApplyInfoMapper domainApplyInfoMapper; + @DubboReference(registry = "stRegistry", check = false, group = "staging-open", version = "1.0") + private UserOrgFacade userOrgFacade; + + @DubboReference(registry = "stRegistry", check = false, group = "staging-open", version = "1.0") + private NodeFacade nodeFacade; + + /** + * 心跳超时 15s + */ + private static final int timeout_period = 15 * 1000; + + private static final Gson gson = new Gson(); + + /** + * 公用租户 + */ + private static final String PUB_TENANT = "MI"; + + + /** + * bench manager addr + */ + @NacosValue(autoRefreshed = true, value = "${bench.api_manager_url}") + private String apiSvrUrl; + + @Autowired + private HttpDao httpDao; + + /** + * 每 10s 检查agent机器状态 + */ + @PostConstruct + public void init() { + executorService.scheduleAtFixedRate(this::checkAgentStatus, 0, 30, TimeUnit.SECONDS); + } + + public void checkAgentStatus() { + try { + long now = System.currentTimeMillis(); + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpIsNotNull(); + List agentInfos = agentInfoMapper.selectByExample(example); + agentInfos.forEach(agentInfo -> { + long lastBeatTime = agentInfo.getUtime(); + if ((now - lastBeatTime) >= timeout_period) { + agentInfo.setEnable(false); + agentInfoMapper.updateByPrimaryKey(agentInfo); + } + }); + } catch (Throwable ex) { + log.error(ex.getMessage()); + } + } + + @Override + public Result> getAgentListByTenant(String tenant) { + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andTenantEqualTo(tenant).andIpIsNotNull().andEnableEqualTo(true); + example.or(example.createCriteria().andTenantEqualTo(PUB_TENANT).andIpIsNotNull().andEnableEqualTo(true)); + List agentInfos = agentInfoMapper.selectByExampleWithBLOBs(example); + + return Result.success(agentInfos.stream().map(agentInfo -> { + AgentDTO agentDTO = new AgentDTO(); + BeanUtils.copyProperties(agentInfo, agentDTO); + if (agentInfo.getDomainConf() != null) { + agentDTO.setDomainConfs(gson.fromJson(agentInfo.getDomainConf(), new TypeToken>() { + }.getType())); + } else { + agentDTO.setDomainConfs(new ArrayList<>()); + } + return agentDTO; + }).collect(Collectors.toList())); + } + + @Override + public Result getAllAgentList(GetAgentListReq req) { + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + AgentInfoExample totalExp = new AgentInfoExample(); + totalExp.createCriteria().andIpIsNotNull().andNodeIpIsNotNull().andEnableEqualTo(true); + + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpIsNotNull().andNodeIpIsNotNull().andEnableEqualTo(true); + example.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + List agentInfos = agentInfoMapper.selectByExampleWithBLOBs(example); + + AgentDTOList agentDTOList = new AgentDTOList(); + agentDTOList.setPage(req.getPage()); + agentDTOList.setPageSize(req.getPageSize()); + + List list = agentInfos.stream().map(agentInfo -> { + AgentDTO agentDTO = new AgentDTO(); + BeanUtils.copyProperties(agentInfo, agentDTO); + if (agentInfo.getDomainConf() != null) { + agentDTO.setDomainConfs(gson.fromJson(agentInfo.getDomainConf(), new TypeToken>() { + }.getType())); + } else { + agentDTO.setDomainConfs(new ArrayList<>()); + } + return agentDTO; + }).collect(Collectors.toList()); + + agentDTOList.setList(list); + agentDTOList.setTotal(agentInfoMapper.countByExample(totalExp)); + + return Result.success(agentDTOList); + } + + @Override + public Result getApplyList(GetApplyListReq req) { + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + AgentApplyInfoExample totalExp = new AgentApplyInfoExample(); + AgentApplyInfoExample.Criteria totalCriteria = totalExp.createCriteria(); + + AgentApplyInfoExample applyInfoExample = new AgentApplyInfoExample(); + AgentApplyInfoExample.Criteria exampleCriteria = applyInfoExample.createCriteria(); + + if (req.getApplyUser() != null && !req.getApplyUser().equals("")) { + exampleCriteria.andApplyUserEqualTo(req.getApplyUser()); + totalCriteria.andApplyUserEqualTo(req.getApplyUser()); + } + + if (req.getApplyStatus() != null) { + exampleCriteria.andApplyStatusEqualTo(req.getApplyStatus()); + totalCriteria.andApplyStatusEqualTo(req.getApplyStatus()); + } + applyInfoExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + AgentApplyList agentApplyList = new AgentApplyList(); + agentApplyList.setPage(req.getPage()); + agentApplyList.setPageSize(req.getPageSize()); + + List applyInfoList = agentApplyInfoMapper.selectByExample(applyInfoExample); + if (applyInfoList == null || applyInfoList.size() == 0) { + return Result.success(agentApplyList); + } + List applyDTOS = new ArrayList<>(applyInfoList.size()); + + applyInfoList.forEach(agentApplyInfo -> { + AgentApplyDTO dto = new AgentApplyDTO(); + BeanUtils.copyProperties(agentApplyInfo, dto); + applyDTOS.add(dto); + }); + agentApplyList.setList(applyDTOS); + agentApplyList.setTotal(agentApplyInfoMapper.countByExample(totalExp)); + return Result.success(agentApplyList); + } + + @Override + public Result> getOrgList(String keyword) { + NodeOrgQryParam param = new NodeOrgQryParam(); + param.setAccount("system"); + param.setUserType(0); + param.setOrgName(keyword); + PageDataVo vo = nodeFacade.orgList(param).getData(); + return Result.success(vo.getList()); + } + + @Override + public Result> getAllAvailableAgentList() { + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpIsNotNull().andNodeIpIsNotNull().andEnableEqualTo(true).andTenantIsNull(); + example.or(example.createCriteria().andIpIsNotNull().andNodeIpIsNotNull().andEnableEqualTo(true).andTenantEqualTo("")); + List agentInfos = agentInfoMapper.selectByExample(example); + + return Result.success(agentInfos.stream().map(agentInfo -> { + AgentDTO agentDTO = new AgentDTO(); + BeanUtils.copyProperties(agentInfo, agentDTO); + return agentDTO; + }).collect(Collectors.toList())); + } + + @Override + public Result applyAgent(AgentApplyReq req) { + req.getAgentIDs().forEach(agentId -> { + AgentInfo agentInfo = agentInfoMapper.selectByPrimaryKey(agentId); + if (agentInfo == null) { + return; + } + NullParam param = new NullParam(); + param.setAccount(req.getApplier()); + param.setUserType(0); + OrgInfoVo orgInfoVo = userOrgFacade.getOrgByAccount(param).getData(); + if (orgInfoVo == null) { + return; + } + AgentApplyInfoExample example = new AgentApplyInfoExample(); + //该组织已申请过该机器,待审核 + example.createCriteria().andAgentIpEqualTo(agentInfo.getNodeIp()).andApplyOrgIdEqualTo(orgInfoVo.getIdPath()).andApplyStatusEqualTo(ApplyStatusEnum.UnAuditing.statusCode); + List applyInfos = agentApplyInfoMapper.selectByExample(example); + if (applyInfos != null && applyInfos.size() != 0) { + return; + } + AgentApplyInfo apply = new AgentApplyInfo(); + apply.setApplyUser(req.getApplier()); + apply.setApplyOrgId(orgInfoVo.getIdPath()); + apply.setApplyOrgName(orgInfoVo.getNamePath()); + apply.setAgentIp(agentInfo.getNodeIp()); + apply.setAgentHostname(agentInfo.getHostname()); + apply.setApplyStatus(ApplyStatusEnum.UnAuditing.statusCode); + apply.setCtime(System.currentTimeMillis()); + + agentApplyInfoMapper.insert(apply); + }); + + return Result.success(true); + } + + @Override + public Result refuseApply(Integer applyID) { + AgentApplyInfo applyInfo = agentApplyInfoMapper.selectByPrimaryKey(applyID); + if (applyInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + applyInfo.setApplyStatus(ApplyStatusEnum.ApplyRefuse.statusCode); + agentApplyInfoMapper.updateByPrimaryKey(applyInfo); + + return Result.success(true); + } + + @Override + @Transactional + public Result approveApply(Integer applyID) { + AgentApplyInfo applyInfo = agentApplyInfoMapper.selectByPrimaryKey(applyID); + if (applyInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andNodeIpEqualTo(applyInfo.getAgentIp()); + List agentInfo = agentInfoMapper.selectByExample(example); + if (agentInfo == null || agentInfo.size() != 1) { + return Result.fail(CommonError.InvalidParamError); + } + AgentInfo agent = agentInfo.get(0); + if (agent.getTenant() != null && !agent.getTenant().equals("")) { + return Result.fail(CommonError.AgentAlreadyGetTenant); + } + agent.setTenant(applyInfo.getApplyOrgId()); + agent.setTenantCn(applyInfo.getApplyOrgName()); + agentInfoMapper.updateByPrimaryKey(agent); + + //更新工单 + applyInfo.setApplyStatus(ApplyStatusEnum.ApplyPass.statusCode); + agentApplyInfoMapper.updateByPrimaryKey(applyInfo); + return Result.success(true); + } + + @Override + public Result tenantForAgent(TenantForAgentReq req) { + AgentInfo agentInfo = agentInfoMapper.selectByPrimaryKey(req.getAgentID()); + if (agentInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + agentInfo.setTenant(req.getTenant()); + agentInfo.setTenantCn(req.getTenantCn()); + + agentInfoMapper.updateByPrimaryKey(agentInfo); + return Result.success(true); + } + + @Override + public Result applyAgentDomain(List req) { + List domainApplyInfoList = new ArrayList<>(); + AtomicBoolean errorIp = new AtomicBoolean(false); + req.forEach(domainApplyReq -> { + domainApplyReq.getAgentIPs().forEach(agentIp -> { + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpEqualTo(agentIp); + List agentInfos = agentInfoMapper.selectByExample(example); + if (agentInfos == null || agentInfos.size() == 0) { + errorIp.set(true); + } + }); + + if (errorIp.get()) { + return; + } + DomainApplyInfo apply = new DomainApplyInfo(); + apply.setApplyStatus(ApplyStatusEnum.UnAuditing.statusCode); + apply.setApplyUser(domainApplyReq.getApplier()); + apply.setCtime(System.currentTimeMillis()); + apply.setDomain(domainApplyReq.getDomain()); + apply.setIp(domainApplyReq.getIp()); + + apply.setAgentIpList(gson.toJson(domainApplyReq.getAgentIPs())); + domainApplyInfoList.add(apply); + }); + if (errorIp.get()) { + return Result.fail(CommonError.InvalidParamError); + } + domainApplyInfoMapper.batchInsert(domainApplyInfoList); + + return Result.success(true); + } + + @Override + public Result applyAgentDomainByRate(DomainApplyByRateReq req) { + List domainApplyReqList = new ArrayList<>(req.getDomainIpAndRates().size()); + //申请的全部机器 + List agentIps = req.getAgentIPs(); + if (agentIps.size() == 0 || agentIps.size() == 1) { + return Result.fail(CommonError.InvalidAgentNumError); + } + //总机器数 + int totalAgent = agentIps.size(); + List flagList = new ArrayList<>(); + int tmpSumRate = 0; + for (DomainIpAndRate ipRate : + req.getDomainIpAndRates()) { + //比例分隔标记 + tmpSumRate += ipRate.getRate(); + double rate = tmpSumRate / 100d; + int index = (int) (totalAgent * rate) - 1; + flagList.add(index); + } + + int pointer = -1; + for (int i = 0; i < req.getDomainIpAndRates().size(); i++) { + DomainApplyReq domainApplyReq = new DomainApplyReq(); + domainApplyReq.setApplier(req.getApplier()); + domainApplyReq.setDomain(req.getDomain()); + domainApplyReq.setIp(req.getDomainIpAndRates().get(i).getIp()); + domainApplyReq.setAgentIPs(agentIps.subList(pointer + 1, flagList.get(i))); + pointer = flagList.get(i); + domainApplyReqList.add(domainApplyReq); + } + return this.applyAgentDomain(domainApplyReqList); + } + + @Override + public Result getDomainApplyList(GetApplyListReq req) { + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + DomainApplyInfoExample totalExp = new DomainApplyInfoExample(); + DomainApplyInfoExample.Criteria totalCriteria = totalExp.createCriteria(); + + DomainApplyInfoExample applyInfoExample = new DomainApplyInfoExample(); + DomainApplyInfoExample.Criteria exampleCriteria = applyInfoExample.createCriteria(); + + if (req.getApplyUser() != null && !req.getApplyUser().equals("")) { + exampleCriteria.andApplyUserEqualTo(req.getApplyUser()); + totalCriteria.andApplyUserEqualTo(req.getApplyUser()); + } + + if (req.getApplyStatus() != null) { + exampleCriteria.andApplyStatusEqualTo(req.getApplyStatus()); + totalCriteria.andApplyStatusEqualTo(req.getApplyStatus()); + } + applyInfoExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + DomainApplyList agentApplyList = new DomainApplyList(); + agentApplyList.setPage(req.getPage()); + agentApplyList.setPageSize(req.getPageSize()); + + List applyInfoList = domainApplyInfoMapper.selectByExampleWithBLOBs(applyInfoExample); + if (applyInfoList == null || applyInfoList.size() == 0) { + return Result.success(agentApplyList); + } + List applyDTOS = new ArrayList<>(applyInfoList.size()); + + applyInfoList.forEach(agentApplyInfo -> { + DomainApplyDTO dto = new DomainApplyDTO(); + BeanUtils.copyProperties(agentApplyInfo, dto); + dto.setAgentIpList(gson.fromJson(agentApplyInfo.getAgentIpList(), new TypeToken>() { + }.getType())); + applyDTOS.add(dto); + }); + agentApplyList.setList(applyDTOS); + agentApplyList.setTotal(domainApplyInfoMapper.countByExample(totalExp)); + return Result.success(agentApplyList); + } + + @Override + @Transactional + public Result approveDomainApply(Integer applyID) { + DomainApplyInfo applyInfo = domainApplyInfoMapper.selectByPrimaryKey(applyID); + if (applyInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + DomainApplyReq agentReq = new DomainApplyReq(); + agentReq.setDomain(applyInfo.getDomain()); + agentReq.setIp(applyInfo.getIp()); + agentReq.setAgentIPs(gson.fromJson(applyInfo.getAgentIpList(), new TypeToken>() { + }.getType())); + + HttpResult result; + try { + result = httpDao.post(apiSvrUrl + "/edit/hosts", gson.toJson(agentReq)); + } catch (Exception e) { + log.error("[TaskService.submitTask] failed to submit task, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.APIServerError); + } + + if (result.getCode() == 200) { + //更新工单 + applyInfo.setApplyStatus(ApplyStatusEnum.ApplyPass.statusCode); + domainApplyInfoMapper.updateByPrimaryKey(applyInfo); + + //更新机器domain字段 + CompletableFuture.runAsync(() -> callbackUpdateAgentHosts(agentReq), pool); + + return Result.success(true); + } + return Result.fail(CommonError.InvalidParamError); + } + + /** + * 发压机host更新成功后,回调保存各个机器域名绑定记录(新增或修改) + */ + private void callbackUpdateAgentHosts(DomainApplyReq agentReq) { + List agentIpList = agentReq.getAgentIPs(); + if (agentIpList != null) { + agentIpList.forEach(agentIp -> { + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpEqualTo(agentIp); + List agentInfoList = agentInfoMapper.selectByExampleWithBLOBs(example); + //机器存在 + if (agentInfoList != null && agentInfoList.size() != 0) { + AgentInfo agentInfo = agentInfoList.get(0); + if (agentInfo.getEnable()) { + List domainConfs; + if (agentInfo.getDomainConf() == null) { + //暂无域名配置 + domainConfs = new ArrayList<>(); + DomainConf domainConf = new DomainConf(); + domainConf.setDomain(agentReq.getDomain()); + domainConf.setIp(agentReq.getIp()); + domainConfs.add(domainConf); + agentInfo.setDomainConf(gson.toJson(domainConfs)); + } else { + //已有域名绑定配置 + domainConfs = gson.fromJson(agentInfo.getDomainConf(), new TypeToken>() { + }.getType()); + boolean find = false; + for (DomainConf domainConf : + domainConfs) { + if (agentReq.getDomain().equals(domainConf.getDomain())) { + find = true; + //更新该域名绑定的ip + domainConf.setIp(agentReq.getIp()); + break; + } + } + if (!find) { + //无相同域名,追加 + DomainConf domainConf = new DomainConf(); + domainConf.setDomain(agentReq.getDomain()); + domainConf.setIp(agentReq.getIp()); + domainConfs.add(domainConf); + } + agentInfo.setDomainConf(gson.toJson(domainConfs)); + } + //更新 + agentInfoMapper.updateByPrimaryKeyWithBLOBs(agentInfo); + } + } + }); + } + } + + /** + * 发压机host更新成功后,回调保存各个机器域名绑定记录(新增或修改) + */ + private void callbackDelAgentHosts(DelHostForAgentsReq agentReq) { + List agentIpList = agentReq.getAgentIps(); + if (agentIpList != null) { + agentIpList.forEach(agentIp -> { + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIpEqualTo(agentIp); + List agentInfoList = agentInfoMapper.selectByExampleWithBLOBs(example); + //机器存在 + if (agentInfoList != null && agentInfoList.size() != 0) { + AgentInfo agentInfo = agentInfoList.get(0); + if (agentInfo.getEnable()) { + List domainConfs; + if (agentInfo.getDomainConf() == null) { + //暂无域名配置 + } else { + //已有域名绑定配置 + domainConfs = gson.fromJson(agentInfo.getDomainConf(), new TypeToken>() { + }.getType()); + //过滤删除的域名配置 + domainConfs = domainConfs.stream().filter(domainConf -> !agentReq.getDomain().equals(domainConf.getDomain().trim())).collect(Collectors.toList()); + agentInfo.setDomainConf(gson.toJson(domainConfs)); + } + //更新 + agentInfoMapper.updateByPrimaryKeyWithBLOBs(agentInfo); + } + } + }); + } + } + + @Override + public Result refuseDomainApply(Integer applyID) { + DomainApplyInfo applyInfo = domainApplyInfoMapper.selectByPrimaryKey(applyID); + if (applyInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + //更新工单 + applyInfo.setApplyStatus(ApplyStatusEnum.ApplyRefuse.statusCode); + domainApplyInfoMapper.updateByPrimaryKey(applyInfo); + return Result.success(true); + } + + @Override + public Result hostForAgent(HostForAgentReq req) { + HttpResult result; + try { + result = httpDao.post(apiSvrUrl + "/manual/edit/hosts", gson.toJson(req)); + } catch (Exception e) { + log.error("[TaskService.hostForAgent] failed to submit task, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + + DomainApplyReq agentReq = new DomainApplyReq(); + agentReq.setDomain(req.getDomain()); + agentReq.setIp(req.getIp()); + agentReq.setAgentIPs(Collections.singletonList(req.getAgentIp())); + + CompletableFuture.runAsync(() -> callbackUpdateAgentHosts(agentReq), pool); + + return Result.success(true); + } + return Result.fail(CommonError.UnknownError); + } + + @Override + public Result delHostForAgents(DelHostForAgentsReq req) { + + HttpResult result; + try { + result = httpDao.post(apiSvrUrl + "/del/hosts", gson.toJson(req)); + } catch (Exception e) { + log.error("[TaskService.delHostForAgents] failed to del host from agent, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + //异步更新删除域名绑定配置 + CompletableFuture.runAsync(() -> callbackDelAgentHosts(req), pool); + return Result.success(true); + } + return Result.fail(CommonError.UnknownError); + } + + @Override + public Result getAgentHostsFile(LoadHostsFileReq req) { + HttpResult result; + try { + result = httpDao.post(apiSvrUrl + "/load/hosts", gson.toJson(req)); + } catch (Exception e) { + log.error("[TaskService.getAgentHostsFile] failed to del host from agent, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + return Result.success(result.getData()); + } + return Result.fail(CommonError.UnknownError); + } + + /** + * 同步域名绑定配置到压测机 + */ + @Override + public Result syncDomainConf() { + AgentInfoExample example = new AgentInfoExample(); + + example.createCriteria().andEnableEqualTo(true); + List agentInfoList = agentInfoMapper.selectByExampleWithBLOBs(example); + if (agentInfoList == null || agentInfoList.size() == 0) { + return Result.success(true); + } + SyncHostsReq syncHostsReq = new SyncHostsReq(); + List agentHostsConfList = new ArrayList<>(); + List domainConfList; + + for (AgentInfo agentInfo : + agentInfoList) { + if (agentInfo.getDomainConf() != null) { + //存在绑定域名配置,需要同步到压测机 + AgentHostsConf hostsConf = new AgentHostsConf(); + hostsConf.setAgentIp(agentInfo.getIp()); + domainConfList = gson.fromJson(agentInfo.getDomainConf(), new TypeToken>() { + }.getType()); + hostsConf.setDomainConfs(domainConfList); + agentHostsConfList.add(hostsConf); + } + } + //调用manager的请求数据 + //{"agentHostsConfList":[{"agentIp":"127.0.0.1","domainConfs":[{}]}]} + syncHostsReq.setAgentHostsConfList(agentHostsConfList); + + HttpResult result; + try { + result = httpDao.post(apiSvrUrl + "/sync/hosts", gson.toJson(syncHostsReq)); + } catch (Exception e) { + log.error("[TaskService.getAgentHostsFile] failed to del host from agent, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.UnknownError); + } + if (result.getCode() == 200) { + return Result.success(true); + } + return Result.fail(CommonError.APIServerError); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchBroadcastServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchBroadcastServiceImpl.java new file mode 100644 index 000000000..0626a4a73 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchBroadcastServiceImpl.java @@ -0,0 +1,289 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.common.EmitterTypeEnum; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; +import run.mone.mimeter.dashboard.bo.sla.SlaRuleItemTypeEnum; +import run.mone.mimeter.dashboard.bo.statistics.TotalStatAnalysisEvent; +import run.mone.mimeter.dashboard.bo.sla.BenchEvent; +import run.mone.mimeter.dashboard.bo.sla.SlaEvent; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.mapper.CheckPointInfoMapper; +import run.mone.mimeter.dashboard.mapper.ReportInfoMapper; +import run.mone.mimeter.dashboard.mapper.SceneApiInfoMapper; +import run.mone.mimeter.dashboard.pojo.CheckPointInfo; +import run.mone.mimeter.dashboard.pojo.ReportInfo; +import run.mone.mimeter.dashboard.pojo.ReportInfoExample; +import run.mone.mimeter.dashboard.pojo.SceneApiInfo; +import run.mone.mimeter.dashboard.service.BenchBroadcastService; +import run.mone.mimeter.dashboard.service.ReportInfoService; +import run.mone.mimeter.dashboard.service.SceneApiService; +import run.mone.mimeter.dashboard.service.SceneService; + +import java.util.*; + +import static com.google.common.base.Preconditions.checkArgument; +import static run.mone.mimeter.dashboard.bo.common.Constants.REPORT_STATUS_INACTIVE; + +/** + * @author dongzhenxing + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/21 + */ +@Slf4j +@DubboService(interfaceClass = BenchBroadcastService.class, group = "${dubbo.group}",version = "${dubbo.version}",timeout = 20000) +public class BenchBroadcastServiceImpl implements BenchBroadcastService { + + private final String logPrefix = "[BenchBroadcastService]"; + + @Autowired + private ReportEmitterService reportEmitterService; + + @Autowired + private SceneApiService sceneApiService; + + @Autowired + private SceneService sceneService; + + @Autowired + private ReportInfoService reportInfoService; + + @Autowired + private SceneApiInfoMapper sceneApiInfoMapper; + + @Autowired + private CheckPointInfoMapper checkPointInfoMapper; + + @Autowired + private ReportInfoMapper reportInfoMapper; + + private static final Gson gson = Util.getGson(); + + @Override + public Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, SlaEvent slaEvent) { + notifySlaEventSync(emitEventType, reportId, slaEvent); + return Result.success(true); + } + + @Override + public Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, TotalStatAnalysisEvent analysisEvent) { + notifyTotalAnalysisEvent(emitEventType, reportId, analysisEvent); + return Result.success(true); + } + + public Result notifyEvent(EmitterTypeEnum emitEventType, String reportId, ReportInfoBo reportInfoBo) { + notifyFinishSync(emitEventType, reportId, reportInfoBo); + return Result.success(true); + } + + private void notifyFinishSync(EmitterTypeEnum emitEventType, String reportId, ReportInfoBo reportInfoBo){ + checkArgument(StringUtils.isNotBlank(reportId), this.logPrefix + "notifyEvent empty report id"); + String logMsg = this.logPrefix + "notifyEvent report id " + reportId + ", emit type " + emitEventType + "; "; + + if (EmitterTypeEnum.FINISH.getValue().equals(emitEventType.getValue())) { + reportInfoBo.setStatus(REPORT_STATUS_INACTIVE); + this.reportInfoService.updateReport(reportInfoBo); + try { + int sessionCnt = this.reportEmitterService.countSessions(reportId); + if (0 == sessionCnt) { + log.warn(logMsg + "session is zero"); + return; + } + log.info(logMsg + "session cnt is {}", sessionCnt); + this.reportEmitterService.complete(reportId); + } catch (Exception e) { + log.warn("complete failed,e:{}",e.getMessage()); + } + } else { + log.error(logMsg + "invalid event type"); + } + } + private void notifySlaEventSync(EmitterTypeEnum emitEventType, String reportId, SlaEvent slaEvent) { + checkArgument(StringUtils.isNotBlank(reportId), this.logPrefix + "notifyEvent empty report id"); + String logMsg = this.logPrefix + "notifyEvent report id " + reportId + ", emit type " + emitEventType + "; "; + int sessionCnt = this.reportEmitterService.countSessions(reportId); + + if (0 == sessionCnt) { + log.warn(logMsg + "session is zero"); + return; + } + log.info(logMsg + "session cnt is {}", sessionCnt); + + //sla 事件消息 + try { + this.reportEmitterService.sendSlaMsg(reportId, slaEvent); + } catch (Exception e) { + log.warn("reportEmitterService.sendSlaMsg error"); + } finally { + //补充接口信息 + processSlaEventApiInfo(slaEvent); + //更新,追加报告中的事件列表 + updateSlaEventByReport(reportId, slaEvent); + } + + } + + private void notifyTotalAnalysisEvent(EmitterTypeEnum emitEventType, String reportId, TotalStatAnalysisEvent analysisEvent) { + checkArgument(StringUtils.isNotBlank(reportId), this.logPrefix + "notifyEvent empty report id"); + String logMsg = this.logPrefix + "notifyEvent report id " + reportId + ", emit type " + emitEventType + "; "; + int sessionCnt = this.reportEmitterService.countSessions(reportId); + + if (0 == sessionCnt) { + //已经结束,直接更新报告数据 + //更新错误分析事件列表 + //补充事件信息 + if (analysisEvent.isFinish()){ + log.info("total!! "+analysisEvent.getTotalReq()+"_____err:"+analysisEvent.getTotalErrReq()); + processTotalStatisticEvent(analysisEvent); + updateTotalStatEventByReport(reportId, analysisEvent,true); + + ReportInfoExample example = new ReportInfoExample(); + example.createCriteria().andReportIdEqualTo(reportId); + List reportInfoList = reportInfoMapper.selectByExample(example); + if (reportInfoList != null && reportInfoList.size() !=0){ + ReportInfo reportInfo = reportInfoList.get(0); + reportInfo.setStatus(REPORT_STATUS_INACTIVE); + long now = System.currentTimeMillis(); + if (reportInfo.getFinishTime() == null){ + reportInfo.setFinishTime(now +300000); + } + if (reportInfo.getDuration() == null){ + int duration = (int) ((now -reportInfo.getCreateTime().getTime())/1000); + reportInfo.setDuration(duration); + } + reportInfoMapper.updateByPrimaryKey(reportInfo); + } + } + log.warn(logMsg + "session is zero"); + return; + } + log.debug(logMsg + "session cnt is {}", sessionCnt); + + try { + //补充事件信息 + processTotalStatisticEvent(analysisEvent); + // 推送统计事件 + this.reportEmitterService.sendTotalStatisticMsg(reportId, analysisEvent); + } catch (Exception e) { + log.warn("reportEmitterService.sendErrStatisticMsg error"); + } finally { + //更新数据分析事件列表 + updateTotalStatEventByReport(reportId, analysisEvent,false); + } + } + + private void processSlaEventApiInfo(SlaEvent slaEvent){ + try { + if (slaEvent.getRuleItemType().equals(SlaRuleItemTypeEnum.BusinessMetrics.ruleItemTypeName)){ + //业务指标报警 + if (slaEvent.getTriggerApiId() != 0){ + SceneApiInfo apiInfo = sceneApiInfoMapper.selectByPrimaryKey(slaEvent.getTriggerApiId()); + slaEvent.setApiName(apiInfo.getApiName()); + if (apiInfo.getApiType() == Constants.CASE_TYPE_HTTP){ + slaEvent.setApiUrlOrServiceName(apiInfo.getApiUrl()); + }else if (apiInfo.getApiType() == Constants.CASE_TYPE_RPCX){ + slaEvent.setApiUrlOrServiceName(apiInfo.getServiceName()+":"+apiInfo.getMethodName()); + } + } + } + } catch (Exception e) { + log.warn("get api info err:{}",e.getMessage()); + } + } + + private void processTotalStatisticEvent(TotalStatAnalysisEvent totalAnalysisEvent) { + totalAnalysisEvent.getErrorTypeAnalyses().forEach(errorTypeAnalysis -> { + //各个错误总计类 + Integer apiId = errorTypeAnalysis.getMostErrApi(); + if (apiId != null) { + //次数最多的api + SceneApiInfo sceneApiInfo = sceneApiInfoMapper.selectByPrimaryKey(apiId); + errorTypeAnalysis.setMostErrApiName(sceneApiInfo.getApiName()); + + if (errorTypeAnalysis.getErrorType() == 1) { + //检查点错误 + int checkPointId = errorTypeAnalysis.getCheckPointId(); + CheckPointInfo checkPointInfo = checkPointInfoMapper.selectByPrimaryKey(checkPointId); + errorTypeAnalysis.setCheckPointDesc(gson.toJson(checkPointInfo)); + } + } + }); + + //接口信息补充 + totalAnalysisEvent.getApiStatisticsList().forEach(apiStatistics -> { + SceneApiInfo apiInfo = sceneApiInfoMapper.selectByPrimaryKey(apiStatistics.getApiId()); + if (apiInfo != null){ + apiStatistics.setApiName(apiInfo.getApiName()); + apiStatistics.setApiType(apiInfo.getApiType()); + if (apiInfo.getApiType() == Constants.CASE_TYPE_HTTP){ + apiStatistics.setUri(apiInfo.getApiUrl()); + if (apiInfo.getRequestMethod() == Constants.HTTP_REQ_GET){ + apiStatistics.setMethod("get"); + }else { + apiStatistics.setMethod("post"); + } + }else if (apiInfo.getApiType() == Constants.CASE_TYPE_RPCX){ + apiStatistics.setDubboServiceName(apiInfo.getServiceName()); + apiStatistics.setDubboMethodName(apiInfo.getMethodName()); + apiStatistics.setDubboGroup(apiInfo.getDubboGroup()); + apiStatistics.setDubboVersion(apiInfo.getDubboVersion()); + } + apiStatistics.setSerialId(apiInfo.getSerialLinkId()); + } + }); + } + + private void updateTotalStatEventByReport(String reportId, TotalStatAnalysisEvent analysisEvent,boolean lastTime) { + //更新报告中的数据分析事件 + ReportInfoExample example = new ReportInfoExample(); + example.createCriteria().andReportIdEqualTo(reportId); + + List reportInfos = reportInfoMapper.selectByExampleWithBLOBs(example); + if (reportInfos == null || reportInfos.size() != 1) { + return; + } + ReportInfo reportInfo = reportInfos.get(0); + reportInfo.setConcurrency(analysisEvent.getAvgTps()); + reportInfo.setConcurrencyMax(analysisEvent.getMaxTps()); + reportInfo.setTotalStatAnalysisEventList(gson.toJson(analysisEvent)); + if (lastTime){ + reportInfo.setFinishTime(System.currentTimeMillis()); + } + //更新链路 rps 数据 + if (analysisEvent.getLinkToDagTaskRpsMap() != null && !analysisEvent.getLinkToDagTaskRpsMap().isEmpty()){ + reportInfo.setLinkToDagId(gson.toJson(analysisEvent.getLinkToDagTaskRpsMap())); + } + reportInfoMapper.updateByPrimaryKeyWithBLOBs(reportInfo); + } + + private void updateSlaEventByReport(String reportId, BenchEvent benchEvent) { + //更新报告中的事件列表 + ReportInfoExample example = new ReportInfoExample(); + example.createCriteria().andReportIdEqualTo(reportId); + + List reportInfos = reportInfoMapper.selectByExampleWithBLOBs(example); + if (reportInfos == null || reportInfos.size() != 1) { + return; + } + ReportInfo reportInfo = reportInfos.get(0); + List benchEvents = gson.fromJson(reportInfo.getSlaEventList(), new TypeToken>() { + }.getType()); + if (benchEvents != null) { + benchEvents.add(benchEvent); + } else { + benchEvents = new ArrayList<>(); + benchEvents.add(benchEvent); + } + reportInfo.setSlaEventList(gson.toJson(benchEvents)); + reportInfoMapper.updateByPrimaryKeyWithBLOBs(reportInfo); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchMonitorServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchMonitorServiceImpl.java new file mode 100644 index 000000000..15ebf225b --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/BenchMonitorServiceImpl.java @@ -0,0 +1,184 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.google.gson.reflect.TypeToken; +import com.xiami.mione.tesla.k8s.service.K8sProxyService; +import com.xiaomi.faas.func.api.MimeterService; +import com.xiaomi.mione.tesla.k8s.bo.PodNode; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.scene.SceneTaskAppsBo; +import run.mone.mimeter.dashboard.bo.agent.AgentMonitorBo; +import run.mone.mimeter.dashboard.bo.agent.AgentMonitorInfo; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.common.HttpDao; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.ReportInfoMapper; +import run.mone.mimeter.dashboard.mapper.SceneApiInfoMapper; +import run.mone.mimeter.dashboard.mapper.SceneInfoMapper; +import run.mone.mimeter.dashboard.mapper.SerialLinkMapper; +import run.mone.mimeter.dashboard.service.BenchMonitorService; +import run.mone.mimeter.dashboard.pojo.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +@Slf4j +public class BenchMonitorServiceImpl implements BenchMonitorService { + + @Autowired + private HttpDao httpDao; + + + /** + * 前后拓宽时间 + */ + private static final Long expendTime = (long) (5 * 1000); + + @Autowired + private ReportInfoMapper reportInfoMapper; + + @Autowired + private SerialLinkMapper serialLinkMapper; + + @Autowired + private SceneApiInfoMapper apiInfoMapper; + + private static final Gson gson = Util.getGson(); + + @DubboReference(registry = "stRegistry",check = false,group = "staging",timeout = 3000) + private MimeterService mimeterServiceSt; + + @DubboReference(registry = "olRegistry",check = false,group = "online",timeout = 3000) + private MimeterService mimeterServiceStOl; + + @DubboReference(check = false,group = "${ref.k8s.service.group}",timeout = 3000) + private K8sProxyService k8sProxyService; + + @Autowired + private SceneInfoMapper sceneInfoMapper; + + @Override + public Result getAppListByReportID(Integer sceneId, String reportId, Boolean realTime) { + + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(sceneId); + if (sceneInfo == null){ + return Result.success(new SceneTaskAppsBo()); + } + + String flag = sceneId + "_" + reportId; + com.xiaomi.youpin.infra.rpc.Result res; + try { + if (sceneInfo.getSceneEnv() == Constants.SCENE_ENV_ST){ + res = mimeterServiceSt.getApps(flag); + }else if (sceneInfo.getSceneEnv() == Constants.SCENE_ENV_OL){ + res = mimeterServiceStOl.getApps(flag); + }else { + return Result.success(new SceneTaskAppsBo()); + } + } catch (Exception e) { + return Result.fail(CommonError.UnknownError); + } + if (res.getCode() == 0) { + if (res.getData() == null){ + return Result.success(new SceneTaskAppsBo()); + } + SceneTaskAppsBo sceneTaskAppsBo = null; + try { + sceneTaskAppsBo = gson.fromJson(res.getData().toString(), new TypeToken() { + }.getType()); + } catch (JsonSyntaxException e) { + log.error("getAppListByReportID failed,e:{}",e.getMessage()); + return Result.success(new SceneTaskAppsBo()); + } + ReportInfoExample example = new ReportInfoExample(); + example.createCriteria().andReportIdEqualTo(reportId); + List reportInfoList = reportInfoMapper.selectByExample(example); + + if (reportInfoList == null || reportInfoList.size() == 0) { + return Result.fail(CommonError.InvalidParamError); + } + ReportInfo reportInfo = reportInfoList.get(0); + + sceneTaskAppsBo.setFromTime(reportInfo.getCreateTime().getTime() - expendTime); + if (realTime) { + //实时 + sceneTaskAppsBo.setToTime(null); + } else { + if (reportInfo.getFinishTime() != null){ + sceneTaskAppsBo.setToTime(reportInfo.getFinishTime() + expendTime); + } + } + sceneTaskAppsBo.getSerialLinks().forEach(linkTaskAppsBo -> { + SerialLink serialLink = serialLinkMapper.selectByPrimaryKey(Integer.parseInt(linkTaskAppsBo.getSerialLinkId())); + linkTaskAppsBo.setSerialLinkName(serialLink.getName()); + linkTaskAppsBo.getApis().forEach(apiTaskAppsBo -> { + SceneApiInfo apiInfo = apiInfoMapper.selectByPrimaryKey(Integer.parseInt(apiTaskAppsBo.getApiId())); + apiTaskAppsBo.setApiName(apiInfo.getApiName()); + }); + }); + sceneTaskAppsBo.setSceneTask(flag); + return Result.success(sceneTaskAppsBo); + } + return Result.fail(CommonError.UnknownError); + } + + @Override + public Result getAgentInfosByReport(String reportId, Boolean realTime) { + AgentMonitorBo agentMonitorBo = new AgentMonitorBo(); + + List agentInfos = new ArrayList<>(); + ReportInfoExample example = new ReportInfoExample(); + example.createCriteria().andReportIdEqualTo(reportId); + List reportInfoList = reportInfoMapper.selectByExampleWithBLOBs(example); + + if (reportInfoList == null || reportInfoList.size() == 0) { + return Result.fail(CommonError.InvalidParamError); + } + ReportInfo reportInfo = reportInfoList.get(0); + + String agentJson = reportInfo.getAgents(); + List agentAddrs = gson.fromJson(agentJson, new TypeToken>() { + }.getType()); + + log.info("!!! agent info 1:{}",agentJson); + if (agentAddrs == null){ + return Result.success(agentMonitorBo); + } + + agentMonitorBo.setFromTime(reportInfo.getCreateTime().getTime()); + if (realTime) { + agentMonitorBo.setToTime(null); + } else { + if (reportInfo.getFinishTime() != null){ + agentMonitorBo.setToTime(reportInfo.getFinishTime() + expendTime); + }else { + agentMonitorBo.setToTime(System.currentTimeMillis()); + } + } + + List podIps = agentAddrs.stream().map(addr -> addr.substring(0,addr.indexOf(":"))).collect(Collectors.toList()); + + log.info("!!! agent info 1:{}",gson.toJson(podIps)); + + List agents = k8sProxyService.getNodeIP(podIps).getData(); + + if (agents.size() != 0){ + agents.forEach(agent ->{ + AgentMonitorInfo agentMonitorInfo = new AgentMonitorInfo(); + agentMonitorInfo.setNodeIp(agent.getNodeIP()); + agentMonitorInfo.setPodIp(agent.getPodIP()); + agentInfos.add(agentMonitorInfo); + }); + } + agentMonitorBo.setAgentMonitorInfos(agentInfos); + return Result.success(agentMonitorBo); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DatasetServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DatasetServiceImpl.java new file mode 100644 index 000000000..e2d56e93f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DatasetServiceImpl.java @@ -0,0 +1,554 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.mone.tpc.api.service.UserOrgFacade; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.*; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.DatasetMapper; +import run.mone.mimeter.dashboard.mapper.DatasetSceneRelationMapper; +import run.mone.mimeter.dashboard.pojo.*; +import run.mone.mimeter.dashboard.service.DatasetService; +import run.mone.mimeter.dashboard.service.SceneService; + +import java.util.*; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.DEFAULT_PAGE_SIZE; +import static run.mone.mimeter.dashboard.service.impl.UploadService.PreviewFileRowNum; + +@Service +@Slf4j +public class DatasetServiceImpl implements DatasetService { + + private static final Gson gson = new Gson(); + + @Autowired + DatasetMapper datasetMapper; + + @Autowired + DatasetSceneRelationMapper datasetSceneRelationMapper; + + @Autowired + private UploadService uploadService; + + @Autowired + private SceneService sceneService; + + @DubboReference(registry = "stRegistry",check = false,group = "staging-open",version = "1.0") + private UserOrgFacade userOrgFacade; + + @Override + public Result newDataset(DatasetDto param) { + Pair checkRes = checkParam(param); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + + Dataset dataset = toDataset(param); + //添加租户信息 + if (param.getTenant() != null) { + dataset.setTenant(param.getTenant()); + } + datasetMapper.insert(dataset); + return Result.success(dataset.getId()); + } + + @Override + public Result> multiNewDataset(List param) { + for (DatasetDto perParam : param) { + Pair checkRes = checkParam(perParam); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + } + List datasets = param.stream().map(it -> { + Dataset dataset = toDataset(it); + //添加租户信息 + if (it.getTenant() != null) { + dataset.setTenant(it.getTenant()); + } + return dataset; + }).collect(Collectors.toList()); + datasetMapper.batchInsert(datasets); + return Result.success(datasets.stream().map(Dataset::getId).collect(Collectors.toList())); + } + + @Override + public Result updateDataset(DatasetDto param) { + Pair checkRes = checkParam(param); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + + Dataset dataset = toDataset(param); + //兼容,早期的数据源没有租户信息,这里在更新的时候补充进去 +// if (param.getTenant() != null && dataset.getTenant() == null) { +// dataset.setTenant(param.getTenant()); +// } + datasetMapper.updateByPrimaryKeyWithBLOBs(dataset); + return Result.success(true); + } + + @Override + public Result multiUpdateDataset(List param) { + for (DatasetDto perParam : param) { + Pair checkRes = checkParam(perParam); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + } + + param.forEach(it -> { + Dataset dataset = toDataset(it); + //兼容,早期的数据源没有租户信息,这里在更新的时候补充进去 + if (it.getTenant() != null && dataset.getTenant() == null) { + dataset.setTenant(it.getTenant()); + } + datasetMapper.updateByPrimaryKeyWithBLOBs(dataset); + }); + return Result.success(true); + } + + @Override + public Result getDatasetList(GetDatasetListReq req) { + + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + DatasetExample totalDatasetExample = new DatasetExample(); + DatasetExample.Criteria totalCriteria = totalDatasetExample.createCriteria(); + DatasetExample datasetExample = new DatasetExample(); + + DatasetExample.Criteria criteria = datasetExample.createCriteria(); + + if (StringUtils.isNotEmpty(req.getDatasetName())) { + totalCriteria.andNameLike("%" + req.getDatasetName() + "%"); + criteria.andNameLike("%" + req.getDatasetName() + "%"); + } + if (StringUtils.isNotEmpty(req.getCreator())) { + totalCriteria.andCreatorLike("%" + req.getCreator() + "%"); + criteria.andCreatorLike("%" + req.getCreator() + "%"); + } + if (req.getType() != null && req.getType() > 0) { + totalCriteria.andTypeEqualTo(req.getType()); + criteria.andTypeEqualTo(req.getType()); + } + + datasetExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + DatasetList datasetList = new DatasetList(); + datasetList.setPage(req.getPage()); + datasetList.setPageSize(req.getPageSize()); + List datasets = datasetMapper.selectByExampleWithBLOBs(datasetExample); + if (datasets == null || datasets.size() == 0) { + return Result.success(datasetList); + } + List datasetDtos = datasets.stream().map(this::toDatasetDto).collect(Collectors.toList()); + + //添加引用场景字段 + List datasetIds = datasetDtos.stream().map(DatasetDto::getId).collect(Collectors.toList()); + Map> datasetIdToSceneIds = getSceneIdsByDatasetIds(datasetIds); + Set sceneIdSet = new HashSet<>(); + datasetIdToSceneIds.forEach((key, value) -> sceneIdSet.addAll(value)); + if (sceneIdSet.size() > 0) { + List scenes = sceneService.getSceneInfoByIds(new ArrayList<>(sceneIdSet)).getData(); + Map sceneIdName = scenes.stream().collect(Collectors.toMap(SceneInfo::getId, SceneInfo::getName)); + datasetDtos.forEach(it -> { + Integer datasetId = it.getId(); + List sceneIds = datasetIdToSceneIds.get(datasetId); + if (sceneIds != null && sceneIds.size() > 0) { + Map perSceneIdName = sceneIds.stream().filter(it1 -> sceneIdName.get(it1) != null) + .collect(Collectors.toMap(it1 -> it1, sceneIdName::get)); + + it.setBindScenes(perSceneIdName); + } + }); + } + + datasetList.setList(datasetDtos); + datasetList.setTotal(datasetMapper.countByExample(totalDatasetExample)); + + return Result.success(datasetList); + } + + @Override + public Result> getDatasetListByIds(List datasetIds) { + List datasetList = new ArrayList<>(); + if (datasetIds != null && datasetIds.size() != 0) { + DatasetExample example = new DatasetExample(); + example.createCriteria().andIdIn(datasetIds); + datasetList = datasetMapper.selectByExampleWithBLOBs(example); + } + return Result.success(datasetList); + } + + @Override + public Result getDatasetById(int id) { + Dataset dataset = datasetMapper.selectByPrimaryKey(id); + DatasetDto datasetDto = toDatasetDto(dataset); + return Result.success(datasetDto); + } + + @Override + public Result delDataset(int id) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andDatasetIdEqualTo(id); + List relations = datasetSceneRelationMapper.selectByExample(relationExample); + if (relations != null && relations.size() > 0) { + //多校验一步,看一下关联的场景到底还存不存在 + List scenes = sceneService.getSceneInfoByIds(relations.stream().map(DatasetSceneRelation::getSceneId).collect(Collectors.toList())).getData(); + if (scenes != null && scenes.size() > 0) { + return Result.fail(CommonError.DeleteFileBindingSceneError); + } + } + + datasetMapper.deleteByPrimaryKey(id); + datasetSceneRelationMapper.deleteByExample(relationExample); + + return Result.success(true); + } + + @Override + public Result multiDelDataset(List ids) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andDatasetIdIn(ids); + List relations = datasetSceneRelationMapper.selectByExample(relationExample); + if (relations != null && relations.size() > 0) { + //多校验一步,看一下关联的场景到底还存不存在 + List scenes = sceneService.getSceneInfoByIds(relations.stream().map(DatasetSceneRelation::getSceneId).collect(Collectors.toList())).getData(); + if (scenes != null && scenes.size() > 0) { + return Result.fail(CommonError.DeleteFileBindingSceneError); + } + } + + DatasetExample example = new DatasetExample(); + example.createCriteria().andIdIn(ids); + datasetMapper.deleteByExample(example); + datasetSceneRelationMapper.deleteByExample(relationExample); + + return Result.success(true); + } + + @Override + public Result bindScene(int datasetId, int sceneId) { + long now = System.currentTimeMillis(); + DatasetSceneRelation datasetSceneRelation = new DatasetSceneRelation(); + datasetSceneRelation.setDatasetId(datasetId); + datasetSceneRelation.setSceneId(sceneId); + datasetSceneRelation.setCtime(now); + datasetSceneRelation.setUtime(now); + datasetSceneRelation.setEnable(false); + datasetSceneRelationMapper.insert(datasetSceneRelation); + return Result.success(datasetSceneRelation.getId()); + } + + @Override + public Result bindDataSetsByScene(List datasetIds, Set refDatasetIds, int sceneId) { + List toBeAdded = new ArrayList<>(); + List toBeRemoved = new ArrayList<>(); + List toBeUpdated = new ArrayList<>(); + + DatasetSceneRelationExample example = new DatasetSceneRelationExample(); + example.createCriteria().andSceneIdEqualTo(sceneId); + List relations = datasetSceneRelationMapper.selectByExample(example); + List olds = relations.stream().map(DatasetSceneRelation::getDatasetId).collect(Collectors.toList()); + + + datasetIds.forEach(newId -> { + if (!olds.contains(newId)) { + toBeAdded.add(newId); + } + }); + olds.forEach(oldId -> { + if (!datasetIds.contains(oldId)) { + toBeRemoved.add(oldId); + } else { + toBeUpdated.add(oldId); + } + }); + + if (toBeUpdated.size() != 0) { + toBeUpdated.forEach(uId -> { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + relationExample.createCriteria().andSceneIdEqualTo(sceneId).andDatasetIdEqualTo(uId); + List relationList = datasetSceneRelationMapper.selectByExample(relationExample); + if (relationList != null && relationList.size() != 0) { + DatasetSceneRelation relation = relationList.get(0); + if (refDatasetIds != null) { + relation.setEnable(refDatasetIds.contains(uId)); + } else { + relation.setEnable(false); + } + datasetSceneRelationMapper.updateByPrimaryKey(relation); + } + }); + } + + if (toBeRemoved.size() != 0) { + DatasetSceneRelationExample rmExp = new DatasetSceneRelationExample(); + rmExp.createCriteria().andDatasetIdIn(toBeRemoved).andSceneIdEqualTo(sceneId); + datasetSceneRelationMapper.deleteByExample(rmExp); + } + + long now = System.currentTimeMillis(); + if (toBeAdded.size() != 0) { + List relationList = toBeAdded.stream().map(it -> { + DatasetSceneRelation datasetSceneRelation = new DatasetSceneRelation(); + datasetSceneRelation.setDatasetId(it); + datasetSceneRelation.setSceneId(sceneId); + datasetSceneRelation.setCtime(now); + datasetSceneRelation.setUtime(now); + if (refDatasetIds != null) { + datasetSceneRelation.setEnable(refDatasetIds.contains(it)); + } else { + datasetSceneRelation.setEnable(false); + } + return datasetSceneRelation; + }).collect(Collectors.toList()); + datasetSceneRelationMapper.batchInsert(relationList); + } + + + return Result.success(true); + } + + @Override + public Result unbindScene(int datasetId, int sceneId) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andDatasetIdEqualTo(datasetId).andSceneIdEqualTo(sceneId); + List relationList = datasetSceneRelationMapper.selectByExample(relationExample); + if (relationList != null && relationList.size() != 0) { + if (relationList.get(0).getEnable()) { + return Result.fail(CommonError.UnbindRefDataset); + } + int res = datasetSceneRelationMapper.deleteByPrimaryKey(relationList.get(0).getId()); + return Result.success(res); + } + return Result.fail(CommonError.InvalidParamError); + } + + @Override + public Result filePreview(int id) { + Dataset dataset = datasetMapper.selectByPrimaryKey(id); + List lines = uploadService.loadFileByRange(dataset, 0, PreviewFileRowNum).getData(); + + PreviewFileRes previewFileRes = new PreviewFileRes(); + previewFileRes.setPreviewFileRows(lines); + previewFileRes.setFileRows(dataset.getFileRows()); + previewFileRes.setFileName(dataset.getFileName()); + + return Result.success(previewFileRes); + } + + @Override + public Result> getParamDataByIds(List ids) { + List paramDatas = new ArrayList<>(); + if (ids == null || ids.size() == 0) { + return Result.success(paramDatas); + } + + DatasetExample datasetExample = new DatasetExample(); + DatasetExample.Criteria criteria = datasetExample.createCriteria(); + criteria.andIdIn(ids); + List list = datasetMapper.selectByExampleWithBLOBs(datasetExample); + + if (list == null || list.size() == 0) { + return Result.success(paramDatas); + } + + list.stream().filter(it -> StringUtils.isNotEmpty(it.getDefaultParamName())).forEach(it -> { + List params = Arrays.asList(it.getDefaultParamName().split(",")); + for (int i = 0; i < params.size(); i++) { + + ParamData paramData = new ParamData(); + paramData.setColumnIndex(i + 1); + paramData.setDatasetId(it.getId()); + paramData.setDatasetName(it.getName()); + paramData.setParamName(params.get(i)); + paramDatas.add(paramData); + } + }); + + return Result.success(paramDatas); + } + + @Override + public Result> getParamDataBySceneId(Integer sceneId) { + List datasetsIds = getDatasetIdsBySceneId(sceneId); + return getParamDataByIds(datasetsIds); + } + + @Override + public List getDatasetIdsBySceneId(Integer sceneId) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andSceneIdEqualTo(sceneId); + List relations = datasetSceneRelationMapper.selectByExample(relationExample); + + return relations.stream().map(DatasetSceneRelation::getDatasetId).collect(Collectors.toList()); + } + + @Override + public Result sceneFileDetail(Integer sceneId) { + SceneFileDetailRes sceneFileDetailRes = new SceneFileDetailRes(); + + List datasetIds = getDatasetIdsBySceneId(sceneId); + if (datasetIds == null || datasetIds.size() == 0) { + return Result.success(sceneFileDetailRes); + } + + List datasets = getDatasetListByIds(datasetIds).getData(); + List datasetDtos = datasets.stream().map(this::toDatasetDto).collect(Collectors.toList()); + List paramDatas = getParamDataByIds(datasetIds).getData(); + + sceneFileDetailRes.setDatasetLists(datasetDtos); + sceneFileDetailRes.setParamDataList(paramDatas); + + return Result.success(sceneFileDetailRes); + } + + @Override + public TreeMap> getParamDataMap(List reqList) { + TreeMap> dataRes = new TreeMap<>(); + List datasetIds = reqList.stream().map(DatasetLinesReq::getDatasetId).collect(Collectors.toList()); + List datasets = getDatasetListByIds(datasetIds).getData(); + Map datasetMap = datasets.stream().collect(Collectors.toMap(Dataset::getId, it -> it)); + reqList.forEach(req -> { + List paramNames = Arrays.asList(req.getDefaultParamName().split(",")); + Dataset dataset = datasetMap.get(req.getDatasetId()); + List lines = null; + try { + lines = uploadService.loadStringArrByRange(dataset, req.getFrom(), req.getTo()).getData(); + } catch (Exception e) { + log.error("loadStringArrByRange error,datasetId:{},fileUrl:{},ksKey:{},paramNames:{},from:{},to:{},error:{}",req.getDatasetId(),req.getFileUrl(),req.getFileKsKey(),req.getDefaultParamName(),req.getFrom(),req.getTo(),e.getMessage()); + } + paramNames.forEach(paramName -> dataRes.put(paramName, new ArrayList<>())); + lines.forEach(line -> { + for (int i = 0; i < paramNames.size(); i++) { + dataRes.get(paramNames.get(i)).add(line[i]); + } + }); + }); + log.info("get getParamDataMap dataRes size:{}",dataRes.size()); + return dataRes; + } + + private Pair checkParam(DatasetDto datasetDto) { + List datasetTypes = DatasetTypeEnum.getDatasetTypes(); + if (datasetDto.getType() == null) { + return Pair.of(-1, "数据源类型必填"); + } + if (datasetDto.getIgnoreFirstRow() == null) { + datasetDto.setIgnoreFirstRow(0); + } + + int type = datasetDto.getType(); + if (!datasetTypes.contains(type)) { + return Pair.of(-1, "不存在的数据源类型"); + } + if (datasetDto.getType() == DatasetTypeEnum.FileUpload.typeCode) { + if (StringUtils.isEmpty(datasetDto.getDefaultParamName())) { + return Pair.of(-1, "文件类型数据源参数名必填"); + } + if (StringUtils.isEmpty(datasetDto.getDefaultParamName())) { + return Pair.of(-1, "文件参数名不允许为空"); + } else { + String[] paramNameArr = datasetDto.getDefaultParamName().split(","); + if (Arrays.asList(paramNameArr).stream().anyMatch(it -> StringUtils.isEmpty(it))) { + return Pair.of(-1, "文件参数名不允许为空"); + } + } + } + + return Pair.of(0, "success"); + } + + private List getSceneIdsByDatasetId(Integer datasetId) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andDatasetIdEqualTo(datasetId); + List relations = datasetSceneRelationMapper.selectByExample(relationExample); + + return relations.stream().map(DatasetSceneRelation::getSceneId).collect(Collectors.toList()); + } + + private Map> getSceneIdsByDatasetIds(List ids) { + DatasetSceneRelationExample relationExample = new DatasetSceneRelationExample(); + DatasetSceneRelationExample.Criteria criteria = relationExample.createCriteria(); + criteria.andDatasetIdIn(ids); + List relations = datasetSceneRelationMapper.selectByExample(relationExample); + + Map> map = new HashMap<>(); + ids.stream().forEach(it -> map.put(it, new ArrayList<>())); + relations.stream().forEach(it -> { + map.get(it.getDatasetId()).add(it.getSceneId()); + }); + + return map; + } + + private Dataset toDataset(DatasetDto param) { + Dataset dataset = new Dataset(); + BeanUtils.copyProperties(param, dataset); + if (param.getPreviewFileRows() != null && param.getPreviewFileRows().size() != 0) { + dataset.setPreviewFileRows(gson.toJson(param.getPreviewFileRows())); + } + if (param.getHeader() != null && param.getHeader().size() != 0) { + dataset.setHeader(gson.toJson(param.getHeader())); + } + long now = System.currentTimeMillis(); + if (dataset.getCtime() == null || dataset.getCtime() == 0) { + dataset.setCtime(now); + } + dataset.setUtime(now); + + return dataset; + } + + private DatasetDto toDatasetDto(Dataset dataset) { + DatasetDto datasetDto = new DatasetDto(); + BeanUtils.copyProperties(dataset, datasetDto); + if (StringUtils.isNotEmpty(dataset.getPreviewFileRows())) { + datasetDto.setPreviewFileRows(gson.fromJson(dataset.getPreviewFileRows(), new TypeToken>() { + }.getType())); + } + if (StringUtils.isNotEmpty(dataset.getHeader())) { + datasetDto.setHeader(gson.fromJson(dataset.getHeader(), new TypeToken>() { + }.getType())); + } + return datasetDto; + } + + @Override + public boolean syncTenant() { +// DatasetExample datasetExample = new DatasetExample(); +// datasetExample.createCriteria().andIdIsNotNull(); +// List datasetList = datasetMapper.selectByExample(datasetExample); +// datasetList.forEach(dataset -> { +// NullParam param = new NullParam(); +// param.setAccount(dataset.getUpdater()); +// param.setUserType(0); +// OrgInfoVo orgInfoVo = userOrgFacade.getOrgByAccount(param).getData(); +// dataset.setTenant(orgInfoVo.getIdPath()); +// datasetMapper.updateByPrimaryKey(dataset); +// }); + return true; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DubboHealthServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DubboHealthServiceImpl.java new file mode 100644 index 000000000..1fcf6e51e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/DubboHealthServiceImpl.java @@ -0,0 +1,25 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.xiaomi.mone.dubbo.docs.annotations.ApiDoc; +import com.xiaomi.mone.dubbo.docs.annotations.ApiModule; +import org.apache.dubbo.config.annotation.DubboService; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.common.TestReq; +import run.mone.mimeter.dashboard.service.DubboHealthService; + +@DubboService(group = "${dubbo.group}",version = "${dubbo.version}") +@ApiModule(value = "mimeter的健康检测服务", apiInterface = DubboHealthService.class) +public class DubboHealthServiceImpl implements DubboHealthService { + @Override + @ApiDoc(value = "health方法") + public String health(TestReq testReq) { + return testReq.getUid(); + } + + @Override + public Result getUid() { + TestReq req = new TestReq(); + req.setUid("dzx"); + return Result.success(req); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/EsLogServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/EsLogServiceImpl.java new file mode 100644 index 000000000..f3ed2cc5c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/EsLogServiceImpl.java @@ -0,0 +1,137 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.xiaomi.mone.es.EsClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.index.query.BoolQueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.query.RangeQueryBuilder; +import org.elasticsearch.index.query.TermQueryBuilder; +import org.elasticsearch.search.SearchHits; +import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.PagedResp; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ReqRespLogRecord; +import run.mone.mimeter.dashboard.bo.report.SearchApiLogReq; +import run.mone.mimeter.dashboard.service.EsLogService; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.elasticsearch.search.sort.SortOrder.ASC; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/7/6 + */ +@Slf4j +@Service +public class EsLogServiceImpl implements EsLogService { + + @Autowired + private EsClient esClient; + + @Value("${es.index.apilog}") + private String esIndexApilog; + + @Override + public Result>> searchApiLogs(SearchApiLogReq req) { + try { + SearchRequest searchRequest = new SearchRequest(esIndexApilog); + SearchSourceBuilder qb = new SearchSourceBuilder(); + BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); + + if (req.getStartTs() != null && req.getStartTs() > 0) { + RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("timestamp").from(req.getStartTs()); + boolQueryBuilder = boolQueryBuilder.must(rangeQueryBuilder); + } + if (req.getEndTs() != null && req.getEndTs() > 0) { + RangeQueryBuilder rangeQueryBuilder1 = QueryBuilders.rangeQuery("timestamp").to(req.getEndTs()); + boolQueryBuilder = boolQueryBuilder.must(rangeQueryBuilder1); + } + if (StringUtils.isNotEmpty(req.getApiUri())) { + TermQueryBuilder termQueryBuilder2 = QueryBuilders.termQuery("uri", StringUtils.trim(req.getApiUri())); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder2); + } + + if (req.getSceneId() != null && req.getSceneId() > 0) { + TermQueryBuilder termQueryBuilder3 = QueryBuilders.termQuery("sceneId", req.getSceneId()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder3); + } + if (req.getRtMin() != null && req.getRtMin() > 0) { + RangeQueryBuilder rangeQueryBuilder4 = QueryBuilders.rangeQuery("rt").from(req.getRtMin()); + boolQueryBuilder = boolQueryBuilder.must(rangeQueryBuilder4); + } + if (req.getRtMax() != null && req.getRtMax() > 0) { + RangeQueryBuilder rangeQueryBuilder5 = QueryBuilders.rangeQuery("rt").to(req.getRtMax()); + boolQueryBuilder = boolQueryBuilder.must(rangeQueryBuilder5); + } + if (req.getRespCode() != null && req.getRespCode() > 0) { + TermQueryBuilder termQueryBuilder6 = QueryBuilders.termQuery("code", req.getRespCode()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder6); + } + if (req.getFailed() != null) { + TermQueryBuilder termQueryBuilder7 = QueryBuilders.termQuery("failed", req.getFailed()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder7); + } + if (StringUtils.isNotBlank(req.getReportId())) { + TermQueryBuilder termQueryBuilder8 = QueryBuilders.termQuery("reportId", req.getReportId()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder8); + } + if (req.getApiId() != null && req.getApiId() > 0) { + TermQueryBuilder termQueryBuilder9 = QueryBuilders.termQuery("apiId", req.getApiId()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder9); + } + if (StringUtils.isNotEmpty(req.getApiMethod())) { + TermQueryBuilder termQueryBuilder10 = QueryBuilders.termQuery("method", StringUtils.trim(req.getApiMethod())); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder10); + } + if (req.getSerialId() != null && req.getSerialId() > 0) { + TermQueryBuilder termQueryBuilder11 = QueryBuilders.termQuery("serialId", req.getSerialId()); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder11); + } + if (StringUtils.isNotEmpty(req.getTraceId())) { + TermQueryBuilder termQueryBuilder12 = QueryBuilders.termQuery("traceId", StringUtils.trim(req.getTraceId())); + boolQueryBuilder = boolQueryBuilder.must(termQueryBuilder12); + } + + qb.query(boolQueryBuilder); + qb.from((req.getPageNo() - 1) * req.getPageSize()) + .size(req.getPageSize()) + .timeout(new TimeValue(3000)); + + qb = qb.sort("timestamp", ASC); + searchRequest.source(qb); + SearchResponse res = esClient.search(searchRequest); + SearchHits searchHits = res.getHits(); + long count = searchHits.getTotalHits().value; + + List records = new ArrayList<>(); + Gson gson = new Gson(); + Arrays.stream(searchHits.getHits()).forEach(it -> { + String jsonSource = it.getSourceAsString(); + ReqRespLogRecord reqRespLogRecord = gson.fromJson(jsonSource, ReqRespLogRecord.class); + records.add(reqRespLogRecord); + }); + + PagedResp> apilogRes = new PagedResp(); + apilogRes.setTotal(count); + apilogRes.setData(records); + + return Result.success(apilogRes); + + } catch (Exception e) { + log.error("ApiStatServiceImpl.searchApiLogs error, ", e); + return null; + } + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/FeiShuService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/FeiShuService.java new file mode 100644 index 000000000..5eb10d804 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/FeiShuService.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.xiaomi.youpin.feishu.FeiShu; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.List; + +@Service +@Slf4j +public class FeiShuService { + + private FeiShu feiShu; + + @NacosValue("${feishu.appId}") + private String appId = ""; + + @NacosValue("${feishu.appSecret}") + private String appSecret = ""; + + @PostConstruct + private void init() { + feiShu = new FeiShu(appId, appSecret); + } + + public void sendMsg2Person(String username, String msg) { + if (StringUtils.isEmpty(username)) { + log.error("username is null"); + return; + } + try { + log.info("FeiShuService#sendMsg personal msg: {}", msg); + feiShu.sendMsgByEmail(username + "@xiaomi.com", msg); + } catch (Exception e) { + log.error("FeiShuService#send personal msg Throwable" + e.getMessage(), e); + } + } + + public void sendCard2Person(List usernames, String card) { + if (usernames == null) { + log.error("username is null"); + return; + } + try { + log.info("FeiShuService#sendCard2Person personal msg: {}", card); + usernames.forEach(username ->{ + if (username.contains("@")){ + username = username.substring(0,username.indexOf("@")); + } + feiShu.sendCardByEmail(username + "@xiaomi.com", card); + }); + } catch (Exception e) { + log.error("FeiShuService#send personal msg Throwable" + e.getMessage(), e); + } + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/GatewayService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/GatewayService.java new file mode 100644 index 000000000..20856f815 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/GatewayService.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.service.impl; + +import com.xiaomi.youpin.gateway.manager.bo.openApi.GatewayApiInfoList; +import com.xiaomi.youpin.gateway.manager.bo.openApi.GetGatewayApiInfoListReq; +import com.xiaomi.youpin.gateway.manager.service.IGatewayOpenApi; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; + +import static com.xiaomi.youpin.tesla.traffic.recording.api.bo.enums.GatewayEnvTypeEnum.*; +import static run.mone.mimeter.dashboard.exception.CommonError.WrongGatewayEnvError; + +@Service +@Slf4j +public class GatewayService { + + @DubboReference(check = false, interfaceClass = IGatewayOpenApi.class, group = "${ref.gateway.service.group.staging}", timeout = 4000) + private IGatewayOpenApi iGatewayOpenApiStaging; + + @DubboReference(check = false, interfaceClass = IGatewayOpenApi.class, group = "${ref.gateway.service.group.online}", timeout = 4000) + private IGatewayOpenApi iGatewayOpenApiOnline; + + @DubboReference(check = false, interfaceClass = IGatewayOpenApi.class, group = "${ref.gateway.service.group.intranet}", timeout = 4000) + private IGatewayOpenApi iGatewayOpenApiIntranet; + + public Result getGatewayApiInfoList(GetGatewayApiInfoListReq req, String user, int env) { + switch (env) { + case ONLINE_CODE: { + return Result.success(iGatewayOpenApiOnline.getGatewayApiInfoList(req, user).getData()); + } + case INTRANET_CODE: { + return Result.success(iGatewayOpenApiIntranet.getGatewayApiInfoList(req, user).getData()); + } + case STAGING_CODE: { + return Result.success(iGatewayOpenApiStaging.getGatewayApiInfoList(req, user).getData()); + } + default: { + log.error("GatewayService.getGatewayApiInfoList error, env is wrong: {} ", env); + return Result.fail(WrongGatewayEnvError.code, WrongGatewayEnvError.message); + } + + } + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/LoginService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/LoginService.java new file mode 100644 index 000000000..a773238dc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/LoginService.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package run.mone.mimeter.dashboard.service.impl; + +import com.xiaomi.mone.tpc.api.service.UserOrgFacade; +import com.xiaomi.mone.tpc.common.param.NullParam; +import com.xiaomi.mone.tpc.common.vo.OrgInfoVo; +import org.apache.dubbo.config.annotation.DubboReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.UserInfo; +import run.mone.mimeter.dashboard.common.SessionAccount; + +import javax.servlet.http.HttpServletRequest; + +import static run.mone.mimeter.dashboard.bo.common.Constants.SKIP_MI_DUN_USER_NAME; + +@Service +public class LoginService { + + private static final Logger LOGGER = LoggerFactory.getLogger(LoginService.class); + + @Value("${is_local:false}") + private String isLocal; + + @Autowired + private UserV1Service userService; + + @DubboReference(registry = "stRegistry", check = false, group = "staging-open", version = "1.0") + private UserOrgFacade userOrgFacade; + + public SessionAccount getAccountFromSession(HttpServletRequest request) { + if (null == request) { + return null; + } + if (isLocal.equals("true")) { + NullParam param = new NullParam(); + param.setAccount("dongzhenxing"); + param.setUserType(0); + return new SessionAccount("dongzhenxing", "dongzhenxing", true, "default"); + } + UserInfo userInfo = userService.getUserInfo(); + String username = userInfo != null ? userInfo.getFullAccount() : request.getHeader(SKIP_MI_DUN_USER_NAME); + + NullParam param = new NullParam(); + param.setAccount(username); + param.setUserType(0); + String idPath = ""; + try { + OrgInfoVo orgInfoVo = userOrgFacade.getOrgByAccount(param).getData(); + if (orgInfoVo != null) { + idPath = orgInfoVo.getIdPath(); + } + } catch (Exception e) { + LOGGER.warn("[LoginService.getAccountFromSession], failed to getOrgByAccount, msg: {} ", e.getMessage()); + } + + return new SessionAccount(username, userInfo.getName(), userInfo.isAdmin(), idPath); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/OperationLogServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/OperationLogServiceImpl.java new file mode 100644 index 000000000..dbb20db5c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/OperationLogServiceImpl.java @@ -0,0 +1,118 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import org.apache.dubbo.common.utils.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.operationlog.GetOperationLogListReq; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogDto; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogList; +import run.mone.mimeter.dashboard.bo.operationlog.PerOperation; +import run.mone.mimeter.dashboard.mapper.OperationLogMapper; +import run.mone.mimeter.dashboard.pojo.OperationLog; +import run.mone.mimeter.dashboard.pojo.OperationLogExample; +import run.mone.mimeter.dashboard.service.OperationLogService; + +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.DEFAULT_PAGE_SIZE; + +@Service +public class OperationLogServiceImpl implements OperationLogService { + + @Autowired + OperationLogMapper operationLogMapper; + + private static Gson gson = new Gson(); + + private static ThreadPoolExecutor executor = new ThreadPoolExecutor(4, 30,TimeUnit.SECONDS.toMillis(30), TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>(30)); + + + @Override + public void newOperationLog(OperationLogDto param) { + executor.execute(() -> { + OperationLog operationLog = toOperationLog(param); + operationLogMapper.insert(operationLog);}); + } + + @Override + public Result getOperationLogList(GetOperationLogListReq req) { + + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + OperationLogExample totalOperationLogExample = new OperationLogExample(); + OperationLogExample.Criteria totalCriteria = totalOperationLogExample.createCriteria(); + OperationLogExample operationLogExample = new OperationLogExample(); + OperationLogExample.Criteria criteria = operationLogExample.createCriteria(); + + if (req.getEndTime() != 0) { + totalCriteria.andCreateTimeLessThanOrEqualTo(req.getEndTime()); + criteria.andCreateTimeLessThanOrEqualTo(req.getEndTime()); + } + if (req.getStartTime() != 0) { + totalCriteria.andCreateTimeGreaterThanOrEqualTo(req.getStartTime()); + criteria.andCreateTimeGreaterThanOrEqualTo(req.getStartTime()); + } + if (req.getSceneId() != 0) { + totalCriteria.andSceneIdEqualTo(req.getSceneId()); + criteria.andSceneIdEqualTo(req.getSceneId()); + } + + operationLogExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + OperationLogList operationLogList = new OperationLogList(); + operationLogList.setPage(req.getPage()); + operationLogList.setPageSize(req.getPageSize()); + List operationLogs = operationLogMapper.selectByExampleWithBLOBs(operationLogExample); + if (operationLogs == null || operationLogs.size() == 0) { + return Result.success(operationLogList); + } + List operationLogDtos = operationLogs.stream().map(it -> { + return toOperationLogDto(it); + }).collect(Collectors.toList()); + operationLogList.setList(operationLogDtos); + operationLogList.setTotal(operationLogMapper.countByExample(totalOperationLogExample)); + + return Result.success(operationLogList); + } + + + private OperationLog toOperationLog(OperationLogDto param) { + OperationLog operationLog = new OperationLog(); + BeanUtils.copyProperties(param, operationLog); + if (param.getSupportOperation() != null && param.getSupportOperation().size() > 0) { + operationLog.setSupportOperation(gson.toJson(param.getSupportOperation())); + } + long now = System.currentTimeMillis(); + if (operationLog.getCreateTime() == null || operationLog.getCreateTime() == 0) { + operationLog.setCreateTime(now); + } + operationLog.setUpdateTime(now); + return operationLog; + } + + private OperationLogDto toOperationLogDto(OperationLog operationLog) { + OperationLogDto operationLogDto = new OperationLogDto(); + BeanUtils.copyProperties(operationLog, operationLogDto); + if (StringUtils.isNotEmpty(operationLog.getSupportOperation())) { + operationLogDto.setSupportOperation(gson.fromJson(operationLog.getSupportOperation(), new TypeToken>() { + }.getType())); + } + return operationLogDto; + } + + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportEmitterService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportEmitterService.java new file mode 100644 index 000000000..037bd44b5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportEmitterService.java @@ -0,0 +1,115 @@ +package run.mone.mimeter.dashboard.service.impl; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import run.mone.mimeter.dashboard.bo.common.EmitterTypeEnum; +import run.mone.mimeter.dashboard.bo.statistics.TotalStatAnalysisEvent; +import run.mone.mimeter.dashboard.bo.sla.SlaEvent; + +import java.io.IOException; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; + +import static com.google.common.base.Preconditions.checkArgument; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/30 + */ +@Service +@Slf4j +public class ReportEmitterService { + + private final ConcurrentMap> reportEmitterMap = new ConcurrentHashMap<>(); + + private final String logPrefix = "[ReportEmitterService]"; + + public int countSessions(String reportId) { + if (!this.reportEmitterMap.containsKey(reportId)) { + return 0; + } + return this.reportEmitterMap.get(reportId).size(); + } + + public SseEmitter connect(String reportId, String username) { + checkArgument(StringUtils.isNotBlank(reportId) && StringUtils.isNotBlank(username), + this.logPrefix + "connect empty input"); + SseEmitter emitter = new SseEmitter(3600_000L); + ConcurrentHashMap map = Optional.ofNullable(this.reportEmitterMap.get(reportId)).orElse(new ConcurrentHashMap<>()); + map.put(username, emitter); + this.reportEmitterMap.put(reportId, map); + log.info(this.logPrefix + "connected with {}, report id:{}", username, reportId); + + return emitter; + } + + public void sendSlaMsg(String reportId, SlaEvent slaEvent) { + if (!this.reportEmitterMap.containsKey(reportId)) { + log.warn(this.logPrefix + "sendSlaMsg client connection is not established, report id:" + reportId); + return; + } + this.doSendMessage("sla_event", reportId, slaEvent); + } + + public void sendTotalStatisticMsg(String reportId, TotalStatAnalysisEvent analysisEvent) { + if (!this.reportEmitterMap.containsKey(reportId)) { + log.warn(this.logPrefix + "sendErrStatisticMsg client connection is not established, report id:" + reportId); + return; + } + try { + this.doSendMessage("total_analysis_event", reportId, analysisEvent); + } catch (Exception e) { + log.warn("send sendErrStatisticMsg error_analysis_event:{}",e.getMessage()); + } + } + + private void doSendMessage(String eventName, String reportId, Object data) { + List removeUsers = new ArrayList<>(); + + this.reportEmitterMap.get(reportId).forEach((username, emitter) -> { + try { + emitter.send(SseEmitter.event().name(eventName).data(data, MediaType.APPLICATION_JSON)); + } catch (IllegalStateException illegalStateException) { + Optional.of(emitter).ifPresent(ResponseBodyEmitter::complete); + removeUsers.add(username); + log.error(this.logPrefix + "doSendMessage id " + reportId + ", username:" + username + " is complete; " + + illegalStateException.getMessage()); + } catch (Exception e) { + log.error(this.logPrefix + "doSendMessage id:" + reportId + ", username " + username, e); + } + }); + removeUsers.forEach(username -> this.reportEmitterMap.get(reportId).remove(username)); + } + + public boolean complete(String reportId) { + if (StringUtils.isBlank(reportId) || !this.reportEmitterMap.containsKey(reportId)) { + log.warn(this.logPrefix + "complete report id is empty or could not be found"); + return true; + } + log.info(logPrefix + "complete invoked report id: {}, list size: {}", reportId, this.reportEmitterMap.get(reportId).size()); + + this.reportEmitterMap.get(reportId).forEach((username, emitter) -> { + try { + emitter.send(SseEmitter.event().name(EmitterTypeEnum.FINISH.getValue()).data("finish",MediaType.APPLICATION_JSON)); + } catch (Exception e) { + log.error(this.logPrefix + "complete id:" + reportId + " username:" + username, e); + } + }); + // wait some time to close after sending FIN, so it's in another for loop + this.reportEmitterMap.get(reportId).forEach((username, emitter) -> { + try { + emitter.complete(); + } catch (Exception e) { + log.error(this.logPrefix + "complete id:" + reportId + " username:" + username, e); + } + }); + return this.reportEmitterMap.remove(reportId) != null; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportInfoServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportInfoServiceImpl.java new file mode 100644 index 000000000..137338d3f --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/ReportInfoServiceImpl.java @@ -0,0 +1,188 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.report.ErrRateBo; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; +import run.mone.mimeter.dashboard.bo.scene.SceneSnapshotBo; +import run.mone.mimeter.dashboard.mapper.ReportInfoMapper; +import run.mone.mimeter.dashboard.pojo.ReportInfo; +import run.mone.mimeter.dashboard.pojo.ReportInfoExample; +import run.mone.mimeter.dashboard.service.ReportInfoService; +import run.mone.mimeter.dashboard.service.SceneSnapshotService; +import run.mone.mimeter.dashboard.common.util.Utility; + +import java.util.*; +import java.util.function.Consumer; + +import static com.google.common.base.Preconditions.checkArgument; +import static run.mone.mimeter.dashboard.bo.common.Constants.*; + +/** + * @author dongzhenxing + * @version 1.0 + * @since 2022/6/22 + */ +@Slf4j +@Service +public class ReportInfoServiceImpl implements ReportInfoService { + + private final String logPrefix = "[ReportInfoService]"; + + @Autowired + private ReportInfoMapper reportInfoMapper; + + private static final Gson gson = new Gson(); + + @Autowired + private SceneSnapshotService sceneSnapshotService; + + private ReportInfoExample buildListReportExample(String tenant, String keyword, Integer pageNo, Integer pageSize) { + ReportInfoExample example = new ReportInfoExample(); + ReportInfoExample.Criteria criteria = example.createCriteria(); + if (StringUtils.isNotBlank(keyword)) { + if (StringUtils.isNumeric(keyword)) { + criteria.andSceneIdEqualTo(Long.parseLong(keyword)); + } else { + criteria.andCreateByLike("%"+keyword+"%"); + example.or(example.createCriteria().andReportNameLike("%"+keyword+"%")); + } + } + criteria.andFinishTimeIsNotNull(); + Utility.handlePagination(example, pageSize, pageNo); + example.setOrderByClause("id desc"); + return example; + } + + private static Consumer writeBoConsumer(List resp) { + return (po) -> { + ReportInfoBo bo = new ReportInfoBo(); + BeanUtils.copyProperties(po, bo); + ErrRateBo errRate = gson.fromJson(po.getTotalStatAnalysisEventList(), ErrRateBo.class); + if (errRate != null){ + double successRate = 100.00 - Double.parseDouble(errRate.getTotalErrRate()); + + bo.setSuccessRate(format2(successRate)); + } + resp.add(bo); + }; + } + + @Override + public Result> listReports(String tenant, String keyword, Integer pageNo, Integer pageSize) { + return this.reportInfosFromExample(this.buildListReportExample(tenant, keyword, pageNo, pageSize)); + } + + private Result> reportInfosFromExample(ReportInfoExample example) { + List list = new ArrayList<>(); + this.reportInfoMapper.selectByExampleWithBLOBs(example).forEach(writeBoConsumer(list)); + return Result.success(list); + } + + @Override + public Result countReports(String tenant, String keyword, Integer pageNo, Integer pageSize) { + return Result.success(this.reportInfoMapper.countByExample(this.buildListReportExample(tenant, keyword, pageNo, pageSize))); + } + + @Override + public Result getReportDetails(Long sceneId, String reportId) { + ReportInfoExample example = new ReportInfoExample(); + ReportInfoExample.Criteria criteria = example.createCriteria(); + criteria.andReportIdEqualTo(reportId); + + if (sceneId != null && sceneId > 0) { + criteria.andSceneIdEqualTo(sceneId); + } + List list = this.reportInfoMapper.selectByExampleWithBLOBs(example); + + if (list.isEmpty()) { + return Result.success(null); + } + ReportInfoBo bo = new ReportInfoBo(); + BeanUtils.copyProperties(list.get(0), bo); + if (bo.getFinishTime() == null || bo.getDuration() == null || bo.getDuration() == 0) { + long tmpFinishTime; + if (bo.getDuration() == null || bo.getDuration() == 0) { + tmpFinishTime = bo.getCreateTime().getTime() + 600000; + } else { + tmpFinishTime = bo.getCreateTime().getTime() + bo.getDuration() + 1000; + } + bo.setFinishTime(tmpFinishTime); + + list.get(0).setStatus(REPORT_STATUS_INACTIVE); + try { + reportInfoMapper.updateByPrimaryKey(list.get(0)); + } catch (Exception e) { + log.error("error:{}",e.getMessage()); + } + } + bo.setTotalStatAnalysis(list.get(0).getTotalStatAnalysisEventList()); + return Result.success(bo); + } + + @Override + public Result createReport(ReportInfoBo bo) { + checkArgument(bo != null && bo.checkCreate(), this.logPrefix + "createReport invalid input"); + + if (StringUtils.isBlank(bo.getSnapshotId())) { + Result result = this.sceneSnapshotService.getSceneSnapshotByScene(bo.getSceneId()); + String snapshotId = bo.getSnapshotId(); + SceneSnapshotBo snapshotData = result.getData(); + + if (result.getData() != null) { + snapshotId = snapshotData.getSnapshotId(); + } + checkArgument(StringUtils.isNotBlank(snapshotId), this.logPrefix + "createReport empty snapshot id"); + bo.setSnapshotId(snapshotId); + } + // passed from task service submit task + String reportId = bo.getReportId(); + bo.setReportId(reportId); + ReportInfo po = new ReportInfo(); + BeanUtils.copyProperties(bo, po); + if (this.reportInfoMapper.insertSelective(po) <= 0) { + return Result.success(""); + } + return Result.success(reportId); + } + + @Override + public Result updateReport(ReportInfoBo bo) { + checkArgument(bo != null && bo.checkUpdate(), this.logPrefix + "updateReport invalid input"); + ReportInfo po = new ReportInfo(); + BeanUtils.copyProperties(bo, po); + + ReportInfoExample example = new ReportInfoExample(); + ReportInfoExample.Criteria criteria = example.createCriteria(); + criteria.andReportIdEqualTo(bo.getReportId()); + + if (bo.getSceneId() != null && bo.getSceneId() > 0) { + criteria.andSceneIdEqualTo(bo.getSceneId()); + } + return Result.success(this.reportInfoMapper.updateByExampleSelective(po, example) > 0); + } + + @Override + public Result removeReports(List reportIds) { + checkArgument(reportIds != null && !reportIds.isEmpty(), + this.logPrefix + "empty or inconsistent input"); + + ReportInfoExample example = new ReportInfoExample(); + ReportInfoExample.Criteria criteria = example.createCriteria(); + criteria.andIdIn(reportIds); + reportInfoMapper.deleteByExample(example); + return Result.success(1); + } + + public static String format2(double value) { + /* + * %.2f % 表示 小数点前任意位数 2 表示两位小数 格式后的结果为 f 表示浮点型 + */ + return new Formatter().format("%.2f", value).toString(); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneApiServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneApiServiceImpl.java new file mode 100644 index 000000000..58d039fb1 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneApiServiceImpl.java @@ -0,0 +1,705 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.pojo.Instance; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.data.push.nacos.NacosNaming; +import com.xiaomi.miapi.api.service.MiApiDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.dubbo.common.utils.StringUtils; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.DubboService; +import run.mone.mimeter.dashboard.bo.DubboServiceList; +import run.mone.mimeter.dashboard.bo.NacosInfo; +import run.mone.mimeter.dashboard.bo.NacosLoginInfo; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.DefaultSceneInfo; +import run.mone.mimeter.dashboard.bo.scene.DubboApiInfoDTO; +import run.mone.mimeter.dashboard.bo.scene.HttpApiInfoDTO; +import run.mone.mimeter.dashboard.bo.scene.TspAuthInfo; +import run.mone.mimeter.dashboard.bo.sceneapi.*; +import run.mone.mimeter.dashboard.common.DubboParamItem; +import run.mone.mimeter.dashboard.common.TaskType; +import run.mone.mimeter.dashboard.common.util.BizUtils; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.exception.CommonException; +import run.mone.mimeter.dashboard.mapper.CheckPointInfoMapper; +import run.mone.mimeter.dashboard.mapper.SceneApiInfoMapper; +import run.mone.mimeter.dashboard.pojo.CheckPointInfo; +import run.mone.mimeter.dashboard.pojo.SceneApiInfo; +import run.mone.mimeter.dashboard.pojo.SceneApiInfoExample; +import run.mone.mimeter.dashboard.service.SceneApiService; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.*; + +@Service +@Slf4j +public class SceneApiServiceImpl implements SceneApiService { + + //mimeter只会有一个环境,调用mi-api线上即可 + @DubboReference(check = false, group = "${ref.miapi.service.group}", version = "${ref.miapi.service.version}") + private MiApiDataService miApiDataService; + + @Autowired + private SceneApiInfoMapper sceneApiInfoMapper; + + @Resource(name = "nacosNamingSt") + private NacosNaming nacosNamingSt; + + @Resource(name = "nacosNamingOl") + private NacosNaming nacosNamingOl; + private static final Gson gson = Util.getGson(); + ; + public static String stNacosAccessToken = ""; + + public static String olNacosAccessToken = ""; + + + @Autowired + private CheckPointInfoMapper checkPointInfoMapper; + + @Autowired + NacosInfo nacosInfo; + + private final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + + /** + * 每5分钟更新nacos的accessToken + */ + @PostConstruct + public void init() { + executorService.scheduleAtFixedRate(this::refreshStNacosToken, 0, 5, TimeUnit.MINUTES); + + executorService.scheduleAtFixedRate(this::refreshOlNacosToken, 0, 5, TimeUnit.MINUTES); + } + + @Override + public Result searchApiFromMiApi(String keyword, Integer apiProtocol) { + try { + List> apiDatas = miApiDataService.searchAllApiByKeyword(keyword, apiProtocol); + + if (apiProtocol == Constants.HTTP_API_TYPE || apiProtocol == Constants.GATEWAY_API_TYPE) { + List items = new ArrayList<>(); + //http、mione网关接口集 + apiDatas.forEach(apiData -> { + SceneHttpApiInfoItemBasic httpItem = new SceneHttpApiInfoItemBasic(); + httpItem.setApiName((String) apiData.getOrDefault("apiName", "")); + httpItem.setApiRequestType((Integer) apiData.getOrDefault("apiRequestType", 0)); + httpItem.setApiUrl((String) apiData.getOrDefault("apiURI", "")); + httpItem.setApiProtocol((Integer) apiData.getOrDefault("apiProtocol", HTTP_API_TYPE)); + Long apiID = (Long) apiData.getOrDefault("apiID", 0); + httpItem.setApiID(apiID.intValue()); + + Long projectID = (Long) apiData.getOrDefault("projectID", 0); + httpItem.setProjectID(projectID.intValue()); + items.add(httpItem); + }); + return Result.success(items); + } else if (apiProtocol == Constants.DUBBO_API_TYPE) { + List items = new ArrayList<>(); + //dubbo接口集 + apiDatas.forEach(apiData -> { + SceneDubboApiInfoItemBasic dubboItem = new SceneDubboApiInfoItemBasic(); + dubboItem.setApiName((String) apiData.getOrDefault("apiName", "")); + + Long apiID = (Long) apiData.getOrDefault("apiID", 0); + + dubboItem.setApiID(apiID.intValue()); + + Long projectID = (Long) apiData.getOrDefault("projectID", 0); + dubboItem.setProjectID(projectID.intValue()); + dubboItem.setApiProtocol((Integer) apiData.getOrDefault("apiProtocol", DUBBO_API_TYPE)); + String dubboPath = (String) apiData.getOrDefault("apiURI", ""); + String[] dubboInfo = dubboPath.split(":", 4); + if (dubboInfo.length != 4) { + return; + } + dubboItem.setServiceName(dubboInfo[0]); + dubboItem.setGroup(dubboInfo[1]); + dubboItem.setVersion(dubboInfo[2]); + dubboItem.setMethodName(dubboInfo[3]); + dubboItem.setPath(dubboPath); + items.add(dubboItem); + }); + return Result.success(items); + } + } catch (Exception e) { + return Result.fail(CommonError.LoadMiApiDataFail); + } + return Result.success(new ArrayList<>()); + } + + @Override + public Result getApiDetailFromMiApi(GetApiDetailReq req) { + try { + String apiDetailStr = miApiDataService.getApiDetailById(req.getProjectID(), req.getApiID(), req.getApiProtocol()); + Map apiDetail = gson.fromJson(apiDetailStr, new TypeToken>() { + }.getType()); + //http或网关类型的接口 + if (req.getApiProtocol() == Constants.HTTP_API_TYPE || req.getApiProtocol() == Constants.GATEWAY_API_TYPE) { + SceneHttpApiInfoItemDetail httpDetail = new SceneHttpApiInfoItemDetail(); + httpDetail.setHeaderInfo(gson.toJson(apiDetail.getOrDefault("headerInfo", ""))); + Map baseInfo = null; + String baseUrl = ""; + if (req.getApiProtocol() == Constants.HTTP_API_TYPE) { + baseInfo = (Map) apiDetail.get("baseInfo"); + if (Objects.nonNull(baseInfo)) { + httpDetail.setApiName((String) baseInfo.get("apiName")); + httpDetail.setApiID((Integer) baseInfo.get("apiID")); + int requestMethod = (int) baseInfo.get("apiRequestType"); + httpDetail.setApiRequestType(requestMethod); + baseUrl = (String) baseInfo.get("apiURI"); + httpDetail.setApiRequestParamType((Integer) baseInfo.get("apiRequestParamType")); + httpDetail.setRequestInfoRaw((String) baseInfo.get("apiRequestRaw")); + } + } else if (req.getApiProtocol() == Constants.GATEWAY_API_TYPE) { + baseInfo = (Map) apiDetail.get("gatewayApiBaseInfo"); + if (Objects.nonNull(baseInfo)) { + httpDetail.setApiName((String) baseInfo.get("name")); + httpDetail.setApiID((Integer) baseInfo.get("id")); + String requestMethod = (String) baseInfo.get("httpMethod"); + if (requestMethod.equalsIgnoreCase("get")) { + httpDetail.setApiRequestType(MI_API_HTTP_REQ_GET); + } else { + httpDetail.setApiRequestType(MI_API_HTTP_REQ_POST); + } + httpDetail.setApiRequestParamType(2); + baseUrl = (String) baseInfo.get("url"); + httpDetail.setRequestInfoRaw((String) apiDetail.getOrDefault("apiRequestRaw", "{}")); + + } + } + //http或网关类型接口 + httpDetail.setApiProtocol(req.getApiProtocol()); + StringBuilder url = new StringBuilder("127.0.0.1:8080"); + url.append(baseUrl); + if (httpDetail.getApiRequestType() == MI_API_HTTP_REQ_GET) { + List reqParamList = (List) apiDetail.getOrDefault("requestInfo", ""); + if (reqParamList != null && reqParamList.size() != 0) { + url.append("?"); + } + for (int i = 0; i < Objects.requireNonNull(reqParamList).size(); i++) { + Map pair = (Map) reqParamList.get(i); + url.append(pair.get("paramKey")); + url.append("="); + url.append(pair.get("paramValue")); + if (i != reqParamList.size() - 1) { + url.append("&"); + } + } + } else { + httpDetail.setRequestInfo(gson.toJson(apiDetail.getOrDefault("requestInfo", ""))); + } + httpDetail.setApiUrl(url.toString()); + return Result.success(httpDetail); + } else if (req.getApiProtocol() == Constants.DUBBO_API_TYPE) { + //dubbo类型接口 + SceneDubboApiInfoItemDetail dubboDetail = new SceneDubboApiInfoItemDetail(); + dubboDetail.setApiName((String) apiDetail.getOrDefault("name", "")); + dubboDetail.setDubboEnv((String) apiDetail.getOrDefault("apiEnv", "staging")); + dubboDetail.setProjectID((Integer) apiDetail.getOrDefault("projectID", "")); + dubboDetail.setApiProtocol(Constants.DUBBO_API_TYPE); + + Map dubboApiBaseInfo = (Map) apiDetail.get("dubboApiBaseInfo"); + if (Objects.nonNull(dubboApiBaseInfo)) { + dubboDetail.setServiceName((String) dubboApiBaseInfo.get("apimodelclass")); + dubboDetail.setGroup((String) dubboApiBaseInfo.get("apigroup")); + dubboDetail.setVersion((String) dubboApiBaseInfo.get("apiversion")); + dubboDetail.setMethodName((String) dubboApiBaseInfo.get("apiname")); + dubboDetail.setApiID((Integer) dubboApiBaseInfo.get("id")); + + if (Objects.nonNull(dubboApiBaseInfo.get("methodparaminfo"))) { + String paramsJson = (String) dubboApiBaseInfo.get("methodparaminfo"); + List itemList = gson.fromJson(paramsJson, new TypeToken>() { + }.getType()); + if (Objects.nonNull(itemList)) { + dubboDetail.setRequestParamTypeList(itemList.stream().map(DubboParamItem::getItemClassStr).collect(Collectors.toList())); + } + } else { + dubboDetail.setRequestParamTypeList(new ArrayList<>()); + } + + //请求体,需要mi-api中对应项目使用较高版本依赖才能自动生成请求体 + if (Objects.nonNull(dubboApiBaseInfo.get("request"))) { + dubboDetail.setRequestBody((String) dubboApiBaseInfo.get("request")); + } + } + return Result.success(dubboDetail); + } + return Result.fail(CommonError.InvalidParamError); + } catch (Exception e) { + return Result.fail(CommonError.LoadMiApiDataFail); + } + } + + @Override + public Result getSceneBasicInfoFromApiID(GetApiDetailReq req) { + DefaultSceneInfo defaultSceneInfo = new DefaultSceneInfo(); + Object apiInfo; + try { + apiInfo = this.getApiDetailFromMiApi(req).getData(); + + defaultSceneInfo.setDefaultSceneName("默认场景(请修改)"); + if (req.getApiProtocol() == Constants.HTTP_API_TYPE || req.getApiProtocol() == Constants.GATEWAY_API_TYPE) { + defaultSceneInfo.setSceneType(TaskType.http.name()); + SceneHttpApiInfoItemDetail httpApi = (SceneHttpApiInfoItemDetail) apiInfo; + if (httpApi != null) { + defaultSceneInfo.setDefaultSceneName(httpApi.getApiName()); + } + } else if (req.getApiProtocol() == Constants.DUBBO_API_TYPE) { + defaultSceneInfo.setSceneType(TaskType.dubbo.name()); + SceneDubboApiInfoItemDetail dubboApi = (SceneDubboApiInfoItemDetail) apiInfo; + if (dubboApi != null) { + defaultSceneInfo.setDefaultSceneName(dubboApi.getApiName()); + } + } + defaultSceneInfo.setApiInfo(apiInfo); + } catch (Exception e) { + log.error("get api error:{}", e.getMessage()); + } + return Result.success(defaultSceneInfo); + } + + @Override + public boolean newHttpSceneApis(List httpApiInfoDTOS, int sceneId, int serialLinkId) { + httpApiInfoDTOS.forEach(httpApiInfoDTO -> { + Pair checkRes = checkHttpSceneApiParam(httpApiInfoDTO); + if (checkRes.getKey() != 0) { + throw new CommonException(CommonError.InvalidParamError.code, checkRes.getValue()); + } + SceneApiInfo info = new SceneApiInfo(); + BeanUtils.copyProperties(httpApiInfoDTO, info); + info.setApiType(Constants.CASE_TYPE_HTTP); + info.setSerialLinkId(serialLinkId); + info.setSceneId(sceneId); + //raw数据,post请求使用raw格式 + if (httpApiInfoDTO.getRequestInfoRaw() == null || httpApiInfoDTO.getRequestInfoRaw().isEmpty()) { + info.setRequestBody("[{}]"); + } else { + info.setRequestBody(httpApiInfoDTO.getRequestInfoRaw()); + } + //带格式参数数据 + info.setRequestMethod(httpApiInfoDTO.getApiRequestType()); + info.setRequestParamInfo(httpApiInfoDTO.getRequestInfo()); + if (httpApiInfoDTO.getApiRequestType() == Constants.HTTP_REQ_GET) { + Pair> res = parseGetUrl(httpApiInfoDTO.getApiUrl()); + if (res.getLeft() == -1) { + return; + } else { + info.setRequestParamInfo(gson.toJson(res.getRight())); + } + } + info.setApiHeader(httpApiInfoDTO.getHeaderInfo()); + + //汽车部tsp接口鉴权 + if (httpApiInfoDTO.getApiTspAuth() != null){ + info.setApiTspAuth(gson.toJson(httpApiInfoDTO.getApiTspAuth())); + }else { + info.setApiTspAuth(gson.toJson(new TspAuthInfo(false))); + } + //该接口是否使用录制的流量 + if (httpApiInfoDTO.getApiTrafficInfo() != null){ + info.setApiTrafficInfo(gson.toJson(httpApiInfoDTO.getApiTrafficInfo())); + }else { + info.setApiTrafficInfo(gson.toJson(new ApiTrafficInfo(false))); + } + + //该接口是否使用x5 + if (httpApiInfoDTO.getApiX5Info() != null){ + info.setApiX5Info(gson.toJson(httpApiInfoDTO.getApiX5Info())); + }else { + info.setApiX5Info(gson.toJson(new ApiX5Info(false))); + } + + //转换解析表达式 + BizUtils.processOutputParamExpr(httpApiInfoDTO.getOutputParamInfos()); + info.setOutputParamInfo(gson.toJson(httpApiInfoDTO.getOutputParamInfos())); + + //处理检查点数据 + processCheckPoints(null, httpApiInfoDTO, info); + + //过滤条件 + info.setFilterCondition(gson.toJson(httpApiInfoDTO.getFilterCondition())); + sceneApiInfoMapper.insert(info); + httpApiInfoDTO.setApiID(info.getId()); + }); + return true; + } + + @Override + public boolean updateHttpSceneApi(HttpApiInfoDTO httpApiInfoDTO) { + Pair checkRes = checkHttpSceneApiParam(httpApiInfoDTO); + if (checkRes.getKey() != 0) { + return false; + } + SceneApiInfo info = sceneApiInfoMapper.selectByPrimaryKey(httpApiInfoDTO.getApiID()); + + BeanUtils.copyProperties(httpApiInfoDTO, info); + info.setApiType(Constants.CASE_TYPE_HTTP); + //raw数据,post请求使用raw格式 + info.setRequestBody(httpApiInfoDTO.getRequestInfoRaw()); + //带格式参数数据 + info.setRequestMethod(httpApiInfoDTO.getApiRequestType()); + info.setRequestParamInfo(httpApiInfoDTO.getRequestInfo()); + if (httpApiInfoDTO.getApiRequestType() == Constants.HTTP_REQ_GET) { + Pair> res = parseGetUrl(httpApiInfoDTO.getApiUrl()); + if (res.getLeft() == -1) { + return false; + } else { + info.setRequestParamInfo(gson.toJson(res.getRight())); + } + } + info.setApiHeader(httpApiInfoDTO.getHeaderInfo()); + + //汽车部tsp接口鉴权 + if (httpApiInfoDTO.getApiTspAuth() != null){ + info.setApiTspAuth(gson.toJson(httpApiInfoDTO.getApiTspAuth())); + }else { + info.setApiTspAuth(gson.toJson(new TspAuthInfo(false))); + } + //该接口是否使用录制的流量 + if (httpApiInfoDTO.getApiTrafficInfo() != null){ + info.setApiTrafficInfo(gson.toJson(httpApiInfoDTO.getApiTrafficInfo())); + }else { + info.setApiTrafficInfo(gson.toJson(new ApiTrafficInfo(false))); + } + //该接口是否使用x5 + if (httpApiInfoDTO.getApiX5Info() != null){ + info.setApiX5Info(gson.toJson(httpApiInfoDTO.getApiX5Info())); + }else { + info.setApiX5Info(gson.toJson(new ApiX5Info(false))); + } + //转换解析表达式 + BizUtils.processOutputParamExpr(httpApiInfoDTO.getOutputParamInfos()); + info.setOutputParamInfo(gson.toJson(httpApiInfoDTO.getOutputParamInfos())); + + //处理检查点数据 + processCheckPoints(null, httpApiInfoDTO, info); + + //过滤条件 + info.setFilterCondition(gson.toJson(httpApiInfoDTO.getFilterCondition())); + + sceneApiInfoMapper.updateByPrimaryKeyWithBLOBs(info); + return true; + } + + @Override + public boolean updateDubboSceneApi(DubboApiInfoDTO dubboApiInfoDTO) { + Pair checkRes = checkDubboSceneApiParam(dubboApiInfoDTO); + if (checkRes.getKey() != 0) { + throw new CommonException(CommonError.InvalidParamError.code, checkRes.getValue()); + } + SceneApiInfo info = sceneApiInfoMapper.selectByPrimaryKey(dubboApiInfoDTO.getApiID()); + BeanUtils.copyProperties(dubboApiInfoDTO, info); + info.setApiType(Constants.CASE_TYPE_RPCX); + info.setDubboGroup(dubboApiInfoDTO.getGroup()); + info.setDubboVersion(dubboApiInfoDTO.getVersion()); + //nacos环境 + if ("staging".equals(dubboApiInfoDTO.getDubboEnv())) { + info.setNacosType(Constants.NACOS_TYPE_ST); + } else if ("online".equals(dubboApiInfoDTO.getDubboEnv())) { + info.setNacosType(Constants.NACOS_TYPE_OL); + } + //参数类型列表 + info.setParamTypeList(gson.toJson(dubboApiInfoDTO.getRequestParamTypeList())); + //参数体 json + info.setDubboParamJson(dubboApiInfoDTO.getRequestBody()); + + //更新attachment + info.setApiHeader(dubboApiInfoDTO.getAttachments()); + + //转换解析表达式 + BizUtils.processOutputParamExpr(dubboApiInfoDTO.getOutputParamInfos()); + info.setOutputParamInfo(gson.toJson(dubboApiInfoDTO.getOutputParamInfos())); + + //处理检查点数据 + processCheckPoints(dubboApiInfoDTO, null, info); + + //过滤条件 + info.setFilterCondition(gson.toJson(dubboApiInfoDTO.getFilterCondition())); + sceneApiInfoMapper.updateByPrimaryKeyWithBLOBs(info); + return true; + } + + @Override + public boolean newDubboSceneApis(List dubboApiInfoDTOS, int sceneId, int serialLinkId) { + dubboApiInfoDTOS.forEach(dubboApiInfoDTO -> { + Pair checkRes = checkDubboSceneApiParam(dubboApiInfoDTO); + if (checkRes.getKey() != 0) { + throw new CommonException(CommonError.InvalidParamError.code, checkRes.getValue()); + } + SceneApiInfo info = new SceneApiInfo(); + BeanUtils.copyProperties(dubboApiInfoDTO, info); + info.setDubboGroup(dubboApiInfoDTO.getGroup()); + info.setDubboVersion(dubboApiInfoDTO.getVersion()); + + info.setRequestMethod(0); + info.setNeedLogin(false); + + info.setApiType(Constants.CASE_TYPE_RPCX); + info.setSceneId(sceneId); + info.setSerialLinkId(serialLinkId); + //nacos环境 + if ("staging".equals(dubboApiInfoDTO.getDubboEnv())) { + info.setNacosType(Constants.NACOS_TYPE_ST); + } else if ("online".equals(dubboApiInfoDTO.getDubboEnv())) { + info.setNacosType(Constants.NACOS_TYPE_OL); + } + //参数类型列表 + info.setParamTypeList(gson.toJson(dubboApiInfoDTO.getRequestParamTypeList())); + //参数体 json + info.setDubboParamJson(dubboApiInfoDTO.getRequestBody()); + //dubbo请求携带的attachment + info.setApiHeader(dubboApiInfoDTO.getAttachments()); + + //转换解析表达式 + BizUtils.processOutputParamExpr(dubboApiInfoDTO.getOutputParamInfos()); + info.setOutputParamInfo(gson.toJson(dubboApiInfoDTO.getOutputParamInfos())); + + //处理检查点数据 + processCheckPoints(dubboApiInfoDTO, null, info); + + //过滤条件 + info.setFilterCondition(gson.toJson(dubboApiInfoDTO.getFilterCondition())); + sceneApiInfoMapper.insert(info); + dubboApiInfoDTO.setApiID(info.getId()); + }); + return true; + } + + @Override + public boolean deleteSceneApisBySceneId(int sceneId) { + SceneApiInfoExample example = new SceneApiInfoExample(); + example.createCriteria().andSceneIdEqualTo(sceneId); + return sceneApiInfoMapper.deleteByExample(example) >= 0; + } + + @Override + public boolean deleteSceneApisBySerialLinkId(int serialLinkId) { + SceneApiInfoExample example = new SceneApiInfoExample(); + example.createCriteria().andSerialLinkIdEqualTo(serialLinkId); + return sceneApiInfoMapper.deleteByExample(example) >= 0; + } + + private void processCheckPoints(DubboApiInfoDTO dubboApiInfoDTO, HttpApiInfoDTO httpApiInfoDTO, SceneApiInfo info) { + List checkPointInfoDTOList = new ArrayList<>(); + //检查点信息 + if (info.getApiType() == Constants.CASE_TYPE_HTTP) { + checkPointInfoDTOList = httpApiInfoDTO.getCheckPointInfoList(); + } else if (info.getApiType() == Constants.CASE_TYPE_RPCX) { + checkPointInfoDTOList = dubboApiInfoDTO.getCheckPointInfoList(); + } + List checkPointInfos = new ArrayList<>(checkPointInfoDTOList.size()); + checkPointInfoDTOList.forEach(checkPointInfoDTO -> { + CheckPointInfo checkPointInfo = new CheckPointInfo(); + checkPointInfo.setCheckType(checkPointInfoDTO.getCheckType()); + checkPointInfo.setCheckObj(checkPointInfoDTO.getCheckObj()); + checkPointInfo.setCheckCondition(checkPointInfoDTO.getCheckCondition()); + checkPointInfo.setCheckContent(checkPointInfoDTO.getCheckContent()); + checkPointInfos.add(checkPointInfo); + }); + + //插入检查点数据 + if (checkPointInfos.size() != 0) { + checkPointInfoMapper.batchInsert(checkPointInfos); + } + info.setCheckPoint(gson.toJson(checkPointInfos)); + } + + private Pair checkHttpSceneApiParam(HttpApiInfoDTO apiInfoDTO) { + if (apiInfoDTO.getApiUrl() == null) { + return Pair.of(-1, "接口url"); + } + if (apiInfoDTO.getApiRequestType() == null) { + return Pair.of(-1, "接口请求方式必传"); + } + if (apiInfoDTO.getApiOrder() == null) { + return Pair.of(-1, "接口顺序必传"); + } + if (apiInfoDTO.getApiRequestType() == Constants.HTTP_REQ_POST && apiInfoDTO.getContentType() == null) { + return Pair.of(-1, "参数类型必传"); + } + if (apiInfoDTO.getRequestTimeout() == null) { + return Pair.of(-1, "接口超时时间必传"); + } + if (apiInfoDTO.getNeedLogin() == null) { + apiInfoDTO.setNeedLogin(false); + } + + return Pair.of(0, "success"); + } + + private Pair checkDubboSceneApiParam(DubboApiInfoDTO apiInfoDTO) { + if (apiInfoDTO.getServiceName() == null) { + return Pair.of(-1, "dubbo 服务名必传"); + } + if (apiInfoDTO.getMethodName() == null) { + return Pair.of(-1, "dubbo 方法名必传"); + } + if (apiInfoDTO.getGroup() == null) { + apiInfoDTO.setGroup(""); + } + if (apiInfoDTO.getVersion() == null) { + apiInfoDTO.setVersion(""); + } + if (apiInfoDTO.getApiOrder() == null) { + return Pair.of(-1, "接口顺序必传"); + } + if (apiInfoDTO.getRequestTimeout() == null) { + return Pair.of(-1, "接口超时时间必传"); + } + return Pair.of(0, "success"); + } + + @Override + public Result> loadDubboApiServices(String keyword, String env) { + DubboServiceList serviceList = new DubboServiceList(); + String serviceListStr = ""; + + String DEFAULT_NAMESPACE = ""; + if (NACOS_CN_ONLINE.equals(env)) { + serviceListStr = nacosNamingOl.serviceList2(DEFAULT_NAMESPACE, 1, 50, keyword, olNacosAccessToken); + }else if (NACOS_ST.equals(env)){ + serviceListStr = nacosNamingSt.serviceList2(DEFAULT_NAMESPACE, 1, 50, keyword, stNacosAccessToken); + } + if (Objects.nonNull(serviceListStr) && StringUtils.isNotEmpty(serviceListStr)) { + try { + serviceList = gson.fromJson(serviceListStr, new TypeToken() { + }.getType()); + } catch (JsonSyntaxException e) { + log.error("获取nacos服务列表失败,serviceList:{}", serviceListStr); + this.refreshOlNacosToken(); + this.refreshStNacosToken(); + try { + if (NACOS_CN_ONLINE.equals(env)) { + serviceListStr = nacosNamingOl.serviceList2(DEFAULT_NAMESPACE, 1, 50, keyword, olNacosAccessToken); + }else if (NACOS_ST.equals(env)){ + serviceListStr = nacosNamingSt.serviceList2(DEFAULT_NAMESPACE, 1, 50, keyword, stNacosAccessToken); + } + serviceList = gson.fromJson(serviceListStr, new TypeToken() { + }.getType()); + } catch (Exception ex) { + return Result.fail(500, "获取nacos服务列表失败"); + } + } + } + + if (Objects.nonNull(serviceList)) { + return Result.success(serviceList.getServiceList().stream().filter(service -> (service.getHealthyInstanceCount() > 0 && service.getName().startsWith("providers:"))).collect(Collectors.toList())); + } else { + return Result.success(new ArrayList<>()); + } + } + + @Override + public Result> getServiceMethod(String serviceName, String env) throws NacosException { + List methodNames; + List instanceList; + + switch (env) { + case Constants.NACOS_ST: + instanceList = nacosNamingSt.getAllInstances(serviceName); + break; + case Constants.NACOS_CN_ONLINE: + instanceList = nacosNamingOl.getAllInstances(serviceName); + break; + default: + instanceList = new ArrayList<>(); + } + + if (Objects.nonNull(instanceList) && !instanceList.isEmpty()) { + Instance instance = instanceList.get(0); + String[] methodsArr = instance.getMetadata().getOrDefault("methods", "").split(","); + methodNames = Arrays.stream(methodsArr).collect(Collectors.toList()); + return Result.success(methodNames); + } + return Result.success(new ArrayList<>()); + } + + public List getBasicInfosByIds(List apiIdList) { + if (apiIdList == null || apiIdList.isEmpty()) { + return new ArrayList<>(); + } + SceneApiInfoExample example = new SceneApiInfoExample(); + example.createCriteria().andIdIn(apiIdList); + List poList = this.sceneApiInfoMapper.selectByExample(example); + + return poList.stream().map((po) -> SceneApiInfoItemBasic.builder() + .apiID(po.getId()) + .apiName(po.getApiName()) + .build()).collect(Collectors.toList()); + } + + @Override + public Result getApiUrlById(Integer apiId) { + SceneApiInfo apiInfo = sceneApiInfoMapper.selectByPrimaryKey(apiId); + if (apiInfo == null) { + return Result.success(""); + } + if (apiInfo.getApiType() == CASE_TYPE_HTTP) { + return Result.success(apiInfo.getApiUrl()); + } else if (apiInfo.getApiType() == CASE_TYPE_RPCX) { + return Result.success(apiInfo.getServiceName() + "|" + apiInfo.getMethodName()); + } + return Result.success(""); + } + + private Pair> parseGetUrl(String url) { + //url 例: http://www.baidu.com?a=b&b=2 + List kvPairs = new ArrayList<>(); + if (url.contains("?")) { + String[] urlArr = url.split("\\?", 2); + if (urlArr.length != 2) { + return Pair.of(-1, null); + } + //[a=b,b=2] + String[] kvStrPair = urlArr[1].split("&"); + for (String s : kvStrPair) { + String[] kAndV = s.split("=", 2); + kvPairs.add(new FormParamValue(kAndV[0], kAndV[1])); + } + } + return Pair.of(0, kvPairs); + } + + public void refreshStNacosToken() { + //测试环境nacos + try { + NacosLoginInfo stNacosLoginInfo = new Gson().fromJson(nacosNamingSt.login(nacosInfo.getUsernameSt(), nacosInfo.getPasswordSt()), NacosLoginInfo.class); + if (null != stNacosLoginInfo && StringUtils.isNotEmpty(stNacosLoginInfo.getAccessToken())) { + stNacosAccessToken = stNacosLoginInfo.getAccessToken(); + } + } catch (Throwable ex) { + log.error(ex.getMessage()); + } + } + + private void refreshOlNacosToken() { + //中国区线上环境nacos + try { + NacosLoginInfo olNacosLoginInfo = new Gson().fromJson(nacosNamingOl.login(nacosInfo.getUsernameOl(), nacosInfo.getPasswordOl()), NacosLoginInfo.class); + if (null != olNacosLoginInfo && StringUtils.isNotEmpty(olNacosLoginInfo.getAccessToken())) { + olNacosAccessToken = olNacosLoginInfo.getAccessToken(); + } + } catch (Throwable ex) { + log.error(ex.getMessage()); + } + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneGroupServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneGroupServiceImpl.java new file mode 100644 index 000000000..540820272 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneGroupServiceImpl.java @@ -0,0 +1,63 @@ +package run.mone.mimeter.dashboard.service.impl; + +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupDTO; +import run.mone.mimeter.dashboard.mapper.SceneGroupMapper; +import run.mone.mimeter.dashboard.mapper.SceneInfoMapper; +import run.mone.mimeter.dashboard.pojo.SceneGroup; +import run.mone.mimeter.dashboard.pojo.SceneInfo; +import run.mone.mimeter.dashboard.pojo.SceneInfoExample; +import run.mone.mimeter.dashboard.service.SceneGroupService; +import run.mone.mimeter.dashboard.service.SceneService; + +import java.util.List; + +@Service +public class SceneGroupServiceImpl implements SceneGroupService { + + @Autowired + private SceneGroupMapper sceneGroupMapper; + + @Autowired + private SceneInfoMapper sceneInfoMapper; + + @Autowired + private SceneService sceneService; + + @Override + public Result newSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser) { + SceneGroup sceneGroup = new SceneGroup(); + BeanUtils.copyProperties(sceneGroupDTO,sceneGroup); + sceneGroup.setCreator(opUser); + sceneGroup.setCtime(System.currentTimeMillis()); + sceneGroup.setTenant(sceneGroupDTO.getTenant()); + sceneGroupMapper.insert(sceneGroup); + return Result.success(sceneGroup.getId()); + } + + @Override + public Result editSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser) { + SceneGroup sceneGroup = sceneGroupMapper.selectByPrimaryKey(sceneGroupDTO.getId()); + sceneGroup.setGroupName(sceneGroupDTO.getGroupName()); + sceneGroup.setGroupDesc(sceneGroupDTO.getGroupDesc()); + if (sceneGroup.getTenant() == null){ + sceneGroup.setTenant(sceneGroupDTO.getTenant()); + } + sceneGroupMapper.updateByPrimaryKey(sceneGroup); + return Result.success(true); + } + + @Override + public Result delSceneGroup(SceneGroupDTO sceneGroupDTO, String opUser) { + SceneInfoExample example = new SceneInfoExample(); + example.createCriteria().andSceneGroupIdEqualTo(sceneGroupDTO.getId()); + List sceneInfoList = sceneInfoMapper.selectByExample(example); + sceneInfoList.forEach(sceneInfo -> sceneService.delScene(sceneInfo.getId(),opUser)); + sceneGroupMapper.deleteByPrimaryKey(sceneGroupDTO.getId()); + return Result.success(true); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneServiceImpl.java new file mode 100644 index 000000000..d38a6ce64 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneServiceImpl.java @@ -0,0 +1,1096 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import run.mone.mimeter.dashboard.bo.agent.AgentDTO; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.SceneParamData; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogDto; +import run.mone.mimeter.dashboard.bo.operationlog.PerOperation; +import run.mone.mimeter.dashboard.bo.scene.*; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.sceneapi.ApiTrafficInfo; +import run.mone.mimeter.dashboard.bo.sceneapi.ApiX5Info; +import run.mone.mimeter.dashboard.bo.sceneapi.CheckPointInfoDTO; +import run.mone.mimeter.dashboard.bo.sceneapi.SceneApiOutputParam; +import run.mone.mimeter.dashboard.bo.scenegroup.GetSceneGroupListReq; +import run.mone.mimeter.dashboard.bo.scenegroup.GroupSceneDTO; +import run.mone.mimeter.dashboard.bo.scenegroup.SceneGroupList; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; +import run.mone.mimeter.dashboard.common.TaskStatus; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.exception.CommonException; +import run.mone.mimeter.dashboard.mapper.*; +import run.mone.mimeter.dashboard.pojo.*; +import run.mone.mimeter.dashboard.service.*; + +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +import static com.google.common.base.Preconditions.checkArgument; +import static run.mone.mimeter.dashboard.bo.common.Constants.*; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationLogTypeEnum.NEW_OPERATION; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationLogTypeEnum.UPDATE_OPERATION; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationTypeEnum.COPY_SNAPSHOT; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationTypeEnum.VIEW_SNAPSHOT; +import static run.mone.mimeter.dashboard.bo.snapshot.SnapshotTypeEnum.SCENE_SNAPSHOT; + +@Service +@Slf4j +public class SceneServiceImpl implements SceneService { + + @Autowired + private SceneInfoMapper sceneInfoMapper; + + @Autowired + private SceneSnapshotService sceneSnapshotService; + + @Autowired + private SlaService slaService; + + @Autowired + private SceneApiService sceneApiService; + + @Autowired + private SceneApiInfoMapper sceneApiInfoMapper; + + @Autowired + private SerialLinkMapper serialLinkMapper; + + @Autowired + private DatasetService datasetService; + + @Autowired + private OperationLogService operationLogService; + + @Autowired + private SceneGroupMapper sceneGroupMapper; + /** + * 操作记录 + */ + @Autowired + private OperationLogMapper logMapper; + + @Autowired + private AgentInfoMapper agentInfoMapper; + + private static final Gson gson = Util.getGson(); + + private static final Integer SCENE_REQ_TIMEOUT = 1000; + + /** + * 创建压测场景 + * 1、创建场景实体插表 + * 2、json保存接口施压配置 + * 3、数据集处理 + * 4、分类型处理api接口结构,创建链路,插表 + * 5、创建sla,插表 + * 6、数据集处理 + * 7、操作记录和场景快照 + * ... + * + * @param createSceneReq 创建场景所需数据 + * @param opUser 创建人 + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result newScene(CreateSceneDTO createSceneReq, String opUser) { + + Pair checkRes = checkSceneParam(createSceneReq); + if (checkRes.getKey() != 0) { + throw new CommonException(CommonError.InvalidParamError.code, checkRes.getValue()); + } + SceneInfoExample oldExp = new SceneInfoExample(); + oldExp.createCriteria().andNameEqualTo(createSceneReq.getName()); + List olds = sceneInfoMapper.selectByExample(oldExp); + if (olds != null && olds.size() != 0) { + return Result.fail(CommonError.SceneAlreadyExist); + } + SceneInfo sceneInfo; + try { + sceneInfo = new SceneInfo(); + BeanUtils.copyProperties(createSceneReq, sceneInfo); + sceneInfo.setCreator(opUser); + sceneInfo.setUpdator(opUser); + sceneInfo.setSceneGroupId(createSceneReq.getGroupID()); + long now = System.currentTimeMillis(); + sceneInfo.setCtime(now); + sceneInfo.setUtime(now); + sceneInfo.setSceneStatus(TaskStatus.Init.code); + if (createSceneReq.getGlobalHeaderList() != null && createSceneReq.getGlobalHeaderList().size() != 0) { + sceneInfo.setGlobalHeader(gson.toJson(createSceneReq.getGlobalHeaderList())); + } else { + sceneInfo.setGlobalHeader("[]"); + } + if (createSceneReq.getGroupID() == null) { + sceneInfo.setSceneGroupId(0); + } else { + sceneInfo.setSceneGroupId(createSceneReq.getGroupID()); + } + //施压配置中的接口数据配置 + sceneInfo.setApiBenchInfos(gson.toJson(createSceneReq.getApiBenchInfos())); + + //插入sla配置 + if (Objects.nonNull(createSceneReq.getSlaDto())) { + sceneInfo.setSla(gson.toJson(createSceneReq.getSlaDto())); + } + + //自定义成功状态码 + if (createSceneReq.getSuccessCode() != null) { + sceneInfo.setSuccessCode(createSceneReq.getSuccessCode()); + } + + //检查施压机配置 + if (createSceneReq.getAgentIdList() != null && createSceneReq.getAgentIdList().size() != 0) { + List agentDTOList = new ArrayList<>(); + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIdIn(createSceneReq.getAgentIdList()); + + List agentInfos = agentInfoMapper.selectByExample(example); + agentInfos.forEach(agentInfo -> { + AgentDTO agentDTO = new AgentDTO(); + BeanUtils.copyProperties(agentInfo, agentDTO); + agentDTOList.add(agentDTO); + }); + sceneInfo.setAgentList(gson.toJson(agentDTOList)); + } else { + sceneInfo.setAgentList("[]"); + } + + //汽车部tsp接口鉴权 + if (createSceneReq.getGlobalTspAuth() != null) { + sceneInfo.setGlobalTspAuth(gson.toJson(createSceneReq.getGlobalTspAuth())); + } else { + sceneInfo.setGlobalTspAuth(gson.toJson(new TspAuthInfo(false))); + } + + if (createSceneReq.getRefDatasetIds() != null) { + sceneInfo.setRefDatasetIds(gson.toJson(createSceneReq.getRefDatasetIds())); + } + + //插入租户信息 + if (createSceneReq.getTenant() != null) { + sceneInfo.setTenant(createSceneReq.getTenant()); + } + + //有效接口数 + AtomicInteger apiNum = new AtomicInteger(); + if (Constants.SCENE_TYPE_HTTP == createSceneReq.getSceneType()) { + createSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> apiNum.addAndGet(serialLinkDTO.getHttpApiInfoDTOList().size())); + } else if (Constants.SCENE_TYPE_DUBBO == createSceneReq.getSceneType()) { + createSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> apiNum.addAndGet(serialLinkDTO.getDubboApiInfoDTOList().size())); + } + sceneInfo.setApinum(apiNum.get()); + //场景来源 控制台创建或openapi创建 + sceneInfo.setSceneSource(createSceneReq.getSceneSource()); + + //场景负责人 + List personsInCharge = new ArrayList<>(); + personsInCharge.add(opUser); + sceneInfo.setPersonInCharge(gson.toJson(personsInCharge)); + + //压测次数 + sceneInfo.setBenchCount(0); + + //上次压测时间 + sceneInfo.setLastBenchTime(0L); + + sceneInfoMapper.insert(sceneInfo); + + //插入场景api + if (Constants.SCENE_TYPE_HTTP == createSceneReq.getSceneType()) { + createSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> { + //创建串联链路 + SerialLink serialLink = new SerialLink(); + serialLink.setSceneId(sceneInfo.getId()); + serialLink.setName(serialLinkDTO.getSerialLinkName()); + serialLink.setEnable(serialLinkDTO.getEnable()); + serialLinkMapper.insert(serialLink); + + serialLinkDTO.setSerialLinkID(serialLink.getId()); + //http(||网关)类场景 + sceneApiService.newHttpSceneApis(serialLinkDTO.getHttpApiInfoDTOList(), sceneInfo.getId(), serialLink.getId()); + }); + + } else if (Constants.SCENE_TYPE_DUBBO == createSceneReq.getSceneType()) { + createSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> { + //创建串联链路 + SerialLink serialLink = new SerialLink(); + serialLink.setSceneId(sceneInfo.getId()); + serialLink.setName(serialLinkDTO.getSerialLinkName()); + serialLink.setEnable(serialLinkDTO.getEnable()); + serialLinkMapper.insert(serialLink); + serialLinkDTO.setSerialLinkID(serialLink.getId()); + //dubbo场景 + sceneApiService.newDubboSceneApis(serialLinkDTO.getDubboApiInfoDTOList(), sceneInfo.getId(), serialLink.getId()); + }); + } else { + return Result.fail(CommonError.InvalidParamError); + } + + createSceneReq.setId(sceneInfo.getId()); + //绑定数据集 + datasetService.bindDataSetsByScene(createSceneReq.getDatasetIds(), new HashSet<>(createSceneReq.getRefDatasetIds().values()), sceneInfo.getId()); + this.postOperationLog(createSceneReq, true, opUser); + } catch (Exception e) { + log.error("new scene failed,error:{}", e.getMessage()); + throw e; + } + return Result.success(transferToDetailSceneDTO(sceneInfo, false)); + } + + /** + * 删场景 + * 删场景绑定的接口 + * + * @param sceneID + * @param opUser + * @return + */ + @Override + @Transactional + public Result delScene(Integer sceneID, String opUser) { + if (sceneInfoMapper.deleteByPrimaryKey(sceneID) > 0) { + SceneApiInfoExample example = new SceneApiInfoExample(); + example.createCriteria().andSceneIdEqualTo(sceneID); + sceneApiInfoMapper.deleteByExample(example); + return Result.success(true); + } + return Result.fail(CommonError.UnknownError); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result editScene(EditSceneDTO editSceneReq, String opUser) { + try { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(editSceneReq.getId()); + String oTenant = sceneInfo.getTenant(); + BeanUtils.copyProperties(editSceneReq, sceneInfo); + sceneInfo.setTenant(oTenant); + sceneInfo.setId(editSceneReq.getId()); + sceneInfo.setRpsRate(editSceneReq.getRpsRate()); + sceneInfo.setSceneGroupId(editSceneReq.getGroupID()); + long now = System.currentTimeMillis(); + sceneInfo.setUtime(now); + //施压配置中的接口数据配置 + sceneInfo.setApiBenchInfos(gson.toJson(editSceneReq.getApiBenchInfos())); + sceneInfo.setGlobalHeader(gson.toJson(editSceneReq.getGlobalHeaderList())); + sceneInfo.setUpdator(opUser); + + if (editSceneReq.getGroupID() == null) { + sceneInfo.setSceneGroupId(Constants.DEFAULT_SCENE_GROUP); + } + if (editSceneReq.getSceneEnv() == null) { + sceneInfo.setSceneEnv(SCENE_ENV_ST); + } + if (editSceneReq.getIncreasePercent() == null) { + sceneInfo.setIncreasePercent(0); + } + //插入sla配置 + if (Objects.nonNull(editSceneReq.getSlaDto())) { + sceneInfo.setSla(gson.toJson(editSceneReq.getSlaDto())); + } + //检查施压机配置 + if (editSceneReq.getAgentIdList() != null && editSceneReq.getAgentIdList().size() != 0) { + List agentDTOList = new ArrayList<>(); + AgentInfoExample example = new AgentInfoExample(); + example.createCriteria().andIdIn(editSceneReq.getAgentIdList()); + + List agentInfos = agentInfoMapper.selectByExample(example); + AtomicBoolean ok = new AtomicBoolean(true); + agentInfos.forEach(agentInfo -> { + if (!agentInfo.getEnable()) { + ok.set(false); + } else { + AgentDTO agentDTO = new AgentDTO(); + BeanUtils.copyProperties(agentInfo, agentDTO); + agentDTOList.add(agentDTO); + } + }); + if (!ok.get()) { + return Result.fail(CommonError.UnableBenchAgent); + } + sceneInfo.setAgentList(gson.toJson(agentDTOList)); + } else { + sceneInfo.setAgentList("[]"); + } + + //汽车部tsp接口鉴权 + if (editSceneReq.getGlobalTspAuth() != null) { + sceneInfo.setGlobalTspAuth(gson.toJson(editSceneReq.getGlobalTspAuth())); + } else { + sceneInfo.setGlobalTspAuth(gson.toJson(new TspAuthInfo(false))); + } + + if (editSceneReq.getSuccessCode() != null) { + sceneInfo.setSuccessCode(editSceneReq.getSuccessCode()); + } + + if (editSceneReq.getRefDatasetIds() != null) { + sceneInfo.setRefDatasetIds(gson.toJson(editSceneReq.getRefDatasetIds())); + } + + //兼容,早期的场景没有租户信息,这里在更新的时候补充进去 + if (sceneInfo.getTenant() == null) { + sceneInfo.setTenant(editSceneReq.getTenant()); + } + + //有效接口数 + AtomicInteger apiNum = new AtomicInteger(); + if (Constants.SCENE_TYPE_HTTP == editSceneReq.getSceneType()) { + editSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> apiNum.addAndGet(serialLinkDTO.getHttpApiInfoDTOList().size())); + } else if (Constants.SCENE_TYPE_DUBBO == editSceneReq.getSceneType()) { + editSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> apiNum.addAndGet(serialLinkDTO.getDubboApiInfoDTOList().size())); + } + sceneInfo.setApinum(apiNum.get()); + //场景来源 控制台创建或openapi创建 + sceneInfo.setSceneSource(editSceneReq.getSceneSource()); + + //场景负责人 + List bindUsers = new ArrayList<>(editSceneReq.getPersonsInCharge().size()); + editSceneReq.getPersonsInCharge().forEach(user -> { + if (user.contains("@")) { + user = user.substring(0, user.indexOf("@")); + } + bindUsers.add(user); + }); + sceneInfo.setPersonInCharge(gson.toJson(bindUsers)); + + sceneInfoMapper.updateByPrimaryKeyWithBLOBs(sceneInfo); + + SerialLinkExample linkExample = new SerialLinkExample(); + linkExample.createCriteria().andSceneIdEqualTo(editSceneReq.getId()); + //原有链路 + List oldLinkIds = serialLinkMapper.selectByExample(linkExample).stream().map(SerialLink::getId).collect(Collectors.toList()); + + removeOldLinks(oldLinkIds, editSceneReq); + //更新场景下api列表 + if (Constants.SCENE_TYPE_HTTP == editSceneReq.getSceneType()) { + //http(||网关)类场景 + editSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> { + SerialLink serialLink = serialLinkMapper.selectByPrimaryKey(serialLinkDTO.getSerialLinkID()); + if (serialLink == null) { + //新增链路 + //创建串联链路 + serialLink = new SerialLink(); + serialLink.setSceneId(sceneInfo.getId()); + serialLink.setName(serialLinkDTO.getSerialLinkName()); + if (serialLinkDTO.getEnable() == null) { + serialLink.setEnable(false); + } else { + serialLink.setEnable(serialLinkDTO.getEnable()); + } + serialLinkMapper.insert(serialLink); + + serialLinkDTO.setSerialLinkID(serialLink.getId()); + //http(||网关)类场景 + sceneApiService.newHttpSceneApis(serialLinkDTO.getHttpApiInfoDTOList(), sceneInfo.getId(), serialLink.getId()); + } else { + //更新链路 + serialLink.setName(serialLinkDTO.getSerialLinkName()); + if (serialLinkDTO.getEnable() == null) { + serialLink.setEnable(false); + } else { + serialLink.setEnable(serialLinkDTO.getEnable()); + } + //更新链路信息 + serialLinkMapper.updateByPrimaryKey(serialLink); + + //更新链路中的接口信息 + List apisToBeAdded = new ArrayList<>(); + //新接口id集 + List newApiIds = serialLinkDTO.getHttpApiInfoDTOList().stream().map(HttpApiInfoDTO::getApiID).collect(Collectors.toList()); + //删除旧的 + SceneApiInfoExample apiInfoExample = new SceneApiInfoExample(); + apiInfoExample.createCriteria().andSceneIdEqualTo(sceneInfo.getId()).andSerialLinkIdEqualTo(serialLink.getId()); + + //原接口id集 + List oldApiIds = sceneApiInfoMapper.selectByExample(apiInfoExample).stream().map(SceneApiInfo::getId).collect(Collectors.toList()); + oldApiIds.forEach(oldId -> { + if (!newApiIds.contains(oldId)) { + //删除 + sceneApiInfoMapper.deleteByPrimaryKey(oldId); + } + }); + + //更新原有接口 + serialLinkDTO.getHttpApiInfoDTOList().forEach(httpApiDTO -> { + if (httpApiDTO.getApiID() != null) { + sceneApiService.updateHttpSceneApi(httpApiDTO); + } else { + apisToBeAdded.add(httpApiDTO); + } + }); + + //添加新的接口 + if (apisToBeAdded.size() != 0) { + sceneApiService.newHttpSceneApis(apisToBeAdded, sceneInfo.getId(), serialLink.getId()); + } + } + }); + + } else if (Constants.SCENE_TYPE_DUBBO == editSceneReq.getSceneType()) { + //dubbo场景 + editSceneReq.getSerialLinkDTOs().forEach(serialLinkDTO -> { + SerialLink serialLink = serialLinkMapper.selectByPrimaryKey(serialLinkDTO.getSerialLinkID()); + if (serialLink == null) { + //创建串联链路 + serialLink = new SerialLink(); + serialLink.setSceneId(sceneInfo.getId()); + serialLink.setName(serialLinkDTO.getSerialLinkName()); + + if (serialLinkDTO.getEnable() == null) { + serialLink.setEnable(false); + } else { + serialLink.setEnable(serialLinkDTO.getEnable()); + } + serialLinkMapper.insert(serialLink); + //dubbo场景 + sceneApiService.newDubboSceneApis(serialLinkDTO.getDubboApiInfoDTOList(), sceneInfo.getId(), serialLink.getId()); + } else { + serialLink.setName(serialLinkDTO.getSerialLinkName()); + serialLink.setEnable(serialLinkDTO.getEnable()); + //更新链路信息 + serialLinkMapper.updateByPrimaryKey(serialLink); + List apisToBeAdded = new ArrayList<>(); + //新接口id集 + List newApiIds = serialLinkDTO.getDubboApiInfoDTOList().stream().map(DubboApiInfoDTO::getApiID).collect(Collectors.toList()); + + //删除旧的 + SceneApiInfoExample apiInfoExample = new SceneApiInfoExample(); + apiInfoExample.createCriteria().andSceneIdEqualTo(sceneInfo.getId()).andSerialLinkIdEqualTo(serialLink.getId()); + + //原接口id集 + List oldApiIds = sceneApiInfoMapper.selectByExample(apiInfoExample).stream().map(SceneApiInfo::getId).collect(Collectors.toList()); + oldApiIds.forEach(oldId -> { + if (!newApiIds.contains(oldId)) { + //删除 + sceneApiInfoMapper.deleteByPrimaryKey(oldId); + } + }); + + serialLinkDTO.getDubboApiInfoDTOList().forEach(dubboApiDTO -> { + if (dubboApiDTO.getApiID() != null) { + sceneApiService.updateDubboSceneApi(dubboApiDTO); + } else { + apisToBeAdded.add(dubboApiDTO); + } + }); + + if (apisToBeAdded.size() != 0) { + sceneApiService.newDubboSceneApis(apisToBeAdded, sceneInfo.getId(), serialLink.getId()); + } + } + }); + } else { + return Result.fail(CommonError.InvalidParamError); + } + //绑定数据集 + datasetService.bindDataSetsByScene(editSceneReq.getDatasetIds(), new HashSet<>(editSceneReq.getRefDatasetIds().values()), sceneInfo.getId()); + this.postOperationLog(editSceneReq, false, opUser); + } catch (Exception e) { + log.error("edit scene failed,error:{}", e.getMessage()); + throw e; + } + return Result.success(true); + } + + private void removeOldLinks(List oldLinkIds, EditSceneDTO editSceneDTO) { + List curLinkIds = editSceneDTO.getSerialLinkDTOs().stream(). + map(SerialLinkDTO::getSerialLinkID).filter(Objects::nonNull).collect(Collectors.toList()); + List idToBeRemoved = new ArrayList<>(); + + oldLinkIds.forEach(oldLinkId -> { + if (!curLinkIds.contains(oldLinkId)) { + idToBeRemoved.add(oldLinkId); + } + }); + if (idToBeRemoved.size() == 0) { + return; + } + //删除接口 + SceneApiInfoExample example = new SceneApiInfoExample(); + example.createCriteria().andSceneIdEqualTo(editSceneDTO.getId()).andSerialLinkIdIn(idToBeRemoved); + sceneApiInfoMapper.deleteByExample(example); + + //删除链路 + SerialLinkExample linkExample = new SerialLinkExample(); + linkExample.createCriteria().andIdIn(idToBeRemoved); + serialLinkMapper.deleteByExample(linkExample); + } + + @Override + public Result getSceneByID(Integer sceneID, boolean engine) { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(sceneID); + if (sceneInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + return Result.success(transferToDetailSceneDTO(sceneInfo, engine)); + } + + @Override + public Result> getSceneInfoByIds(List sceneIds) { + checkArgument(sceneIds != null && !sceneIds.isEmpty(), + "[SceneService]getSceneInfoByIds empty input"); + SceneInfoExample example = new SceneInfoExample(); + example.createCriteria().andIdIn(sceneIds); + return Result.success(sceneInfoMapper.selectByExample(example)); + } + + @Override + public Result getSceneList(GetSceneListReq req) { + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + if (req.getKeyword() == null) { + req.setKeyword(""); + } + SceneList sceneList = new SceneList(); + + int offset = (req.getPage() - 1) * req.getPageSize(); + + sceneList.setPage(req.getPage()); + sceneList.setPageSize(req.getPageSize()); + + SceneInfoExample totalExp = new SceneInfoExample(); + SceneInfoExample.Criteria totalExpCriteria = totalExp.createCriteria(); + SceneInfoExample sceneInfoExample = new SceneInfoExample(); + SceneInfoExample.Criteria sceneInfoCriteria = sceneInfoExample.createCriteria(); + + if (req.getKeyword() != null && !req.getKeyword().isEmpty()) { + sceneInfoExample.or(sceneInfoCriteria.andNameLike("%" + req.getKeyword() + "%")); + totalExp.or(totalExpCriteria.andNameLike("%" + req.getKeyword() + "%")); + + sceneInfoExample.or(sceneInfoExample.createCriteria().andCreatorLike("%" + req.getKeyword() + "%")); + totalExp.or(sceneInfoExample.createCriteria().andCreatorLike("%" + req.getKeyword() + "%")); + } + //场景状态 + if (req.getStatus() != null) { + sceneInfoCriteria.andSceneStatusEqualTo(req.getStatus()); + totalExpCriteria.andSceneStatusEqualTo(req.getStatus()); + } + + sceneInfoExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + List infoList = sceneInfoMapper.selectByExample(sceneInfoExample); + if (infoList == null || infoList.size() == 0) { + return Result.success(sceneList); + } + + List basicSceneDTOS = infoList.stream().map(this::transferToBasicSceneDTO).collect(Collectors.toList()); + + sceneList.setList(basicSceneDTOS); + sceneList.setTotal(sceneInfoMapper.countByExample(totalExp)); + + return Result.success(sceneList); + } + + @Override + public Result> getSceneListByIds(GetSceneListByIdsReq req) { + List sceneDTOList = new ArrayList<>(); + req.getSceneIdList().forEach(id -> sceneDTOList.add(getSceneByID(id, false).getData())); + return Result.success(sceneDTOList); + } + + @Override + public Result getSceneListByGroup(GetSceneGroupListReq req) { + + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + if (req.getKeyword() == null) { + req.setKeyword(""); + } + + int offset = (req.getPage() - 1) * req.getPageSize(); + + + SceneGroupList groupList = new SceneGroupList(); + groupList.setPage(req.getPage()); + groupList.setPageSize(req.getPageSize()); + + //总数 + SceneGroupExample totalExp = new SceneGroupExample(); + SceneGroupExample.Criteria totalExpCriteria = totalExp.createCriteria(); + + SceneGroupExample sceneGroupExample = new SceneGroupExample(); + SceneGroupExample.Criteria sceneGroupCriteria = sceneGroupExample.createCriteria(); + //租户筛选 +// if (req.getTenant() != null && !req.getTenant().equals(MiOne_Tenant)) { +// sceneGroupCriteria.andTenantEqualTo(req.getTenant()); +// totalExpCriteria.andTenantEqualTo(req.getTenant()); +// } + + if (req.getKeyword() != null) { + sceneGroupExample.or(sceneGroupCriteria.andCreatorLike("%" + req.getKeyword() + "%")); + sceneGroupExample.or(sceneGroupExample.createCriteria().andGroupNameLike("%" + req.getKeyword() + "%")); + totalExp.or(totalExpCriteria.andCreatorLike("%" + req.getKeyword() + "%")); + totalExp.or(totalExp.createCriteria().andGroupNameLike("%" + req.getKeyword() + "%")); + } + + sceneGroupExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + groupList.setTotal(sceneGroupMapper.countByExample(totalExp)); + + List groupInfoList = sceneGroupMapper.selectByExample(sceneGroupExample); + if (groupInfoList == null || groupInfoList.size() == 0) { + return Result.success(groupList); + } + + List list = new ArrayList<>(); + groupInfoList.forEach(groupInfo -> { + GroupSceneDTO groupSceneDTO = new GroupSceneDTO(); + groupSceneDTO.setSceneGroupID(groupInfo.getId()); + groupSceneDTO.setGroupName(groupInfo.getGroupName()); + groupSceneDTO.setGroupDesc(groupInfo.getGroupDesc()); + groupSceneDTO.setCtime(groupInfo.getCtime()); + + SceneInfoExample sceneInfoExample = new SceneInfoExample(); + sceneInfoExample.createCriteria().andSceneGroupIdEqualTo(groupInfo.getId()); + + List sceneInfos = sceneInfoMapper.selectByExample(sceneInfoExample); + groupSceneDTO.setList(sceneInfos.stream().map(this::transferToBasicSceneDTO).collect(Collectors.toList())); + + list.add(groupSceneDTO); + }); + groupList.setList(list); + return Result.success(groupList); + } + + @Override + public Result getSceneListByKeyword(GetSceneListReq req) { + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + if (req.getKeyword() == null) { + req.setKeyword(""); + } + SceneList sceneList = new SceneList(); + + int offset = (req.getPage() - 1) * req.getPageSize(); + + sceneList.setPage(req.getPage()); + sceneList.setPageSize(req.getPageSize()); + + SceneInfoExample totalExp = new SceneInfoExample(); + totalExp.createCriteria(); + + SceneInfoExample sceneInfoExample = new SceneInfoExample(); + sceneInfoExample.or(sceneInfoExample.createCriteria().andNameLike("%" + req.getKeyword() + "%")); + sceneInfoExample.or(sceneInfoExample.createCriteria().andCreatorLike("%" + req.getKeyword() + "%")); + + sceneInfoExample.or(sceneInfoExample.createCriteria().andSceneTypeEqualTo(req.getSceneType())); + + sceneInfoExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + List infoList = sceneInfoMapper.selectByExample(sceneInfoExample); + if (infoList == null || infoList.size() == 0) { + return Result.success(sceneList); + } + + List basicSceneDTOS = infoList.stream().map(this::transferToBasicSceneDTO).collect(Collectors.toList()); + + sceneList.setList(basicSceneDTOS); + sceneList.setTotal(sceneInfoMapper.countByExample(totalExp)); + + return Result.success(sceneList); + } + + public List getSerialLinksByIds(List serialIds) { + if (serialIds == null || serialIds.isEmpty()) { + return new ArrayList<>(); + } + SerialLinkExample example = new SerialLinkExample(); + example.createCriteria().andIdIn(serialIds); + List poList = this.serialLinkMapper.selectByExample(example); + + return poList.stream().map((po) -> SerialLinkDTO.builder() + .serialLinkID(po.getId()) + .serialLinkName(po.getName()) + .build()).collect(Collectors.toList()); + } + + private BasicSceneDTO transferToBasicSceneDTO(SceneInfo sceneInfo) { + BasicSceneDTO basicSceneDTO = new BasicSceneDTO(); + basicSceneDTO.setId(sceneInfo.getId()); + basicSceneDTO.setName(sceneInfo.getName()); + basicSceneDTO.setRemark(sceneInfo.getRemark()); + basicSceneDTO.setBenchTime(sceneInfo.getBenchTime()); + basicSceneDTO.setSceneType(sceneInfo.getSceneType()); + basicSceneDTO.setStatus(sceneInfo.getSceneStatus()); + basicSceneDTO.setCurReportId(sceneInfo.getCurReportId()); + basicSceneDTO.setRpsRate(sceneInfo.getRpsRate()); + basicSceneDTO.setCreator(sceneInfo.getCreator()); + basicSceneDTO.setUTime(sceneInfo.getUtime()); + basicSceneDTO.setCTime(sceneInfo.getCtime()); + return basicSceneDTO; + } + + private SceneDTO transferToDetailSceneDTO(SceneInfo sceneInfo, boolean engine) { + + SceneDTO sceneDTO = new SceneDTO(); + BeanUtils.copyProperties(sceneInfo, sceneDTO); + + sceneDTO.setGroupID(sceneInfo.getSceneGroupId()); + + sceneDTO.setRpsRate(sceneInfo.getRpsRate()); + sceneDTO.setId(sceneInfo.getId()); + sceneDTO.setSceneSource(sceneInfo.getSceneSource()); + sceneDTO.setCTime(sceneInfo.getCtime()); + sceneDTO.setUTime(sceneInfo.getUtime()); + sceneDTO.setCreator(sceneInfo.getCreator()); + sceneDTO.setUpdater(sceneInfo.getUpdator()); + sceneDTO.setBenchCount(sceneInfo.getBenchCount()); + sceneDTO.setApiNum(sceneInfo.getApinum()); + sceneDTO.setLastBenchTime(sceneInfo.getLastBenchTime()); + + BenchCalendar benchCalendar; + if (sceneInfo.getBenchCalendar() == null || sceneInfo.getBenchCalendar().isEmpty()) { + benchCalendar = new BenchCalendar(); + benchCalendar.setBenchDateList(new ArrayList<>()); + } else { + benchCalendar = gson.fromJson(sceneInfo.getBenchCalendar(), BenchCalendar.class); + } + List tmpList = new ArrayList<>(); + //过滤一年前的记录 + benchCalendar.getBenchDateList().forEach(benchDate -> { + if (System.currentTimeMillis() - benchDate.getTimestamp() <= ONE_YEAR_MS) { + tmpList.add(benchDate); + } + }); + benchCalendar.setBenchDateList(tmpList); + //压测日历 + sceneDTO.setBenchCalendar(benchCalendar); + + if (sceneInfo.getSla() == null || sceneInfo.getSla().equals("")) { + sceneDTO.setUseSla(0); + } else { + sceneDTO.setUseSla(1); + } + + //责任人 + if (sceneInfo.getPersonInCharge() != null) { + if (sceneInfo.getPersonInCharge().equals("")) { + sceneDTO.setPersonsInCharge(new ArrayList<>()); + } else { + sceneDTO.setPersonsInCharge(gson.fromJson(sceneInfo.getPersonInCharge(), new TypeToken>() { + }.getType())); + } + } + + //全局请求头 + if (sceneInfo.getGlobalHeader() != null) { + if (sceneInfo.getGlobalHeader().equals("")) { + sceneDTO.setGlobalHeaderList(new ArrayList<>()); + } else { + List globalHeaders = gson.fromJson(sceneInfo.getGlobalHeader(), new TypeToken>() { + }.getType()); + sceneDTO.setGlobalHeaderList(globalHeaders); + } + } + + //汽车部tsp鉴权消息 + if (sceneInfo.getGlobalTspAuth() != null) { + if (sceneInfo.getGlobalTspAuth().equals("")) { + sceneDTO.setGlobalTspAuth(new TspAuthInfo(false)); + } else { + TspAuthInfo globalTspAuth = gson.fromJson(sceneInfo.getGlobalTspAuth(), new TypeToken() { + }.getType()); + sceneDTO.setGlobalTspAuth(globalTspAuth); + } + } + + SerialLinkExample example = new SerialLinkExample(); + example.createCriteria().andSceneIdEqualTo(sceneInfo.getId()); + //该场景的串联链路集 + List serialLinkList = serialLinkMapper.selectByExample(example); + List serialLinkDTOS = new ArrayList<>(serialLinkList.size()); + + serialLinkList.forEach(serialLink -> { + SceneApiInfoExample example1 = new SceneApiInfoExample(); + example1.createCriteria().andSceneIdEqualTo(sceneInfo.getId()).andSerialLinkIdEqualTo(serialLink.getId()); + List apiInfoList = sceneApiInfoMapper.selectByExampleWithBLOBs(example1); + + //串联链路信息 + SerialLinkDTO serialLinkDTO = new SerialLinkDTO(); + serialLinkDTO.setSerialLinkID(serialLink.getId()); + serialLinkDTO.setSerialLinkName(serialLink.getName()); + serialLinkDTO.setEnable(serialLink.getEnable()); + //获取处理压测接口信息 + if (sceneInfo.getSceneType() == Constants.SCENE_TYPE_HTTP) { + List apiDTOList = new ArrayList<>(); + apiInfoList.forEach(api -> { + HttpApiInfoDTO httpApiInfoDTO = new HttpApiInfoDTO(); + BeanUtils.copyProperties(api, httpApiInfoDTO); + httpApiInfoDTO.setApiID(api.getId()); + httpApiInfoDTO.setApiProtocol(Constants.HTTP_API_TYPE); + httpApiInfoDTO.setApiRequestType(api.getRequestMethod()); + httpApiInfoDTO.setHeaderInfo(api.getApiHeader()); + if (api.getContentType() == null || api.getContentType().equals("")) { + //get + httpApiInfoDTO.setRequestInfo(api.getRequestParamInfo()); + } else if (api.getContentType().equals(Constants.CONTENT_TYPE_APP_FORM) || api.getContentType().equals(CONTENT_TYPE_APP_FORM2)) { + httpApiInfoDTO.setRequestInfo(api.getRequestParamInfo()); + } else if (api.getContentType().equals(CONTENT_TYPE_APP_JSON)) { + httpApiInfoDTO.setRequestInfoRaw(api.getRequestBody()); + } + //输出参数定义 + List outputParams = gson.fromJson(api.getOutputParamInfo(), new TypeToken>() { + }.getType()); + + httpApiInfoDTO.setOutputParamInfos(outputParams); + + + //汽车部tsp鉴权消息 + if (api.getApiTspAuth() != null) { + if (api.getApiTspAuth().equals("")) { + httpApiInfoDTO.setApiTspAuth(new TspAuthInfo(false)); + } else { + TspAuthInfo apiTspAuth = gson.fromJson(api.getApiTspAuth(), new TypeToken() { + }.getType()); + httpApiInfoDTO.setApiTspAuth(apiTspAuth); + } + } + + //接口是否使用录制流量的配置信息 + if (api.getApiTrafficInfo() != null) { + if (api.getApiTrafficInfo().equals("")) { + httpApiInfoDTO.setApiTrafficInfo(new ApiTrafficInfo(false)); + } else { + ApiTrafficInfo apiTrafficInfo = gson.fromJson(api.getApiTrafficInfo(), new TypeToken() { + }.getType()); + httpApiInfoDTO.setApiTrafficInfo(apiTrafficInfo); + } + } + + //接口是否启用x5鉴权 + if (api.getApiX5Info() != null) { + if (api.getApiX5Info().equals("")) { + httpApiInfoDTO.setApiX5Info(new ApiX5Info(false)); + } else { + ApiX5Info apiX5Info = gson.fromJson(api.getApiX5Info(), new TypeToken() { + }.getType()); + httpApiInfoDTO.setApiX5Info(apiX5Info); + } + } + + //检查点 + if (api.getCheckPoint() != null && !api.getCheckPoint().isEmpty()) { + List checkPointInfoList = gson.fromJson(api.getCheckPoint(), new TypeToken>() { + }.getType()); + + List checkPointInfoDTOs = new ArrayList<>(checkPointInfoList.size()); + + checkPointInfoList.forEach(checkPointInfo -> { + CheckPointInfoDTO checkPointInfoDTO = new CheckPointInfoDTO(); + BeanUtils.copyProperties(checkPointInfo, checkPointInfoDTO); + checkPointInfoDTOs.add(checkPointInfoDTO); + }); + httpApiInfoDTO.setCheckPointInfoList(checkPointInfoDTOs); + } + //过滤条件 + if (api.getFilterCondition() != null && !api.getFilterCondition().isEmpty()) { + List filterConditions = gson.fromJson(api.getFilterCondition(), new TypeToken>() { + }.getType()); + if (filterConditions != null) { + List filterConditionList = new ArrayList<>(filterConditions.size()); + filterConditions.forEach(filterCondition -> { + CheckPointInfoDTO checkPointInfoDTO = new CheckPointInfoDTO(); + BeanUtils.copyProperties(filterCondition, checkPointInfoDTO); + filterConditionList.add(checkPointInfoDTO); + }); + httpApiInfoDTO.setFilterCondition(filterConditionList); + } + } + apiDTOList.add(httpApiInfoDTO); + }); + + serialLinkDTO.setHttpApiInfoDTOList(apiDTOList.stream().sorted().collect(Collectors.toList())); + serialLinkDTOS.add(serialLinkDTO); + + } else if (sceneInfo.getSceneType() == SCENE_TYPE_DUBBO) { + List apiDTOList = new ArrayList<>(); + apiInfoList.forEach(api -> { + DubboApiInfoDTO dubboApiInfoDTO = new DubboApiInfoDTO(); + BeanUtils.copyProperties(api, dubboApiInfoDTO); + dubboApiInfoDTO.setApiID(api.getId()); + dubboApiInfoDTO.setApiProtocol(Constants.DUBBO_API_TYPE); + dubboApiInfoDTO.setGroup(api.getDubboGroup()); + dubboApiInfoDTO.setVersion(api.getDubboVersion()); + //dubbo接口的nacos环境 + if (api.getNacosType() == Constants.NACOS_TYPE_ST) { + dubboApiInfoDTO.setDubboEnv("staging"); + } else if (api.getNacosType() == Constants.NACOS_TYPE_OL) { + dubboApiInfoDTO.setDubboEnv("online"); + } + dubboApiInfoDTO.setAttachments(api.getApiHeader()); + + //参数类型列表 + List paramTypeList = gson.fromJson(api.getParamTypeList(), new TypeToken>() { + }.getType()); + dubboApiInfoDTO.setRequestParamTypeList(paramTypeList); + + //参数体 json + dubboApiInfoDTO.setRequestBody(api.getDubboParamJson()); + + //输出参数定义 + List outputParams = gson.fromJson(api.getOutputParamInfo(), new TypeToken>() { + }.getType()); + if (!engine) { + for (SceneApiOutputParam output : + outputParams) { + output.setParseExpr(output.getParseExpr().substring(DEFAULT_EXPR_PREX.length())); + } + } + dubboApiInfoDTO.setOutputParamInfos(outputParams); + //检查点 + if (api.getCheckPoint() != null && !api.getCheckPoint().isEmpty()) { + List checkPointInfoList = gson.fromJson(api.getCheckPoint(), new TypeToken>() { + }.getType()); + + List checkPointInfoDTOs = new ArrayList<>(checkPointInfoList.size()); + + checkPointInfoList.forEach(checkPointInfo -> { + CheckPointInfoDTO checkPointInfoDTO = new CheckPointInfoDTO(); + BeanUtils.copyProperties(checkPointInfo, checkPointInfoDTO); + checkPointInfoDTOs.add(checkPointInfoDTO); + }); + dubboApiInfoDTO.setCheckPointInfoList(checkPointInfoDTOs); + } + //过滤条件 + if (api.getFilterCondition() != null && !api.getFilterCondition().isEmpty()) { + List filterConditions = gson.fromJson(api.getFilterCondition(), new TypeToken>() { + }.getType()); + if (filterConditions != null) { + List filterConditionList = new ArrayList<>(filterConditions.size()); + + filterConditions.forEach(filterCondition -> { + CheckPointInfoDTO checkPointInfoDTO = new CheckPointInfoDTO(); + BeanUtils.copyProperties(filterCondition, checkPointInfoDTO); + filterConditionList.add(checkPointInfoDTO); + }); + dubboApiInfoDTO.setFilterCondition(filterConditionList); + } + } + + apiDTOList.add(dubboApiInfoDTO); + }); + serialLinkDTO.setDubboApiInfoDTOList(apiDTOList.stream().sorted().collect(Collectors.toList())); + serialLinkDTOS.add(serialLinkDTO); + } + }); + sceneDTO.setSerialLinkDTOs(serialLinkDTOS); + + //转换接口压测量信息 + List apiBenchInfoList = new ArrayList<>(); + if (Objects.nonNull(sceneInfo.getApiBenchInfos())) { + apiBenchInfoList = gson.fromJson(sceneInfo.getApiBenchInfos(), new TypeToken>() { + }.getType()); + } + sceneDTO.setApiBenchInfos(apiBenchInfoList); + + if (sceneInfo.getSla() != null) { + SlaDto slaDto = gson.fromJson(sceneInfo.getSla(), new TypeToken() { + }.getType()); + sceneDTO.setSlaDto(slaDto); + } + + if (sceneInfo.getAgentList() != null) { + List agentDTOList = gson.fromJson(sceneInfo.getAgentList(), new TypeToken>() { + }.getType()); + + sceneDTO.setAgentIdList(agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList())); + sceneDTO.setAgentDTOList(agentDTOList); + } else { + sceneDTO.setAgentDTOList(new ArrayList<>()); + } + + sceneDTO.setDatasetIds(datasetService.getDatasetIdsBySceneId(sceneInfo.getId())); + if (sceneInfo.getRefDatasetIds() != null) { + Map refDatasetIds = gson.fromJson(sceneInfo.getRefDatasetIds(), new TypeToken>() { + }.getType()); + sceneDTO.setRefDatasetIds(refDatasetIds); + } + return sceneDTO; + } + + @Override + public Result getSceneParamData(Integer sceneId) { + SceneParamData sceneParamData = new SceneParamData(); + sceneParamData.setParamDataType(Constants.SCENE_PARAM_DATA_TYPE_GLOBAL); + sceneParamData.setParamDataList(datasetService.getParamDataBySceneId(sceneId).getData()); + return Result.success(sceneParamData); + } + + private void postOperationLog(SceneDTO sceneDTO, boolean create, String opUser) { + String snapshotId = this.sceneSnapshotService.createSnapshot(SceneSnapshotBo.builder() + .sceneId((long) sceneDTO.getId()) + .type(SCENE_SNAPSHOT.typeCode) + .createBy(opUser) + .scene(gson.toJson(sceneDTO)) + .build()).getData(); + + OperationLogDto opRecord = new OperationLogDto(); + opRecord.setSceneId(sceneDTO.getId()); + opRecord.setCreateBy(opUser); + opRecord.setType(create ? NEW_OPERATION.typeCode : UPDATE_OPERATION.typeCode); + opRecord.setContent(create ? "创建场景" : "更新场景"); + + List supportOperations = new ArrayList<>(); + PerOperation perOperationViewSnapshot = new PerOperation(VIEW_SNAPSHOT.typeCname, VIEW_SNAPSHOT.typeName, snapshotId); + PerOperation perOperationCopySnapshot = new PerOperation(COPY_SNAPSHOT.typeCname, COPY_SNAPSHOT.typeName, snapshotId); + supportOperations.add(perOperationViewSnapshot); + supportOperations.add(perOperationCopySnapshot); + opRecord.setSupportOperation(supportOperations); + operationLogService.newOperationLog(opRecord); + } + + private Pair checkSceneParam(SceneDTO sceneDTO) { + if (sceneDTO.getRequestTimeout() == null) { + sceneDTO.setRequestTimeout(SCENE_REQ_TIMEOUT); + } + if (sceneDTO.getGroupID() == null) { + sceneDTO.setGroupID(Constants.DEFAULT_SCENE_GROUP); + } + if (sceneDTO.getSceneEnv() == null) { + return Pair.of(-1, "场景环境必传"); + } + if (sceneDTO.getSceneType() == null) { + return Pair.of(-1, "场景类型必传"); + } + if (sceneDTO.getLogRate() == null) { + return Pair.of(-1, "日志采样率必传"); + } +// if (sceneDTO.getLogRate() >= 100) { +// return Pair.of(-1, "日志采样率不能超过100"); +// } + if (sceneDTO.getBenchTime() == null) { + return Pair.of(-1, "施压时间必传"); + } + if (sceneDTO.getIncreasePercent() == null) { + //默认值 + sceneDTO.setIncreasePercent(0); + } + return Pair.of(0, "success"); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneSnapshotServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneSnapshotServiceImpl.java new file mode 100644 index 000000000..21eaf60ca --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SceneSnapshotServiceImpl.java @@ -0,0 +1,120 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.google.gson.Gson; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.SceneNameDTO; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.SceneSnapshotBo; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.SceneSnapshotMapper; +import run.mone.mimeter.dashboard.pojo.SceneSnapshot; +import run.mone.mimeter.dashboard.pojo.SceneSnapshotExample; +import run.mone.mimeter.dashboard.service.SceneSnapshotService; +import run.mone.mimeter.dashboard.common.util.Utility; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static com.google.common.base.Preconditions.checkArgument; +import static run.mone.mimeter.dashboard.bo.snapshot.SnapshotTypeEnum.SCENE_SNAPSHOT; + +/** + * @author Xirui Yang (yangxirui@xiaomi.com) + * @version 1.0 + * @since 2022/6/23 + */ +@Slf4j +@Service +public class SceneSnapshotServiceImpl implements SceneSnapshotService { + + @Autowired + private SceneSnapshotMapper sceneSnapshotMapper; + + private static final Gson gson = Util.getGson(); + + @Override + public Result getSceneSnapshotById(String snapshotId) { + SceneSnapshotExample example = new SceneSnapshotExample(); + SceneSnapshotExample.Criteria criteria = example.createCriteria(); + criteria.andSnapshotIdEqualTo(snapshotId); + return this.getSceneSnapshotByExample(example, true); + } + + private Result getSceneSnapshotByExample(SceneSnapshotExample example, boolean withBlob) { + List list = withBlob ? this.sceneSnapshotMapper.selectByExampleWithBLOBs(example) : + this.sceneSnapshotMapper.selectByExample(example); + + if (list.isEmpty()) { + return Result.success(null); + } + SceneSnapshotBo bo = new SceneSnapshotBo(); + BeanUtils.copyProperties(list.get(0), bo); + return Result.success(bo); + } + + @Override + public Result getSceneSnapshotByScene(Long sceneId) { + return this.doGetSceneSnapshotByScene(sceneId, SCENE_SNAPSHOT.typeCode, false); + } + + private Result doGetSceneSnapshotByScene(Long sceneId, int type, boolean withBlob) { + SceneSnapshotExample example = new SceneSnapshotExample(); + SceneSnapshotExample.Criteria criteria = example.createCriteria(); + criteria.andSceneIdEqualTo(sceneId); +// criteria.andTypeEqualTo(type); + example.setOrderByClause("id desc"); + example.setLimit(1); + return this.getSceneSnapshotByExample(example, withBlob); + } + + @Override + public Result getSceneSnapshotDetailByScene(Long sceneId) { + return this.doGetSceneSnapshotByScene(sceneId, SCENE_SNAPSHOT.typeCode, true); + } + + @Override + public Result createSnapshot(SceneSnapshotBo bo) { + String logPrefix = "[SceneSnapshotService]"; + checkArgument(bo != null && bo.checkCreate(), logPrefix + "createSnapshot invalid input: " + new Gson().toJson(bo)); + Result oldResult = getSceneSnapshotByScene(bo.getSceneId()); + int version = 1; + + if (oldResult.getData() != null) { + version += Optional.ofNullable(oldResult.getData().getVersion()).orElse(0); + } + + String snapshotId = Utility.saltVersionedId(bo.getSceneId(), version); + bo.setSnapshotId(snapshotId); + bo.setMd5(Utility.generateSha256(bo.getScene())); + bo.setVersion(version); + + SceneSnapshot po = new SceneSnapshot(); + BeanUtils.copyProperties(bo, po); + + if (this.sceneSnapshotMapper.insertSelective(po) > 0) { + return Result.success(snapshotId); + } + return Result.fail(CommonError.UnknownError); + } + + public Map sceneNameMapFromIds(List snapshotIds) { + SceneSnapshotExample example = new SceneSnapshotExample(); + example.createCriteria().andSnapshotIdIn(snapshotIds); + List snapshotList = this.sceneSnapshotMapper.selectByExampleWithBLOBs(example); + Map sceneNameMap = new HashMap<>(); + + if (snapshotList != null) { + snapshotList.forEach(snapshot -> { + SceneNameDTO nameDTO = gson.fromJson(snapshot.getScene(), SceneNameDTO.class); + sceneNameMap.putIfAbsent(Math.toIntExact(snapshot.getSceneId()), nameDTO.getName()); + }); + } + return sceneNameMap; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SlaServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SlaServiceImpl.java new file mode 100644 index 000000000..35344914e --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/SlaServiceImpl.java @@ -0,0 +1,210 @@ +package run.mone.mimeter.dashboard.service.impl; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.sla.GetSlaListReq; +import run.mone.mimeter.dashboard.bo.sla.SlaDto; +import run.mone.mimeter.dashboard.bo.sla.SlaList; +import run.mone.mimeter.dashboard.bo.sla.SlaRuleDto; +import run.mone.mimeter.dashboard.mapper.SlaMapper; +import run.mone.mimeter.dashboard.mapper.SlaRuleMapper; +import run.mone.mimeter.dashboard.service.SceneService; +import run.mone.mimeter.dashboard.service.SlaService; +import run.mone.mimeter.dashboard.pojo.Sla; +import run.mone.mimeter.dashboard.pojo.SlaExample; +import run.mone.mimeter.dashboard.pojo.SlaRule; +import run.mone.mimeter.dashboard.pojo.SlaRuleExample; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.DEFAULT_PAGE_SIZE; +import static run.mone.mimeter.dashboard.exception.CommonError.SlaRuleAtLeastOneError; + +@Service +public class SlaServiceImpl implements SlaService { + + @Autowired + SlaMapper slaMapper; + + @Autowired + SlaRuleMapper slaRuleMapper; + + @Autowired + private SceneService sceneService; + + @Override + public Result newSla(SlaDto param) { + Pair checkRes = checkParam(param); + if (checkRes.getKey() != 0) { + return Result.fail(checkRes.getKey(), checkRes.getValue()); + } + + Sla sla = toSla(param); + slaMapper.insert(sla); + List slaRules = toSlaRule(sla.getId(), param.getSlaRuleDtos()); + slaRuleMapper.batchInsert(slaRules); + return Result.success(sla.getId()); + } + + @Override + public Result updateSla(SlaDto param) { + Pair checkRes = checkParam(param); + if (checkRes.getKey() != 0) { + return Result.fail(checkRes.getKey(), checkRes.getValue()); + } + + int slaId = param.getId(); + Sla sla = toSla(param); + sla.setId(slaId); + slaMapper.updateByPrimaryKey(sla); + SlaRuleExample slaRuleExample = new SlaRuleExample(); + slaRuleExample.createCriteria().andSlaIdEqualTo(slaId); + slaRuleMapper.deleteByExample(slaRuleExample); + List slaRules = toSlaRule(slaId, param.getSlaRuleDtos()); + slaRuleMapper.batchInsert(slaRules); + return Result.success(true); + } + + @Override + public Result getSlaList(GetSlaListReq req) { + + if (req.getPage() <= 0) { + req.setPage(1); + } + if (req.getPageSize() <= 0) { + req.setPageSize(DEFAULT_PAGE_SIZE); + } + int offset = (req.getPage() - 1) * req.getPageSize(); + + SlaExample totalSlaExample = new SlaExample(); + SlaExample.Criteria totalCriteria = totalSlaExample.createCriteria(); + SlaExample slaExample = new SlaExample(); + SlaExample.Criteria criteria = slaExample.createCriteria(); + + if (StringUtils.isNotEmpty(req.getSlaName())) { + totalCriteria.andNameLike("%" + req.getSlaName() + "%"); + criteria.andNameLike("%" + req.getSlaName() + "%"); + } + if (StringUtils.isNotEmpty(req.getCreator())) { + totalCriteria.andCreatorLike("%" + req.getCreator() + "%"); + criteria.andCreatorLike("%" + req.getCreator() + "%"); + } + + slaExample.setOrderByClause("id desc limit " + req.getPageSize() + " offset " + offset); + + SlaList slaList = new SlaList(); + slaList.setPage(req.getPage()); + slaList.setPageSize(req.getPageSize()); + List slas = slaMapper.selectByExample(slaExample); + if (slas == null || slas.size() == 0) { + return Result.success(slaList); + } + List slaDtos = slas.stream().map(it -> { + SlaDto slaDto = toSlaDto(it); + SlaRuleExample slaRuleExample = new SlaRuleExample(); + slaRuleExample.createCriteria().andSlaIdEqualTo(it.getId()); + List slaRuleDtos = toSlaRuleDto(slaRuleMapper.selectByExample(slaRuleExample)); + slaDto.setSlaRuleDtos(slaRuleDtos); + return slaDto; + }).collect(Collectors.toList()); + slaList.setList(slaDtos); + slaList.setTotal(slaMapper.countByExample(totalSlaExample)); + + return Result.success(slaList); + } + + @Override + public Result getSlaById(int id) { + Sla sla = slaMapper.selectByPrimaryKey(id); + SlaDto slaDto = toSlaDto(sla); + SlaRuleExample slaRuleExample = new SlaRuleExample(); + slaRuleExample.createCriteria().andSlaIdEqualTo(id); + List slaRules = slaRuleMapper.selectByExample(slaRuleExample); + List slaRuleDtos = toSlaRuleDto(slaRules); + slaDto.setSlaRuleDtos(slaRuleDtos); + return Result.success(slaDto); + } + + @Override + public Result delSla(int id) { + slaMapper.deleteByPrimaryKey(id); + return Result.success(true); + } + + @Override + public Result multiDelSla(List ids) { + SlaExample slaExample = new SlaExample(); + slaExample.createCriteria().andIdIn(ids); + slaMapper.deleteByExample(slaExample); + return Result.success(true); + } + + private Sla toSla(SlaDto param) { + Sla sla = new Sla(); + BeanUtils.copyProperties(param, sla); + long now = System.currentTimeMillis(); + if (sla.getCtime() == null || sla.getCtime() == 0) { + sla.setCtime(now); + } + sla.setUtime(now); + return sla; + } + + private SlaDto toSlaDto(Sla sla) { + SlaDto slaDto = new SlaDto(); + BeanUtils.copyProperties(sla, slaDto); + return slaDto; + } + + private List toSlaRule(int id, List slaRuleDtoList) { + if (slaRuleDtoList == null || slaRuleDtoList.size() == 0) { + return new ArrayList<>(); + } + long now = System.currentTimeMillis(); + List slaRules = slaRuleDtoList.stream().map(it -> { + SlaRule slaRule = new SlaRule(); + BeanUtils.copyProperties(it, slaRule); + slaRule.setCtime(now); + slaRule.setSlaId(id); + slaRule.setUtime(now); + slaRule.setCompareValue(it.getValue()); + slaRule.setActionLevel(it.getAction()); + slaRule.setCompareCondition(it.getCondition()); + return slaRule; + }).collect(Collectors.toList()); + + return slaRules; + } + + private List toSlaRuleDto(List slaRuleList) { + if (slaRuleList == null || slaRuleList.size() == 0) { + return new ArrayList<>(); + } + List slaRuleDtos = slaRuleList.stream().map(it -> { + SlaRuleDto slaRuleDto = new SlaRuleDto(); + BeanUtils.copyProperties(it, slaRuleDto); + slaRuleDto.setValue(it.getCompareValue()); + slaRuleDto.setAction(it.getActionLevel()); + slaRuleDto.setCondition(it.getCompareCondition()); + return slaRuleDto; + }).collect(Collectors.toList()); + + return slaRuleDtos; + } + + private Pair checkParam(SlaDto param) { + List slaRuleDtos = param.getSlaRuleDtos(); + if (slaRuleDtos == null || slaRuleDtos.size() == 0) { + return Pair.of(SlaRuleAtLeastOneError.code, SlaRuleAtLeastOneError.message); + } + + return Pair.of(0, "success"); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/TaskServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/TaskServiceImpl.java new file mode 100644 index 000000000..f384ac80d --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/TaskServiceImpl.java @@ -0,0 +1,782 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import run.mone.mimeter.dashboard.bo.ChangeQpsReq; +import run.mone.mimeter.dashboard.bo.DubboSceneDebugResult; +import run.mone.mimeter.dashboard.bo.HttpSceneDebugResult; +import run.mone.mimeter.dashboard.bo.SubmitTaskRes; +import run.mone.mimeter.dashboard.bo.common.Constants; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.operationlog.OperationLogDto; +import run.mone.mimeter.dashboard.bo.operationlog.PerOperation; +import run.mone.mimeter.dashboard.bo.report.ReportInfoBo; +import run.mone.mimeter.dashboard.bo.scene.*; +import run.mone.mimeter.dashboard.bo.sceneapi.ApiHeader; +import run.mone.mimeter.dashboard.bo.sceneapi.FormParamValue; +import run.mone.mimeter.dashboard.bo.task.*; +import run.mone.mimeter.dashboard.common.*; +import run.mone.mimeter.dashboard.common.util.BizUtils; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.*; +import run.mone.mimeter.dashboard.pojo.*; +import run.mone.mimeter.dashboard.service.*; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static run.mone.mimeter.dashboard.bo.common.Constants.*; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationLogTypeEnum.DEBUG_OPERATION; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationLogTypeEnum.START_BENCH; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationTypeEnum.DEBUG_RECORD; +import static run.mone.mimeter.dashboard.bo.operationlog.OperationTypeEnum.VIEW_REPORT; +import static run.mone.mimeter.dashboard.bo.snapshot.SnapshotTypeEnum.DEBUG_SNAPSHOT; +import static run.mone.mimeter.dashboard.common.util.Utility.generateId; + +@Service +@Slf4j +public class TaskServiceImpl implements TaskService { + + private final String logPrefix = "[TaskService]"; + + @Autowired + private SceneService sceneService; + + @Autowired + private FeiShuService feiShuService; + + @Autowired + private SceneInfoMapper sceneInfoMapper; + + @Autowired + private MibenchTaskMapper mibenchTaskMapper; + + @Autowired + private SceneApiInfoMapper sceneApiInfoMapper; + + @Autowired + private SerialLinkMapper serialLinkMapper; + + @Autowired + private ReportInfoService reportInfoService; + + @Autowired + private ReportInfoMapper reportInfoMapper; + + @Autowired + private ReportEmitterService reportEmitterService; + + @Autowired + private OperationLogService operationLogService; + + @Autowired + private SceneSnapshotService sceneSnapshotService; + + @Autowired + private HttpDao httpDao; + + private static final Pattern EL_PATTERN = Pattern.compile("\\{([^}]*)}"); + + /** + * bench manager addr + */ + @NacosValue(autoRefreshed = true, value = "${bench.api_manager_url}") + private String apiSvrUrl; + + /** + * bench allow switch + * 发布时可控制不允许压测 + */ + @NacosValue(autoRefreshed = true, value = "${bench.allow.switch}") + private String benchAllowSwitch; + + private static final Gson gson = Util.getGson(); + + private final ExecutorService executorService = Executors.newSingleThreadExecutor(); + + @Override + public Result submitTask(TaskDTO taskDTO, String opUser) { + + if (!benchAllowSwitch.equalsIgnoreCase("true")){ + return Result.fail(CommonError.SystemDeployingError); + } + String reportId = ""; + if (taskDTO.getSubmitTaskType() != SINGLE_API_DEBUG) { + reportId = generateId((long) taskDTO.getSceneId()); + } + Pair checkRes = checkSubmitTaskParam(taskDTO, reportId); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + HttpResult result; + + try { + result = httpDao.post(apiSvrUrl + "/submit/task", gson.toJson(taskDTO)); + } catch (Exception e) { + log.error("[TaskService.submitTask] failed to submit task, msg: {}", e.getMessage(), e); + return Result.fail(CommonError.APIServerError); + } + if (result == null) { + log.error("[TaskService.submitTask] failed to get result from api server, param: {}", taskDTO); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + SubmitTaskRes res = gson.fromJson(result.getData(), SubmitTaskRes.class); + if (taskDTO.getSubmitTaskType() == SCENE_BENCH) { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(taskDTO.getSceneId()); + if (sceneInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + + this.reportInfoService.createReport(ReportInfoBo.builder() + .sceneId((long) taskDTO.getSceneId()) + .reportId(reportId) + .reportName(genReportName(sceneInfo.getName(), String.valueOf(sceneInfo.getRpsRate()))) + .createBy(opUser) + .tenant(taskDTO.getTenant()) + .status(REPORT_STATUS_RUNNING) + .agents(gson.toJson(res.getAgentIpList())) + .linkToDagId(gson.toJson(res.getLinkTaskIdMap())) + .build()); + + //更新场景当前报告id + sceneInfo.setCurReportId(reportId); + //压测次数+1 + sceneInfo.setBenchCount(sceneInfo.getBenchCount() + 1); + //最近一次压测时间 + long now = System.currentTimeMillis(); + sceneInfo.setLastBenchTime(now); + + //记录压测日历 + recordBenchCalendar(sceneInfo, now); + sceneInfoMapper.updateByPrimaryKeyWithBLOBs(sceneInfo); + + String finalReportId = reportId; + //通知负责人 + CompletableFuture.runAsync(() -> notifyPersonsInCharge(sceneInfo, finalReportId, opUser), executorService); + + this.postOperationLog(taskDTO.getSceneId(), SCENE_BENCH, reportId, "", opUser); + } + return Result.success(res); + } else { + log.error("[TaskService.submitTask], failed and result is: {}", result); + return Result.fail(result.getCode(), result.getMessage()); + } + } + + @Override + public Result stopTask(Integer type, TaskDTO taskDTO, String opUser) { + taskDTO.setOpUser(opUser); + Pair checkRes = checkStopTaskParam(type, taskDTO); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + HttpResult result; + try { + List taskIds; + if (type == 1) { + //场景id + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(taskDTO.getSceneId()); + if (sceneInfo == null) { + return Result.fail(CommonError.InvalidParamError.code, "场景不存在"); + } + if (sceneInfo.getSceneStatus() != TaskStatus.Running.code) { + return Result.fail(CommonError.InvalidParamError.code, "场景不在运行状态"); + } + if (sceneInfo.getCurReportId() == null) { + return Result.fail(CommonError.InvalidParamError.code, "任务不存在"); + } + taskDTO.setReportId(sceneInfo.getCurReportId()); + } + //报告id + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andReportIdEqualTo(taskDTO.getReportId()).andTaskTypeEqualTo(TaskType.dag.code); + List MibenchTasks = mibenchTaskMapper.selectByExample(example); + + //fix temp + MibenchTasks.forEach(MibenchTask -> { + MibenchTask.setState(TaskStatus.STOPPED.code); + mibenchTaskMapper.updateByPrimaryKey(MibenchTask); + }); + + taskIds = MibenchTasks.stream().map(MibenchTask::getId).collect(Collectors.toList()); + taskDTO.setIds(taskIds); + + ReportInfoExample reportInfoExample = new ReportInfoExample(); + reportInfoExample.createCriteria().andReportIdEqualTo(taskDTO.getReportId()); + ReportInfo reportInfo = reportInfoMapper.selectByExample(reportInfoExample).get(0); + taskDTO.setSceneId(Math.toIntExact(reportInfo.getSceneId())); + + //直接更新为结束状态 + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(Math.toIntExact(reportInfo.getSceneId())); + sceneInfo.setSceneStatus(TaskStatus.STOPPED.code); + sceneInfoMapper.updateByPrimaryKey(sceneInfo); + + if (taskDTO.getIds().size() == 0) { + return Result.success(true); + } + result = httpDao.post(apiSvrUrl + "/cancel/task", gson.toJson(taskDTO)); + } catch (Exception e) { + return Result.fail(CommonError.APIServerError); + } + if (result == null) { + log.error("[TaskService.stopTask] failed to get result from api server, param: {}", taskDTO); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + return Result.success(true); + } else { + log.error("[TaskService.stopTask], failed and result is: {}", result); + return Result.fail(result.getCode(), result.getMessage()); + } + } + + @Override + public Result manualUpdateRps(ChangeQpsReq req) { + HttpResult result; + if (req == null || req.getDagTaskRpsList() == null) { + return Result.fail(CommonError.InvalidParamError); + } + try { + result = httpDao.post(apiSvrUrl + "/task/manualUpdateQps", gson.toJson(req)); + } catch (Exception e) { + return Result.fail(CommonError.APIServerError); + } + if (result == null) { + log.error("[TaskService.manualUpdateRps] failed to get result from api server, param: {}", req); + return Result.fail(CommonError.APIServerError); + } + if (result.getCode() == 200) { + return Result.success(true); + } else { + log.error("[TaskService.manualUpdateRps], failed and result is: {}", result); + return Result.fail(result.getCode(), result.getMessage()); + } + } + + @Override + public Result manualUpdateSceneRpsRate(SceneRpsRateReq req) { + log.info("manualUpdateSceneRpsRate sceneRpsRateReq:{}", req); + Pair checkRes = checkUpdateSceneRateParam(req); + if (checkRes.getKey() != 0) { + return Result.fail(CommonError.InvalidParamError.code, checkRes.getValue()); + } + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(req.getSceneID()); + if (sceneInfo == null) { + return Result.fail(CommonError.InvalidParamError); + } + ChangeQpsReq changeQpsReq = new ChangeQpsReq(); + changeQpsReq.setRpsRate(req.getRpsRate()); + List dagTaskRpsList = new ArrayList<>(); + changeQpsReq.setDagTaskRpsList(dagTaskRpsList); + //转换接口压测量信息 + Map linkMaps = new HashMap<>(); + SerialLinkExample example = new SerialLinkExample(); + example.createCriteria().andSceneIdEqualTo(req.getSceneID()); + + //该场景的串联链路集 + List serialLinkList = serialLinkMapper.selectByExample(example); + serialLinkList.forEach(serialLink -> { + if (serialLink.getEnable()) { + linkMaps.putIfAbsent(serialLink.getName(), new LinkRpsInfo(serialLink.getId())); + } + }); + + List apiBenchInfoList = new ArrayList<>(); + if (Objects.nonNull(sceneInfo.getApiBenchInfos())) { + apiBenchInfoList = gson.fromJson(sceneInfo.getApiBenchInfos(), new TypeToken>() { + }.getType()); + } + //最大链路rps + apiBenchInfoList.forEach(apiBenchInfo -> { + if (linkMaps.containsKey(apiBenchInfo.getSerialName())) { + linkMaps.get(apiBenchInfo.getSerialName()).setRps(apiBenchInfo.getLinkTps()); + } + }); + //变更所有任务 rps 量级请求 + linkMaps.values().forEach(linkRpsInfo -> { + Integer taskId = req.getLinkToTaskMaps().get(linkRpsInfo.getLinkId()); + if (taskId != null) { + int curRps = (int) Math.ceil(linkRpsInfo.getRps() * (req.getRpsRate() / 100d)); + dagTaskRpsList.add(new DagTaskRps(linkRpsInfo.getLinkId(), taskId, curRps)); + } + }); + log.debug("manualUpdateSceneRpsRate changeQpsReq:{}", changeQpsReq); + if (this.manualUpdateRps(changeQpsReq).getData()) { + //更新报告名 + log.debug("manualUpdateSceneRpsRate changeQpsReq:{}", changeQpsReq); + CompletableFuture.runAsync(() -> { + ReportInfoExample reportInfoExample = new ReportInfoExample(); + reportInfoExample.createCriteria().andReportIdEqualTo(req.getReportID()); + ReportInfo reportInfo = reportInfoMapper.selectByExample(reportInfoExample).get(0); + String curName = reportInfo.getReportName().split("——", 2)[0] + req.getRpsRate() + "%"; + reportInfo.setReportName(curName); + reportInfoMapper.updateByPrimaryKey(reportInfo); + }); + return Result.success(true); + } + return Result.fail(CommonError.InvalidParamError); + } + + @Override + public Result>> getHttpSceneDebugResultByTaskId(String reportId, String opUser) { + if (reportId == null || reportId.isEmpty()) { + return Result.fail(CommonError.InvalidParamError); + } + MibenchTaskExample exp = new MibenchTaskExample(); + exp.createCriteria().andReportIdEqualTo(reportId); + List MibenchTasks = mibenchTaskMapper.selectByExample(exp); + List taskIds = MibenchTasks.stream().map(MibenchTask::getId).collect(Collectors.toList()); + + AtomicBoolean record = new AtomicBoolean(true); + TreeMap> resultMap = new TreeMap<>(); + + taskIds.forEach(taskId -> { + final String[] serialLinkName = {""}; + List resultList = new ArrayList<>(); + + MibenchTask dagTag = mibenchTaskMapper.selectByPrimaryKey(taskId); + + HttpSceneDebugResult dagTaskResult = new HttpSceneDebugResult(); + dagTaskResult.setParentTask(true); + dagTaskResult.setSceneId(dagTag.getSceneId()); + dagTaskResult.setTaskStatus(dagTag.getState()); + resultList.add(dagTaskResult); + + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andParentTaskIdEqualTo(taskId); + List childTasks = mibenchTaskMapper.selectByExampleWithBLOBs(example); + + childTasks.forEach(childTask -> { + HttpSceneDebugResult childResult = new HttpSceneDebugResult(); + SceneApiInfo httpApi = sceneApiInfoMapper.selectByPrimaryKey(childTask.getSceneApiId()); + if (serialLinkName[0].isEmpty()) { + SerialLink serialLink = serialLinkMapper.selectByPrimaryKey(httpApi.getSerialLinkId()); + serialLinkName[0] = serialLink.getName(); + } + BeanUtils.copyProperties(httpApi, childResult); + childResult.setTaskStatus(childTask.getState()); + if (childTask.getState() != TaskStatus.Success.code) { + record.set(false); + } + if (childTask.getDebugUrl() != null && !childTask.getDebugUrl().isEmpty()){ + childResult.setApiUrl(childTask.getDebugUrl()); + } + childResult.setApiOrder(httpApi.getApiOrder()); + childResult.setParentTask(false); + if (childTask.getReqParamType() != null) { + childResult.setReqParamType(childTask.getReqParamType()); + } + if (childTask.getRequestParams() != null && !childTask.getRequestParams().isEmpty()) { + childResult.setRealParam(childTask.getRequestParams()); + } + if (childTask.getDebugResultHeader() != null) { + childResult.setRespHeader(childTask.getDebugResultHeader()); + } + if (childTask.getDebugReqHeaders() != null) { + List apiHeaders = new ArrayList<>(); + Map reqHeaders = gson.fromJson(childTask.getDebugReqHeaders(), new TypeToken>() { + }.getType()); + reqHeaders.forEach((k, v) -> apiHeaders.add(new ApiHeader(k, v))); + childResult.setApiHeader(gson.toJson(apiHeaders)); + } + if (childTask.getDebugTriggerCp() != null) { + childResult.setTriggerCpInfo(childTask.getDebugTriggerCp()); + } + if (childTask.getDebugTriggerFilterCondition() != null) { + childResult.setDebugTriggerFilterCondition(childTask.getDebugTriggerFilterCondition()); + } + childResult.setOk(childTask.getOk()); + childResult.setDebugResult(childTask.getDebugResult()); + childResult.setRt(childTask.getDebugRt()); + childResult.setSize(childTask.getDebugSize()); + resultList.add(childResult); + }); + resultMap.put(serialLinkName[0], resultList); + }); + + if (MibenchTasks.size() > 0 && record.get()) { + this.postOperationLog(MibenchTasks.get(0).getSceneId(), SCENE_DEBUG, reportId, gson.toJson(resultMap), opUser); + } + + return Result.success(resultMap); + } + + @Override + public Result>> getDubboSceneDebugResultByTaskId(String reportId, String opUser) { + if (reportId == null || reportId.isEmpty()) { + return Result.fail(CommonError.InvalidParamError); + } + AtomicBoolean record = new AtomicBoolean(true); + + MibenchTaskExample exp = new MibenchTaskExample(); + exp.createCriteria().andReportIdEqualTo(reportId); + List MibenchTasks = mibenchTaskMapper.selectByExample(exp); + List taskIds = MibenchTasks.stream().map(MibenchTask::getId).collect(Collectors.toList()); + + TreeMap> resultMap = new TreeMap<>(); + + taskIds.forEach(taskId -> { + final String[] serialLinkName = {""}; + List resultList = new ArrayList<>(); + + MibenchTask dagTag = mibenchTaskMapper.selectByPrimaryKey(taskId); + + DubboSceneDebugResult dagTaskResult = new DubboSceneDebugResult(); + dagTaskResult.setParentTask(true); + dagTaskResult.setSceneId(dagTag.getSceneId()); + dagTaskResult.setTaskStatus(dagTag.getState()); + resultList.add(dagTaskResult); + + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andParentTaskIdEqualTo(taskId); + List childTasks = mibenchTaskMapper.selectByExampleWithBLOBs(example); + + childTasks.forEach(childTask -> { + DubboSceneDebugResult childResult = new DubboSceneDebugResult(); + SceneApiInfo dubboApi = sceneApiInfoMapper.selectByPrimaryKey(childTask.getSceneApiId()); + if (serialLinkName[0].isEmpty()) { + SerialLink serialLink = serialLinkMapper.selectByPrimaryKey(dubboApi.getSerialLinkId()); + serialLinkName[0] = serialLink.getName(); + } + BeanUtils.copyProperties(dubboApi, childResult); + childResult.setServiceName(dubboApi.getServiceName()); + childResult.setMethodName(dubboApi.getMethodName()); + childResult.setGroup(dubboApi.getDubboGroup()); + childResult.setVersion(dubboApi.getDubboVersion()); + + childResult.setTaskStatus(childTask.getState()); + if (childTask.getState() != TaskStatus.Success.code) { + record.set(false); + } + childResult.setApiOrder(dubboApi.getApiOrder()); + childResult.setParentTask(false); + if (dubboApi.getParamTypeList() != null) { + childResult.setParamsTypeList(dubboApi.getParamTypeList()); + } + if (childTask.getRequestParams() != null && !childTask.getRequestParams().isEmpty()) { + childResult.setRealParam(childTask.getRequestParams()); + } + if (childTask.getDebugTriggerCp() != null) { + childResult.setTriggerCpInfo(childTask.getDebugTriggerCp()); + } + if (childTask.getDebugTriggerFilterCondition() != null) { + childResult.setDebugTriggerFilterCondition(childTask.getDebugTriggerFilterCondition()); + } + childResult.setOk(childTask.getOk()); + childResult.setDebugResult(childTask.getDebugResult()); + childResult.setRt(childTask.getDebugRt()); + childResult.setSize(childTask.getDebugSize()); + resultList.add(childResult); + }); + resultMap.put(serialLinkName[0], resultList); + }); + + if (MibenchTasks.size() > 0 && record.get()) { + this.postOperationLog(MibenchTasks.get(0).getSceneId(), SCENE_DEBUG, reportId, gson.toJson(resultMap), opUser); + } + + return Result.success(resultMap); + } + + @Override + public SseEmitter stream(String reportId, String username) { + return this.reportEmitterService.connect(reportId, username); + } + + private void postOperationLog(Integer sceneId, int type, String reportId, String snapshotRes, String opUser) { + try { + OperationLogDto opRecord = new OperationLogDto(); + opRecord.setSceneId(sceneId); + opRecord.setCreateBy(opUser); + List supportOperations = new ArrayList<>(); + opRecord.setSupportOperation(supportOperations); + + if (type == SCENE_DEBUG) { + String snapshotId = this.sceneSnapshotService.createSnapshot(SceneSnapshotBo.builder() + .sceneId((long) sceneId) + .type(DEBUG_SNAPSHOT.typeCode) + .createBy(opUser) + .scene(snapshotRes) + .build()).getData(); + opRecord.setType(DEBUG_OPERATION.typeCode); + opRecord.setContent("调试场景"); + opRecord.setReportId(reportId); + PerOperation perOperationDebugRecord = new PerOperation(DEBUG_RECORD.typeCname, DEBUG_RECORD.typeName, snapshotId); + supportOperations.add(perOperationDebugRecord); + } else if (type == SCENE_BENCH) { + opRecord.setType(START_BENCH.typeCode); + opRecord.setContent("启动压测"); + PerOperation perOperationViewReport = new PerOperation(VIEW_REPORT.typeCname, VIEW_REPORT.typeName, reportId); + supportOperations.add(perOperationViewReport); + } + operationLogService.newOperationLog(opRecord); + } catch (Exception e) { + log.error("TaskServiceImpl.postOperationLog, error msg: {}", e.getMessage(), e); + } + } + + /** + * 通知负责人 + */ + private void notifyPersonsInCharge(SceneInfo sceneInfo, String reportId, String opUser) { + //场景负责人 + List personsInCharge = gson.fromJson(sceneInfo.getPersonInCharge(), new TypeToken>() { + }.getType()); + + Map info = new HashMap<>(); + info.put("sceneName", sceneInfo.getName()); + info.put("opUser", opUser); + info.put("benchTime", String.valueOf(sceneInfo.getBenchTime())); + info.put("totalRps", String.valueOf(sceneInfo.getMaxBenchQps() * (sceneInfo.getRpsRate() / 100d))); + info.put("reportId", String.valueOf(reportId)); + + String content = TemplateUtils.processTemplate(BENCH_BEGIN_MSG, info); + try { + feiShuService.sendCard2Person(personsInCharge, content); + } catch (Exception e) { + log.error("notifyPersonsInCharge error:{}", e.getMessage()); + } + } + + /** + * 记录压测日历 + */ + private void recordBenchCalendar(SceneInfo sceneInfo, long now) { + BenchCalendar benchCalendar; + if (sceneInfo.getBenchCalendar() == null || sceneInfo.getBenchCalendar().isEmpty()) { + benchCalendar = new BenchCalendar(); + benchCalendar.setBenchDateList(new ArrayList<>()); + } else { + benchCalendar = gson.fromJson(sceneInfo.getBenchCalendar(), BenchCalendar.class); + } + List tmpList = new ArrayList<>(); + //过滤一年前的记录 + benchCalendar.getBenchDateList().forEach(benchDate -> { + if (now - benchDate.getTimestamp() <= ONE_YEAR_MS) { + tmpList.add(benchDate); + } + }); + LocalDate date = LocalDate.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String nowDate = date.format(formatter); + boolean find = false; + for (BenchDate value : tmpList) { + if (nowDate.equals(value.getBenchDate())) { + find = true; + value.setDateBenchCount(value.getDateBenchCount() + 1); + break; + } + } + //没找到,追加 + if (!find) { + BenchDate benchDate = new BenchDate(); + benchDate.setBenchDate(nowDate); + benchDate.setTimestamp(now); + benchDate.setDateBenchCount(1); + tmpList.add(benchDate); + } + benchCalendar.setBenchDateList(tmpList); + sceneInfo.setBenchCalendar(gson.toJson(benchCalendar)); + } + + + /** + * 检查校验场景比例请求数据 + */ + private Pair checkUpdateSceneRateParam(SceneRpsRateReq req) { + + if (req.getSceneID() == null || req.getSceneID() == 0) { + return Pair.of(-1, "无效的场景id"); + } + if (req.getReportID() == null || req.getReportID().isEmpty()) { + return Pair.of(-1, "无效的报告id"); + } + if (req.getRpsRate() > 100 || req.getRpsRate() < 0) { + return Pair.of(-1, "无效的发压比例"); + } + return Pair.of(0, "success"); + } + + private Pair checkStopTaskParam(int type, TaskDTO taskDTO) { + + if (type == 0 && taskDTO.getReportId() == null) { + return Pair.of(-1, "报告id必传"); + } + + if (type == 1 && taskDTO.getSceneId() == null) { + return Pair.of(-1, "场景id必传"); + } + return Pair.of(0, "success"); + } + + private Pair checkSubmitTaskParam(TaskDTO taskDTO, String reportId) { + + if (taskDTO.getSubmitTaskType() == null) { + return Pair.of(-1, "任务类型必填"); + } + switch (taskDTO.getSubmitTaskType()) { + case SINGLE_API_DEBUG: + return checkSingleDebugParam(taskDTO); + case SCENE_DEBUG: + return checkSceneDebugParam(taskDTO, reportId); + case SCENE_BENCH: + return checkSceneBenchParam(taskDTO, reportId); + default: + return Pair.of(-1, "不支持的任务类型"); + } + } + + private Pair checkSingleDebugParam(TaskDTO taskDTO) { + DebugSceneApiInfoReq apiInfo = taskDTO.getApiInfo(); + + if (null == apiInfo) { + return Pair.of(-1, "调试接口参数必传"); + } + if (null == apiInfo.getApiType()) { + return Pair.of(-1, "接口类型必传"); + } + if (apiInfo.getApiType() == Constants.HTTP_API_TYPE) { + if (null == apiInfo.getApiUrl()) { + return Pair.of(-1, "接口 url 必传"); + } + if (null == apiInfo.getRequestMethod()) { + return Pair.of(-1, "接口请求方式必传"); + } + } + if (apiInfo.getApiType() == DUBBO_API_TYPE) { + if (null == apiInfo.getServiceName()) { + return Pair.of(-1, "dubbo接口 服务名 必传"); + } + if (null == apiInfo.getMethodName()) { + return Pair.of(-1, "dubbo接口 方法名必传"); + } + if (null == apiInfo.getDubboGroup()) { + apiInfo.setDubboGroup(""); + } + if (null == apiInfo.getDubboVersion()) { + apiInfo.setDubboVersion(""); + } + if (null == apiInfo.getDubboParamJson()) { + apiInfo.setDubboParamJson(""); + } + if (null == apiInfo.getRequestBody()) { + apiInfo.setRequestBody(""); + } + } + + if (null == apiInfo.getRequestTimeout()) { + return Pair.of(-1, "请求超时时间必传"); + } + + if (apiInfo.getApiType() == HTTP_API_TYPE && apiInfo.getRequestMethod() == HTTP_REQ_GET) { + Pair> res = parseGetUrl(apiInfo.getApiUrl()); + if (res.getLeft() == -1) { + return Pair.of(-1, "请求url格式错误"); + } else { + apiInfo.setRequestBody(gson.toJson(res.getRight())); + if (apiInfo.getApiUrl().contains("?")) { + apiInfo.setApiUrl(apiInfo.getApiUrl().split("\\?")[0]); + } + } + } + if (apiInfo.getCheckPointInfoList() != null) { + apiInfo.setCheckPointInfoListStr(gson.toJson(apiInfo.getCheckPointInfoList())); + } + //转换解析表达式 + if (apiInfo.getOutputParamInfos() != null) { + BizUtils.processOutputParamExpr(apiInfo.getOutputParamInfos()); + apiInfo.setOutputParamInfosStr(gson.toJson(apiInfo.getOutputParamInfos())); + } + + return Pair.of(0, "success"); + } + + private Pair checkSceneDebugParam(TaskDTO taskDTO, String reportId) { + if (null == taskDTO.getSceneId()) { + return Pair.of(-1, "场景id必传"); + } + if (sceneService.getSceneByID(taskDTO.getSceneId(), false).getData() == null) { + return Pair.of(-1, "场景id不存在"); + } + taskDTO.setReportId(reportId); + return Pair.of(0, "success"); + } + + private Pair checkSceneBenchParam(TaskDTO taskDTO, String reportId) { + //若正在运行,驳回 + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andSceneIdEqualTo(taskDTO.getSceneId()).andStateEqualTo(TaskStatus.Running.code); + List MibenchTasks = mibenchTaskMapper.selectByExample(example); + if (MibenchTasks.size() != 0) { + return Pair.of(-1, "该场景有正在执行的压测任务"); + } + SceneDTO sceneDTO = sceneService.getSceneByID(taskDTO.getSceneId(), false).getData(); + if (sceneDTO == null) { + return Pair.of(-1, "场景id不存在"); + } + Set enableSerialSet = new HashSet<>(); + sceneDTO.getSerialLinkDTOs().forEach(serialLinkDTO -> { + if (serialLinkDTO.getEnable()) { + enableSerialSet.add(serialLinkDTO.getSerialLinkName()); + } + }); + if (enableSerialSet.size() == 0) { + return Pair.of(-1, "至少需要启用一条链路"); + } + + //rps 模式 + if (sceneDTO.getBenchMode() == BenchModeEnum.RPS.code && sceneDTO.getIncrementMode() == BenchIncreaseModeEnum.PERCENT_INCREASE.code) { + if (sceneDTO.getBenchTime() < 60) { + //百分比递增模式不能小于1分钟 + return Pair.of(-1, "百分比递增模式压测时间不得小于一分钟"); + } + for (ApiBenchInfo apiBenchInfo : + sceneDTO.getApiBenchInfos()) { + if (enableSerialSet.contains(apiBenchInfo.getSerialName()) && apiBenchInfo.getMaxRps() - apiBenchInfo.getOriginRps() < 100) { + return Pair.of(-1, "百分比递增模式压测链路Rps差值不得小于 100"); + } + } + } + taskDTO.setReportId(reportId); + return Pair.of(0, "success"); + } + + private Pair> parseGetUrl(String url) { + //url 例: http://www.baidu.com?a=b&b=2 + List kvPairs = new ArrayList<>(); + if (url.contains("?")) { + String[] urlArr = url.split("\\?", 2); + if (urlArr.length != 2) { + return Pair.of(-1, null); + } + //[a=b,b=2] + String[] kvStrPair = urlArr[1].split("&"); + for (int i = 0; i < kvStrPair.length; i++) { + String[] kAndV = kvStrPair[i].split("=", 2); + kvPairs.add(new FormParamValue(kAndV[0], kAndV[1])); + } + } + return Pair.of(0, kvPairs); + } + + private String genReportName(String sceneName, String rpsRate) { + return sceneName + "——" + rpsRate + "%"; + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UploadService.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UploadService.java new file mode 100644 index 000000000..170792f58 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UploadService.java @@ -0,0 +1,200 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.opencsv.CSVReader; +import com.opencsv.CSVReaderBuilder; +import com.xiaomi.youpin.ks3.KsyunService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.UploadFileRes; +import run.mone.mimeter.dashboard.pojo.Dataset; + +import javax.annotation.PostConstruct; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static run.mone.mimeter.dashboard.bo.common.Constants.TRUE; +import static run.mone.mimeter.dashboard.exception.CommonError.*; + +@Service +@Slf4j +public class UploadService { + + public static final int PreviewFileRowNum = 8; + + private static final int MaxFileSizeMB = 100; + + private static final int MaxFileSizeB = MaxFileSizeMB * 1024 * 1024; + + + private static final int MaxFileRows = 50000; + + + @Value("${upload.save.base}") + private String basePath; + + private KsyunService ksyunService; + + @NacosValue("${ks3.AccessKeyID}") + private String accesskey; + + @NacosValue("${ks3.AccessKeySecret}") + private String accessSecret; + + @PostConstruct + private void init() { + ksyunService = new KsyunService(); + ksyunService.setAccessKeyID(accesskey); + ksyunService.setAccessKeySecret(accessSecret); + ksyunService.init(); + } + + public Result save(MultipartFile file) { + + String fileName = file.getOriginalFilename(); + if (fileName == null){ + fileName = "tmpFileName"; + } + String url; + String ksKey; + long rows; + long size = file.getSize(); + List previewFileRows = new ArrayList<>(); + String firstRow = ""; + + try { + File tmpFile = File.createTempFile("upload-mimeter-file-", file.getOriginalFilename()); + OutputStream os = new FileOutputStream(tmpFile); + os.write(file.getBytes()); + os.flush(); + + FileReader fileReader = new FileReader(tmpFile); + LineNumberReader lineNumberReader = new LineNumberReader(fileReader); + lineNumberReader.skip(Long.MAX_VALUE); + rows = lineNumberReader.getLineNumber(); + fileReader.close(); + lineNumberReader.close(); + + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(file.getInputStream(), StandardCharsets.UTF_8)); + for (int i = 0; i < PreviewFileRowNum; i++) { + String str = bufferedReader.readLine(); + if (i == 0) { + firstRow = str; + } + if (str == null) { + break; + } + previewFileRows.add(str); + } + + Pair checkRes = checkParam(fileName, rows, size, firstRow); + if (checkRes.getKey() != 0) { + return Result.fail(checkRes.getKey(), checkRes.getValue()); + } + ksKey = basePath + System.currentTimeMillis() + "/" + fileName; + url = ksyunService.uploadFile(ksKey, tmpFile, 60 * 60 * 24 * 23999); + boolean success = tmpFile.delete(); + if (!success) { + log.info("[UploadService.save] file {} upload successfully: {}", fileName, url); + return Result.fail(UploadFileError.code, UploadFileError.message); + } + + } catch (IOException e) { + log.error("[UploadService.save] failed to save file {}, err: {}", fileName, e); + return Result.fail(UploadFileError.code, UploadFileError.message); + } + + //这一行有问题 todo + List firstRowList = Arrays.asList(firstRow.split(",")); + + UploadFileRes uploadFileRes = new UploadFileRes(); + uploadFileRes.setFileName(fileName); + uploadFileRes.setFileKsKey(ksKey); + uploadFileRes.setFileRows(rows); + uploadFileRes.setFileSize(size); + uploadFileRes.setFileUrl(url); + uploadFileRes.setFileColumns(firstRowList.size()); + uploadFileRes.setFirstRow(firstRowList); + uploadFileRes.setPreviewFileRows(previewFileRows); + + return Result.success(uploadFileRes); + } + + + public Result> loadFileByRange(Dataset dataset, int from, int to) { + + List lines = new ArrayList<>(); + try { + byte[] data = ksyunService.getFileByKey(dataset.getFileKsKey()); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data), "UTF8")); + for (int i = 0; i < to; i++) { + String line = bufferedReader.readLine(); + if (i == 0 && dataset.getIgnoreFirstRow() == TRUE) { + to++; + continue; + } + if (i >= from) { + lines.add(line); + } + if (line == null) { + break; + } + } + } catch (IOException e) { + return Result.fail(UploadFileError.code, LoadFileError.message); + } + return Result.success(lines); + } + + public Result> loadStringArrByRange(Dataset dataset, int from, int to) { + + List lines = new ArrayList<>(); + try { + byte[] data = ksyunService.getFileByKey(dataset.getFileKsKey()); + CSVReader csvReader = new CSVReaderBuilder(new InputStreamReader(new ByteArrayInputStream(data), "UTF8")).withSkipLines(from).build(); + + if (dataset.getIgnoreFirstRow() == TRUE) { + to++; + } + String[] rawLine; + int i = 0; + while((rawLine = csvReader.readNext()) != null && i < to - from) { + if (from == 0 && i == 0 && dataset.getIgnoreFirstRow() == TRUE) { + i++; + continue; + } + lines.add(rawLine); + i++; + } + } catch (IOException e) { + return Result.fail(UploadFileError.code, LoadFileError.message); + } + return Result.success(lines); + } + + + private Pair checkParam(String fileName, long rows, long size, String firstRow) { + if (!fileName.endsWith(".csv")) { + return Pair.of(WrongFileTypeError.code, WrongFileTypeError.message); + } + if (rows > MaxFileRows) { + return Pair.of(OverMaxFileRowsError.code, "上传文件行数不得超过" + MaxFileRows + "行"); + } + if (size > MaxFileSizeB) { + return Pair.of(OverMaxFileSizeError.code, "上传文件大小不得超过" + MaxFileSizeMB + "M"); + } + if (StringUtils.isEmpty(firstRow)) { + return Pair.of(FileFirstRowEmptyError.code, FileFirstRowEmptyError.message); + } + return Pair.of(0, "success"); + } + +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UserV1Service.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UserV1Service.java new file mode 100644 index 000000000..2f969c938 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/impl/UserV1Service.java @@ -0,0 +1,129 @@ +package run.mone.mimeter.dashboard.service.impl; + +import com.alibaba.nacos.api.config.annotation.NacosValue; +import com.xiaomi.mone.tpc.api.service.NodeUserFacade; +import com.xiaomi.mone.tpc.api.service.UserFacade; +import com.xiaomi.mone.tpc.common.enums.NodeUserRelTypeEnum; +import com.xiaomi.mone.tpc.common.enums.UserStatusEnum; +import com.xiaomi.mone.tpc.common.enums.UserTypeEnum; +import com.xiaomi.mone.tpc.common.param.NodeUserQryParam; +import com.xiaomi.mone.tpc.common.param.UserQryParam; +import com.xiaomi.mone.tpc.common.vo.NodeUserRelVo; +import com.xiaomi.mone.tpc.common.vo.PageDataVo; +import com.xiaomi.mone.tpc.common.vo.UserVo; +import com.xiaomi.mone.tpc.login.util.UserUtil; +import com.xiaomi.mone.tpc.login.vo.AuthUserVo; +import com.xiaomi.youpin.gateway.manager.bo.user.UserInfoVo; +import com.xiaomi.youpin.infra.rpc.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Component; +import run.mone.mimeter.dashboard.bo.UserInfo; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.exception.CommonException; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wmin + * @date 2023/5/10 + */ +@Component +@Slf4j +public class UserV1Service { + + @DubboReference(group = "${ref.tpc.service.group}", interfaceClass = UserFacade.class, version = "1.0") + private UserFacade userFacade; + + @DubboReference(group = "${ref.tpc.service.group}", interfaceClass = NodeUserFacade.class, version = "1.0") + private NodeUserFacade nodeUserFacade; + + @NacosValue(value = "${tpc.gatewayManager.id:10}", autoRefreshed = true) + private long tpcNodeId; + + /** + * 获取用户登录信息 + * @return + */ + public UserInfo getUserInfo(){ + AuthUserVo userVo = UserUtil.getUser(); + // 适配private/api类型的请求 + if(userVo == null){ + return null; + } + UserInfo userInfo = new UserInfo(); + userInfo.setDepartmentName(userVo.getDepartmentName()); + userInfo.setDisplayName(userVo.getName()); + userInfo.setEmail(userVo.getEmail()); + userInfo.setName(userVo.getName()); + userInfo.setUsername(userVo.getAccount()); + userInfo.setFullAccount(userVo.genFullAccount()); + userInfo.setAvatar(userVo.getAvatarUrl()); + userInfo.setAdmin(true); + return userInfo; + } + + + public boolean isAdmin(String username, AuthUserVo userVo){ + if(true)return true; + if (StringUtils.isBlank(username)){ + return false; + } + if (userVo==null){ + throw new CommonException(CommonError.InvalidUserInfoError); + } + boolean isAdmin = false; + NodeUserQryParam param = new NodeUserQryParam(); + param.setNodeId(tpcNodeId); + param.setType(NodeUserRelTypeEnum.MANAGER.getCode()); + param.setAccount(userVo.getAccount()); + param.setUserType(userVo.getUserType()); + Result> rst = nodeUserFacade.list(param); + log.debug("nodeUserFacade.list rst:{}", rst); + if(rst != null && rst.getData() != null && CollectionUtils.isNotEmpty(rst.getData().getList())){ + for (NodeUserRelVo vo : rst.getData().getList()){ + if (username.equals(vo.getAccount())){ + isAdmin = true; + break; + } + } + } + return isAdmin; + } + + + /** + * 用户列表搜索 + */ + public List qryUserList(String username, Integer userType, AuthUserVo userVo) { + List list = new ArrayList<>(); + UserQryParam qryParam = new UserQryParam(); + if (userType!=null){ + qryParam.setType(userType); + } + qryParam.setUserAcc(username); + qryParam.setStatus(UserStatusEnum.ENABLE.getCode()); + qryParam.setAccount(userVo.getAccount()); + qryParam.setUserType(userVo.getUserType()); + Result> rst = userFacade.list(qryParam); + if(rst != null && rst.getData() != null && CollectionUtils.isNotEmpty(rst.getData().getList())){ + List nodeUserRelVos = rst.getData().getList(); + nodeUserRelVos.forEach(nodeUser->{ + UserInfoVo userInfoVo = new UserInfoVo(); + userInfoVo.setUserName(nodeUser.getAccount()); + userInfoVo.setUserType(nodeUser.getType()); + userInfoVo.setFullAccount(UserUtil.getFullAccount(nodeUser.getAccount(), nodeUser.getType())); + UserTypeEnum anEnum = UserTypeEnum.getEnum(nodeUser.getType()); + if(anEnum != null){ + userInfoVo.setFullUserName(nodeUser.getAccount()+"("+ anEnum.getDesc() +")"); + } + list.add(userInfoVo); + }); + } + return list; + } +} + diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/DatasetInfoServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/DatasetInfoServiceImpl.java new file mode 100644 index 000000000..164cfc282 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/DatasetInfoServiceImpl.java @@ -0,0 +1,73 @@ +package run.mone.mimeter.dashboard.service.openservice; + +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.dataset.DatasetLineNum; +import run.mone.mimeter.dashboard.bo.dataset.DatasetLinesReq; +import run.mone.mimeter.dashboard.mapper.DatasetMapper; +import run.mone.mimeter.dashboard.pojo.Dataset; +import run.mone.mimeter.dashboard.service.DatasetInfoSercice; +import run.mone.mimeter.dashboard.service.DatasetService; + +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +@DubboService(group = "${dubbo.group}",version = "${dubbo.version}",timeout = 10000) +public class DatasetInfoServiceImpl implements DatasetInfoSercice { + + @Autowired + private DatasetService datasetService; + + @Autowired + private DatasetMapper datasetMapper; + + private static final int MAX_DUBBO_DATA = 8*1024; + + @Override + public Result> getLineNumBySceneId(Integer sceneID) { + List datasetLineNums = new ArrayList<>(); + + List datasetsIds = datasetService.getDatasetIdsBySceneId(sceneID); + + if (datasetsIds == null || datasetsIds.size() == 0) { + return Result.success(datasetLineNums); + } + List datasets = datasetService.getDatasetListByIds(datasetsIds).getData(); + datasets.forEach(dataset -> { + DatasetLineNum datasetLineNum = new DatasetLineNum(); + datasetLineNum.setDatasetId(dataset.getId()); + datasetLineNum.setFileName(dataset.getFileName()); + datasetLineNum.setFileUrl(dataset.getFileUrl()); + datasetLineNum.setFileKsKey(dataset.getFileKsKey()); + datasetLineNum.setFileRaw(dataset.getFileRows()); + datasetLineNum.setDefaultParamName(dataset.getDefaultParamName()); + datasetLineNum.setIgnoreFirstLine(dataset.getIgnoreFirstRow() == 1); + datasetLineNums.add(datasetLineNum); + }); + return Result.success(datasetLineNums); + } + + @Override + public Result>> getDatasetMap(List linesReqs) { + TreeMap> dataRes = datasetService.getParamDataMap(linesReqs); +// if (dataRes.toString().getBytes().length >= MAX_DUBBO_DATA){ +// return Result.fail(CommonError.DubboDataTooLong); +// } + return Result.success(dataRes); + } + + @Override + public Result syncTenant() { + return Result.success(datasetService.syncTenant()); + } + + @Override + public Result updateDatasetTenant(Integer datasetId, String tenant) { + Dataset dataset = datasetMapper.selectByPrimaryKey(datasetId); + dataset.setTenant(tenant); + datasetMapper.updateByPrimaryKey(dataset); + return Result.success(true); + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/MonitorInfoServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/MonitorInfoServiceImpl.java new file mode 100644 index 000000000..5dc22999c --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/MonitorInfoServiceImpl.java @@ -0,0 +1,50 @@ +package run.mone.mimeter.dashboard.service.openservice; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.xiaomi.faas.func.api.MimeterService; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; +import org.apache.dubbo.config.annotation.DubboService; +import run.mone.mimeter.dashboard.bo.scene.SceneTaskAppsBo; +import run.mone.mimeter.dashboard.common.util.Util; +import run.mone.mimeter.dashboard.service.MonitorInfoService; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@DubboService(group = "${dubbo.group}", version = "${dubbo.version}") +@Slf4j +public class MonitorInfoServiceImpl implements MonitorInfoService { + + private static final Gson gson = Util.getGson(); + @DubboReference(check = false,group = "${ref.hera.service.group}",timeout = 3000) + private MimeterService mimeterService; + + + @Override + public List getAppListByReportID(Integer sceneId, String reportId) { + List appList = new ArrayList<>(); + + String flag = sceneId + "_" + reportId; + com.xiaomi.youpin.infra.rpc.Result res; + try { + res = mimeterService.getApps(flag); + } catch (Exception e) { + return appList; + } + if (res.getCode() == 0 && res.getData() != null) { + //succ + SceneTaskAppsBo sceneTaskAppsBo = gson.fromJson(res.getData().toString(), new TypeToken() { + }.getType()); + List linkTaskAppsBos = sceneTaskAppsBo.getSerialLinks(); + linkTaskAppsBos.forEach(linkTaskAppsBo -> { + List> apps =linkTaskAppsBo.getApis().stream().map(SceneTaskAppsBo.ApiTaskAppsBo::getApps).collect(Collectors.toList()); + apps.forEach(appList::addAll); + }); +// List apiTaskAppsBos = linkTaskAppsBos.stream().map(SceneTaskAppsBo.LinkTaskAppsBo::getApis); + } + return appList; + } +} diff --git a/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/SceneInfoServiceImpl.java b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/SceneInfoServiceImpl.java new file mode 100644 index 000000000..5430d4fb5 --- /dev/null +++ b/ozburst-all/mimeter-dashboard/mimeter-dashboard-service/src/main/java/run/mone/mimeter/dashboard/service/openservice/SceneInfoServiceImpl.java @@ -0,0 +1,114 @@ +package run.mone.mimeter.dashboard.service.openservice; + +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; +import run.mone.mimeter.dashboard.bo.common.Result; +import run.mone.mimeter.dashboard.bo.scene.SceneDTO; +import run.mone.mimeter.dashboard.common.TaskStatus; +import run.mone.mimeter.dashboard.exception.CommonError; +import run.mone.mimeter.dashboard.mapper.MibenchTaskMapper; +import run.mone.mimeter.dashboard.mapper.SceneInfoMapper; +import run.mone.mimeter.dashboard.pojo.MibenchTask; +import run.mone.mimeter.dashboard.pojo.MibenchTaskExample; +import run.mone.mimeter.dashboard.pojo.SceneInfo; +import run.mone.mimeter.dashboard.service.SceneInfoService; +import run.mone.mimeter.dashboard.service.SceneService; + +import java.util.List; +import java.util.stream.Collectors; + +@DubboService(group = "${dubbo.group}",version = "${dubbo.version}") +@Slf4j +public class SceneInfoServiceImpl implements SceneInfoService { + + @Autowired + private SceneService sceneService; + + @Autowired + private SceneInfoMapper sceneInfoMapper; + + @Autowired + private MibenchTaskMapper mibenchTaskMapper; + + /** + * 15s后未结束认为状态已丢失 + */ + private static final long MAX_DELAY_TIME = 15; + + @Override + public Result getSceneByID(Integer sceneID) { + return sceneService.getSceneByID(sceneID,true); + } + + @Override + public void updateSceneStatus(Integer sceneId,Integer sceneStatus) { + if (sceneId == null || sceneStatus == null){ + return; + } + try { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(sceneId); + sceneInfo.setSceneStatus(sceneStatus); + sceneInfoMapper.updateByPrimaryKey(sceneInfo); + } catch (Exception e) { + log.error("update scene status error:{}",e.getMessage()); + } + } + + @Override + public Result updatemimeterTaskStatus(String report, Integer status) { + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andReportIdEqualTo(report); + List MibenchTasks = mibenchTaskMapper.selectByExample(example); + MibenchTasks.forEach(MibenchTask -> { + MibenchTask.setState(status); + mibenchTaskMapper.updateByPrimaryKey(MibenchTask); + }); + + return Result.success(true); + } + + @Override + public Result updateSceneTenant(Integer sceneId, String tenant) { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(sceneId); + sceneInfo.setTenant(tenant); + sceneInfoMapper.updateByPrimaryKey(sceneInfo); + return Result.success(true); + } + + @Override + public Result tmpUpdateLogRate(int sceneId, int logRate) { + SceneInfo sceneInfo = sceneInfoMapper.selectByPrimaryKey(sceneId); + sceneInfo.setLogRate(logRate); + sceneInfoMapper.updateByPrimaryKey(sceneInfo); + return Result.success(true); + } + + /** + * 定时任务,处理丢失状态的任务 + * @return + */ + @Override + public Result processLossTask() { + try { + MibenchTaskExample example = new MibenchTaskExample(); + example.createCriteria().andStateEqualTo(TaskStatus.Running.code); + List runningTasks = mibenchTaskMapper.selectByExample(example); + if (runningTasks == null || runningTasks.size() == 0){ + return Result.success(true); + } + List toDoTaskList = runningTasks.stream().filter(runningTask -> (System.currentTimeMillis() - runningTask.getCtime()) >= (runningTask.getTime() + MAX_DELAY_TIME)).collect(Collectors.toList()); + if (toDoTaskList.size() == 0){ + return Result.success(true); + } + toDoTaskList.forEach(toDoTask ->{ + toDoTask.setState(TaskStatus.Success.code); + mibenchTaskMapper.updateByPrimaryKey(toDoTask); + }); + } catch (Exception e) { + log.error("SceneInfoServiceImpl processLossTask failed,cause by:{}",e.getMessage()); + return Result.fail(CommonError.UnknownError); + } + return Result.success(true); + } +} diff --git a/ozburst-all/mimeter-dashboard/pom.xml b/ozburst-all/mimeter-dashboard/pom.xml new file mode 100644 index 000000000..7a856efbc --- /dev/null +++ b/ozburst-all/mimeter-dashboard/pom.xml @@ -0,0 +1,52 @@ + + + + 4.0.0 + run.mone + mimeter-dashboard + 1.0.0-SNAPSHOT + pom + + + mimeter-dashboard-api + mimeter-dashboard-common + mimeter-dashboard-service + mimeter-dashboard-server + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + true + true + UTF-8 + + + ${project.basedir}/src/main/java + + + + + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + +