优化查看脚本执行结果、mtragent管理初版
This commit is contained in:
+105
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.mtragent.controller;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.mtragent.domain.RmMtrClientRegistration;
|
||||
import com.ruoyi.mtragent.service.IRmMtrClientRegistrationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MTR客户端注册Controller
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mtrClientRegistration")
|
||||
public class RmMtrClientRegistrationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRmMtrClientRegistrationService rmMtrClientRegistrationService;
|
||||
|
||||
/**
|
||||
* 查询MTR客户端注册列表
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(rmMtrClientRegistration.getPageNum());
|
||||
pageDomain.setPageSize(rmMtrClientRegistration.getPageSize());
|
||||
startPage(pageDomain);
|
||||
List<RmMtrClientRegistration> list = rmMtrClientRegistrationService.selectRmMtrClientRegistrationList(rmMtrClientRegistration);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出MTR客户端注册列表
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:export")
|
||||
@Log(title = "MTR客户端注册", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
List<RmMtrClientRegistration> list = rmMtrClientRegistrationService.selectRmMtrClientRegistrationList(rmMtrClientRegistration);
|
||||
ExcelUtil<RmMtrClientRegistration> util = new ExcelUtil<RmMtrClientRegistration>(RmMtrClientRegistration.class);
|
||||
util.showColumn(rmMtrClientRegistration.getProperties());
|
||||
util.exportExcel(response, list, "MTR客户端注册数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取MTR客户端注册详细信息
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rmMtrClientRegistrationService.selectRmMtrClientRegistrationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增MTR客户端注册
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:add")
|
||||
@Log(title = "MTR客户端注册", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
return toAjax(rmMtrClientRegistrationService.insertRmMtrClientRegistration(rmMtrClientRegistration));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改MTR客户端注册
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:edit")
|
||||
@Log(title = "MTR客户端注册", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
return toAjax(rmMtrClientRegistrationService.updateRmMtrClientRegistration(rmMtrClientRegistration));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置更新策略
|
||||
* @param rmMtrClientRegistration
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrClientRegistration:add")
|
||||
@PostMapping("/addAgentUpdatePolicy")
|
||||
public AjaxResult addAgentUpdatePolicy(@RequestBody RmMtrClientRegistration rmMtrClientRegistration){
|
||||
int rows = rmMtrClientRegistrationService.addAgentUpdatePolicy(rmMtrClientRegistration);
|
||||
return toAjax(rows);
|
||||
}
|
||||
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.ruoyi.mtragent.controller;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.mtragent.domain.RmMtrPolicyConfig;
|
||||
import com.ruoyi.mtragent.service.IRmMtrPolicyConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* mtr探测策略配置Controller
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mtrPolicyConfig")
|
||||
public class RmMtrPolicyConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRmMtrPolicyConfigService rmMtrPolicyConfigService;
|
||||
|
||||
/**
|
||||
* 查询mtr探测策略配置列表
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(rmMtrPolicyConfig.getPageNum());
|
||||
pageDomain.setPageSize(rmMtrPolicyConfig.getPageSize());
|
||||
startPage(pageDomain);
|
||||
List<RmMtrPolicyConfig> list = rmMtrPolicyConfigService.selectRmMtrPolicyConfigList(rmMtrPolicyConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出mtr探测策略配置列表
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:export")
|
||||
@Log(title = "mtr探测策略配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
List<RmMtrPolicyConfig> list = rmMtrPolicyConfigService.selectRmMtrPolicyConfigList(rmMtrPolicyConfig);
|
||||
ExcelUtil<RmMtrPolicyConfig> util = new ExcelUtil<RmMtrPolicyConfig>(RmMtrPolicyConfig.class);
|
||||
util.showColumn(rmMtrPolicyConfig.getProperties());
|
||||
util.exportExcel(response, list, "mtr探测策略配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取mtr探测策略配置详细信息
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rmMtrPolicyConfigService.selectRmMtrPolicyConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增mtr探测策略配置
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:add")
|
||||
@Log(title = "mtr探测策略配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
return toAjax(rmMtrPolicyConfigService.insertRmMtrPolicyConfig(rmMtrPolicyConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改mtr探测策略配置
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:edit")
|
||||
@Log(title = "mtr探测策略配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
return toAjax(rmMtrPolicyConfigService.updateRmMtrPolicyConfig(rmMtrPolicyConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除mtr探测策略配置
|
||||
*/
|
||||
@RequiresPermissions("mtragent:mtrPolicyConfig:remove")
|
||||
@Log(title = "mtr探测策略配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rmMtrPolicyConfigService.deleteRmMtrPolicyConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 心跳信息日志对象 initial_heartbeat_listen_log
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-08
|
||||
*/
|
||||
@Data
|
||||
public class InitialHeartbeatListenLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/** 客户端ID */
|
||||
private String clientId;
|
||||
|
||||
/** 状态0-正常 1-恢复 2-两次丢失 3-三次丢失 */
|
||||
@Excel(name = "状态0-正常 1-恢复 2-两次丢失 3-三次丢失")
|
||||
private String status;
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.system.api.domain.NetworkInfo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class NetworkInfoDeserializer extends JsonDeserializer<List<NetworkInfo>> {
|
||||
// 添加无参构造函数(Jackson 需要)
|
||||
public NetworkInfoDeserializer() {
|
||||
}
|
||||
@Override
|
||||
public List<NetworkInfo> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
ObjectMapper mapper = (ObjectMapper) p.getCodec();
|
||||
JsonNode node = mapper.readTree(p);
|
||||
|
||||
// 如果 networkInfo 是字符串(如日志中的情况),先解析字符串
|
||||
if (node.isTextual()) {
|
||||
String jsonStr = node.textValue();
|
||||
return mapper.readValue(jsonStr, new TypeReference<List<NetworkInfo>>() {});
|
||||
}
|
||||
// 如果 networkInfo 是数组,直接解析
|
||||
else if (node.isArray()) {
|
||||
return mapper.readValue(node.traverse(), new TypeReference<List<NetworkInfo>>() {});
|
||||
}
|
||||
throw new IOException("Invalid networkInfo format");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 客户端告警信息对象 rm_alarm_log
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-10
|
||||
*/
|
||||
@Data
|
||||
public class RmAlarmLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 客户端ID */
|
||||
@Excel(name = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
/** 告警时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date alarmTime;
|
||||
|
||||
/** 管理网-公网IP */
|
||||
@Excel(name = "管理网-公网IP")
|
||||
private String mgmPublicIp;
|
||||
|
||||
/** 告警类型 */
|
||||
@Excel(name = "告警类型")
|
||||
private String alarmType;
|
||||
|
||||
/** 告警内容 */
|
||||
@Excel(name = "告警内容")
|
||||
private String alarmContent;
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 告警推送配置对象 rm_alarm_push_config
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-11
|
||||
*/
|
||||
@Data
|
||||
public class RmAlarmPushConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 配置名称 */
|
||||
@Excel(name = "配置名称")
|
||||
private String configName;
|
||||
|
||||
/** 推送方式 */
|
||||
@Excel(name = "推送方式")
|
||||
private String pushMethod;
|
||||
|
||||
/** 推送地址 */
|
||||
@Excel(name = "推送地址")
|
||||
private String pushAddress;
|
||||
|
||||
/** 推送告警类型 */
|
||||
@Excel(name = "推送告警类型")
|
||||
private String pushAlarmTypes;
|
||||
|
||||
/** 消息内容 */
|
||||
@Excel(name = "消息内容")
|
||||
private String messageContent;
|
||||
|
||||
/** 消息提示人手机号 */
|
||||
@Excel(name = "消息提示人手机号")
|
||||
private String contactPhones;
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* MTR客户端注册对象 rm_mtr_client_registration
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Data
|
||||
public class RmMtrClientRegistration extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** MTR客户端ID */
|
||||
@Excel(name = "MTR客户端ID")
|
||||
private String mtrClientId;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 标识 */
|
||||
@Excel(name = "标识")
|
||||
private String logicalNode;
|
||||
|
||||
/** 注册时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date registerTime;
|
||||
|
||||
/** 注册状态(0-未注册,1-已注册) */
|
||||
@Excel(name = "注册状态(0-未注册,1-已注册)")
|
||||
private String registerStatus;
|
||||
|
||||
/** 在线状态(0-离线,1-在线) */
|
||||
@Excel(name = "在线状态(0-离线,1-在线)")
|
||||
private String onlineStatus;
|
||||
|
||||
/** 心跳时间间隔(秒) */
|
||||
@Excel(name = "心跳时间间隔(秒)")
|
||||
private Integer heartbeatInterval;
|
||||
|
||||
/** 心跳次数 */
|
||||
@Excel(name = "心跳次数")
|
||||
private Integer heartbeatCount;
|
||||
|
||||
/** 更新方式 */
|
||||
@Excel(name = "更新方式")
|
||||
private String method;
|
||||
|
||||
/** 定时更新时间 */
|
||||
@Excel(name = "定时更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date scheduledUpdateTime;
|
||||
|
||||
/** 文件地址 */
|
||||
@Excel(name = "文件地址")
|
||||
private String filePath;
|
||||
|
||||
/** 文件MD5值 */
|
||||
@Excel(name = "文件MD5值")
|
||||
private String fileMd5;
|
||||
|
||||
/** 最后一次更新结果 */
|
||||
@Excel(name = "最后一次更新结果")
|
||||
private String lastUpdateResult;
|
||||
|
||||
/** 最后一次更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后一次更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/** 网卡信息(JSON格式) */
|
||||
@Excel(name = "网卡信息(JSON格式)")
|
||||
private String networkInfo;
|
||||
/** 部署设备 */
|
||||
private String mtrClientIds;
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* mtr探测策略配置对象 rm_mtr_policy_config
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Data
|
||||
public class RmMtrPolicyConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 策略名称 */
|
||||
@Excel(name = "策略名称")
|
||||
private String policyName;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
private Long priority;
|
||||
|
||||
/** MTR客户端ID */
|
||||
@Excel(name = "MTR客户端ID")
|
||||
private String mtrClientId;
|
||||
|
||||
/** 服务器集合(换行符分割) */
|
||||
@Excel(name = "服务器集合(换行符分割)")
|
||||
private String serverGroup;
|
||||
/** 探测目标ip集合 */
|
||||
private String serveripGroup;
|
||||
|
||||
/** 是否探测(0-否,1-是) */
|
||||
@Excel(name = "是否探测(0-否,1-是)")
|
||||
private Long probeFlag;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 探测频率(秒) */
|
||||
@Excel(name = "探测频率(秒)")
|
||||
private Long probeFrequency;
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.mtragent.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息对象 rm_network_interface
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@Data
|
||||
public class RmNetworkInterface extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 客户端ID */
|
||||
@Excel(name = "客户端ID")
|
||||
private String clientId;
|
||||
|
||||
/** 运营商 */
|
||||
@Excel(name = "运营商")
|
||||
private String isp;
|
||||
|
||||
/** 省 */
|
||||
@Excel(name = "省")
|
||||
private String province;
|
||||
|
||||
/** 市 */
|
||||
@Excel(name = "市")
|
||||
private String city;
|
||||
|
||||
/** 公网IP */
|
||||
@Excel(name = "公网IP")
|
||||
private String publicIp;
|
||||
|
||||
/** 接口名称 */
|
||||
@Excel(name = "接口名称")
|
||||
private String interfaceName;
|
||||
|
||||
/** MAC地址 */
|
||||
@Excel(name = "MAC地址")
|
||||
private String macAddress;
|
||||
|
||||
/** 接口类型 */
|
||||
@Excel(name = "接口类型")
|
||||
private String interfaceType;
|
||||
|
||||
/** IPv4地址 */
|
||||
@Excel(name = "IPv4地址")
|
||||
private String ipv4Address;
|
||||
|
||||
/** 网关 */
|
||||
@Excel(name = "网关")
|
||||
private String gateway;
|
||||
/** 绑定ip 1业务IP,2管理ip */
|
||||
private String bindIp;
|
||||
/** 是否为新信息 */
|
||||
private Integer newFlag;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.mtragent.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MessageVo {
|
||||
|
||||
private String clientId;
|
||||
|
||||
private String dataType;
|
||||
|
||||
private String data;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.mtragent.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.ruoyi.mtragent.domain.NetworkInfoDeserializer;
|
||||
import com.ruoyi.system.api.domain.NetworkInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RegisterMsgVo {
|
||||
@JsonProperty("clientId")
|
||||
private String clientId;
|
||||
|
||||
@JsonProperty("sn")
|
||||
private String sn;
|
||||
|
||||
@JsonProperty("networkInfo")
|
||||
@JsonDeserialize(using = NetworkInfoDeserializer.class)
|
||||
private List<NetworkInfo> networkInfo;
|
||||
|
||||
@JsonProperty("timestamp")
|
||||
private long timestamp;
|
||||
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.InitialHeartbeatListenLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 心跳信息日志Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-08
|
||||
*/
|
||||
public interface InitialHeartbeatListenLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询心跳信息日志
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 心跳信息日志
|
||||
*/
|
||||
public InitialHeartbeatListenLog selectInitialHeartbeatListenLogByClientId(String clientId);
|
||||
|
||||
/**
|
||||
* 查询心跳信息日志列表
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 心跳信息日志集合
|
||||
*/
|
||||
public List<InitialHeartbeatListenLog> selectInitialHeartbeatListenLogList(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 新增心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 修改心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 删除心跳信息日志
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInitialHeartbeatListenLogByClientId(String clientId);
|
||||
|
||||
/**
|
||||
* 批量删除心跳信息日志
|
||||
*
|
||||
* @param clientIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInitialHeartbeatListenLogByClientIds(String[] clientIds);
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmAlarmLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端告警信息Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-10
|
||||
*/
|
||||
public interface RmAlarmLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户端告警信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 客户端告警信息
|
||||
*/
|
||||
public RmAlarmLog selectRmAlarmLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端告警信息列表
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 客户端告警信息集合
|
||||
*/
|
||||
public List<RmAlarmLog> selectRmAlarmLogList(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 新增客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmAlarmLog(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 修改客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmAlarmLog(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 删除客户端告警信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除客户端告警信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmLogByIds(Long[] ids);
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmAlarmPushConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警推送配置Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-11
|
||||
*/
|
||||
public interface RmAlarmPushConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询告警推送配置
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 告警推送配置
|
||||
*/
|
||||
public RmAlarmPushConfig selectRmAlarmPushConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询告警推送配置列表
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 告警推送配置集合
|
||||
*/
|
||||
public List<RmAlarmPushConfig> selectRmAlarmPushConfigList(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 新增告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 修改告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 删除告警推送配置
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmPushConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除告警推送配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmPushConfigByIds(Long[] ids);
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mtragent.domain.RmMtrClientRegistration;
|
||||
|
||||
/**
|
||||
* MTR客户端注册Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
public interface RmMtrClientRegistrationMapper
|
||||
{
|
||||
/**
|
||||
* 查询MTR客户端注册
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return MTR客户端注册
|
||||
*/
|
||||
public RmMtrClientRegistration selectRmMtrClientRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询MTR客户端注册列表
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return MTR客户端注册集合
|
||||
*/
|
||||
public List<RmMtrClientRegistration> selectRmMtrClientRegistrationList(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 新增MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 修改MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 删除MTR客户端注册
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrClientRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除MTR客户端注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrClientRegistrationByIds(Long[] ids);
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mtragent.domain.RmMtrPolicyConfig;
|
||||
|
||||
/**
|
||||
* mtr探测策略配置Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
public interface RmMtrPolicyConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询mtr探测策略配置
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return mtr探测策略配置
|
||||
*/
|
||||
public RmMtrPolicyConfig selectRmMtrPolicyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询mtr探测策略配置列表
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return mtr探测策略配置集合
|
||||
*/
|
||||
public List<RmMtrPolicyConfig> selectRmMtrPolicyConfigList(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 新增mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 修改mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 删除mtr探测策略配置
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrPolicyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除mtr探测策略配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrPolicyConfigByIds(Long[] ids);
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.mtragent.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmNetworkInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Mapper接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface RmNetworkInterfaceMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息集合
|
||||
*/
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids);
|
||||
|
||||
int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface);
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.InitialHeartbeatListenLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 心跳信息日志Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-08
|
||||
*/
|
||||
public interface IInitialHeartbeatListenLogService
|
||||
{
|
||||
/**
|
||||
* 查询心跳信息日志
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 心跳信息日志
|
||||
*/
|
||||
public InitialHeartbeatListenLog selectInitialHeartbeatListenLogByClientId(String clientId);
|
||||
|
||||
/**
|
||||
* 查询心跳信息日志列表
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 心跳信息日志集合
|
||||
*/
|
||||
public List<InitialHeartbeatListenLog> selectInitialHeartbeatListenLogList(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 新增心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 修改心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog);
|
||||
|
||||
/**
|
||||
* 批量删除心跳信息日志
|
||||
*
|
||||
* @param clientIds 需要删除的心跳信息日志主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInitialHeartbeatListenLogByClientIds(String[] clientIds);
|
||||
|
||||
/**
|
||||
* 删除心跳信息日志信息
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInitialHeartbeatListenLogByClientId(String clientId);
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmAlarmLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端告警信息Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-10
|
||||
*/
|
||||
public interface IRmAlarmLogService
|
||||
{
|
||||
/**
|
||||
* 查询客户端告警信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 客户端告警信息
|
||||
*/
|
||||
public RmAlarmLog selectRmAlarmLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端告警信息列表
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 客户端告警信息集合
|
||||
*/
|
||||
public List<RmAlarmLog> selectRmAlarmLogList(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 新增客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmAlarmLog(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 修改客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmAlarmLog(RmAlarmLog rmAlarmLog);
|
||||
|
||||
/**
|
||||
* 批量删除客户端告警信息
|
||||
*
|
||||
* @param ids 需要删除的客户端告警信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmLogByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除客户端告警信息信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmLogById(Long id);
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmAlarmPushConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警推送配置Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-11
|
||||
*/
|
||||
public interface IRmAlarmPushConfigService
|
||||
{
|
||||
/**
|
||||
* 查询告警推送配置
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 告警推送配置
|
||||
*/
|
||||
public RmAlarmPushConfig selectRmAlarmPushConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询告警推送配置列表
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 告警推送配置集合
|
||||
*/
|
||||
public List<RmAlarmPushConfig> selectRmAlarmPushConfigList(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 新增告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 修改告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig);
|
||||
|
||||
/**
|
||||
* 批量删除告警推送配置
|
||||
*
|
||||
* @param ids 需要删除的告警推送配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmPushConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除告警推送配置信息
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmAlarmPushConfigById(Long id);
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmMtrClientRegistration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MTR客户端注册Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
public interface IRmMtrClientRegistrationService
|
||||
{
|
||||
/**
|
||||
* 查询MTR客户端注册
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return MTR客户端注册
|
||||
*/
|
||||
public RmMtrClientRegistration selectRmMtrClientRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询MTR客户端注册列表
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return MTR客户端注册集合
|
||||
*/
|
||||
public List<RmMtrClientRegistration> selectRmMtrClientRegistrationList(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 新增MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 修改MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
|
||||
/**
|
||||
* 批量删除MTR客户端注册
|
||||
*
|
||||
* @param ids 需要删除的MTR客户端注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrClientRegistrationByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除MTR客户端注册信息
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrClientRegistrationById(Long id);
|
||||
|
||||
/**
|
||||
* 配置更新策略
|
||||
* @param rmMtrClientRegistration
|
||||
* @return
|
||||
*/
|
||||
int addAgentUpdatePolicy(RmMtrClientRegistration rmMtrClientRegistration);
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mtragent.domain.RmMtrPolicyConfig;
|
||||
|
||||
/**
|
||||
* mtr探测策略配置Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
public interface IRmMtrPolicyConfigService
|
||||
{
|
||||
/**
|
||||
* 查询mtr探测策略配置
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return mtr探测策略配置
|
||||
*/
|
||||
public RmMtrPolicyConfig selectRmMtrPolicyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询mtr探测策略配置列表
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return mtr探测策略配置集合
|
||||
*/
|
||||
public List<RmMtrPolicyConfig> selectRmMtrPolicyConfigList(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 新增mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 修改mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig);
|
||||
|
||||
/**
|
||||
* 批量删除mtr探测策略配置
|
||||
*
|
||||
* @param ids 需要删除的mtr探测策略配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrPolicyConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除mtr探测策略配置信息
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmMtrPolicyConfigById(Long id);
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.ruoyi.mtragent.service;
|
||||
|
||||
|
||||
import com.ruoyi.mtragent.domain.RmNetworkInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Service接口
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface IRmNetworkInterfaceService
|
||||
{
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息集合
|
||||
*/
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface);
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的客户端网络接口信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRmNetworkInterfaceById(Long id);
|
||||
|
||||
/**
|
||||
* 绑定公网ip
|
||||
* @param rmNetworkInterface
|
||||
* @return
|
||||
*/
|
||||
int bindPublicIp(RmNetworkInterface rmNetworkInterface);
|
||||
|
||||
/**
|
||||
* 更新路由信息
|
||||
* @param clientId
|
||||
*/
|
||||
void updateRouteMsg(String clientId);
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.mtragent.domain.InitialHeartbeatListenLog;
|
||||
import com.ruoyi.mtragent.mapper.InitialHeartbeatListenLogMapper;
|
||||
import com.ruoyi.mtragent.service.IInitialHeartbeatListenLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 心跳信息日志Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-09-08
|
||||
*/
|
||||
@Service
|
||||
public class InitialHeartbeatListenLogServiceImpl implements IInitialHeartbeatListenLogService
|
||||
{
|
||||
@Autowired
|
||||
private InitialHeartbeatListenLogMapper initialHeartbeatListenLogMapper;
|
||||
|
||||
/**
|
||||
* 查询心跳信息日志
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 心跳信息日志
|
||||
*/
|
||||
@Override
|
||||
public InitialHeartbeatListenLog selectInitialHeartbeatListenLogByClientId(String clientId)
|
||||
{
|
||||
return initialHeartbeatListenLogMapper.selectInitialHeartbeatListenLogByClientId(clientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询心跳信息日志列表
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 心跳信息日志
|
||||
*/
|
||||
@Override
|
||||
public List<InitialHeartbeatListenLog> selectInitialHeartbeatListenLogList(InitialHeartbeatListenLog initialHeartbeatListenLog)
|
||||
{
|
||||
return initialHeartbeatListenLogMapper.selectInitialHeartbeatListenLogList(initialHeartbeatListenLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog)
|
||||
{
|
||||
initialHeartbeatListenLog.setCreateTime(DateUtils.getNowDate());
|
||||
return initialHeartbeatListenLogMapper.insertInitialHeartbeatListenLog(initialHeartbeatListenLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改心跳信息日志
|
||||
*
|
||||
* @param initialHeartbeatListenLog 心跳信息日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateInitialHeartbeatListenLog(InitialHeartbeatListenLog initialHeartbeatListenLog)
|
||||
{
|
||||
initialHeartbeatListenLog.setUpdateTime(DateUtils.getNowDate());
|
||||
return initialHeartbeatListenLogMapper.updateInitialHeartbeatListenLog(initialHeartbeatListenLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除心跳信息日志
|
||||
*
|
||||
* @param clientIds 需要删除的心跳信息日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInitialHeartbeatListenLogByClientIds(String[] clientIds)
|
||||
{
|
||||
return initialHeartbeatListenLogMapper.deleteInitialHeartbeatListenLogByClientIds(clientIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除心跳信息日志信息
|
||||
*
|
||||
* @param clientId 心跳信息日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteInitialHeartbeatListenLogByClientId(String clientId)
|
||||
{
|
||||
return initialHeartbeatListenLogMapper.deleteInitialHeartbeatListenLogByClientId(clientId);
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.mtragent.domain.RmAlarmLog;
|
||||
import com.ruoyi.mtragent.mapper.RmAlarmLogMapper;
|
||||
import com.ruoyi.mtragent.service.IRmAlarmLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户端告警信息Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-10
|
||||
*/
|
||||
@Service
|
||||
public class RmAlarmLogServiceImpl implements IRmAlarmLogService
|
||||
{
|
||||
@Autowired
|
||||
private RmAlarmLogMapper rmAlarmLogMapper;
|
||||
|
||||
/**
|
||||
* 查询客户端告警信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 客户端告警信息
|
||||
*/
|
||||
@Override
|
||||
public RmAlarmLog selectRmAlarmLogById(Long id)
|
||||
{
|
||||
return rmAlarmLogMapper.selectRmAlarmLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户端告警信息列表
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 客户端告警信息
|
||||
*/
|
||||
@Override
|
||||
public List<RmAlarmLog> selectRmAlarmLogList(RmAlarmLog rmAlarmLog)
|
||||
{
|
||||
return rmAlarmLogMapper.selectRmAlarmLogList(rmAlarmLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmAlarmLog(RmAlarmLog rmAlarmLog)
|
||||
{
|
||||
rmAlarmLog.setCreateTime(DateUtils.getNowDate());
|
||||
return rmAlarmLogMapper.insertRmAlarmLog(rmAlarmLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户端告警信息
|
||||
*
|
||||
* @param rmAlarmLog 客户端告警信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmAlarmLog(RmAlarmLog rmAlarmLog)
|
||||
{
|
||||
rmAlarmLog.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmAlarmLogMapper.updateRmAlarmLog(rmAlarmLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户端告警信息
|
||||
*
|
||||
* @param ids 需要删除的客户端告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmAlarmLogByIds(Long[] ids)
|
||||
{
|
||||
return rmAlarmLogMapper.deleteRmAlarmLogByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户端告警信息信息
|
||||
*
|
||||
* @param id 客户端告警信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmAlarmLogById(Long id)
|
||||
{
|
||||
return rmAlarmLogMapper.deleteRmAlarmLogById(id);
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.mtragent.domain.RmAlarmPushConfig;
|
||||
import com.ruoyi.mtragent.mapper.RmAlarmPushConfigMapper;
|
||||
import com.ruoyi.mtragent.service.IRmAlarmPushConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警推送配置Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-11
|
||||
*/
|
||||
@Service
|
||||
public class RmAlarmPushConfigServiceImpl implements IRmAlarmPushConfigService
|
||||
{
|
||||
@Autowired
|
||||
private RmAlarmPushConfigMapper rmAlarmPushConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询告警推送配置
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 告警推送配置
|
||||
*/
|
||||
@Override
|
||||
public RmAlarmPushConfig selectRmAlarmPushConfigById(Long id)
|
||||
{
|
||||
return rmAlarmPushConfigMapper.selectRmAlarmPushConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询告警推送配置列表
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 告警推送配置
|
||||
*/
|
||||
@Override
|
||||
public List<RmAlarmPushConfig> selectRmAlarmPushConfigList(RmAlarmPushConfig rmAlarmPushConfig)
|
||||
{
|
||||
return rmAlarmPushConfigMapper.selectRmAlarmPushConfigList(rmAlarmPushConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig)
|
||||
{
|
||||
rmAlarmPushConfig.setCreateTime(DateUtils.getNowDate());
|
||||
return rmAlarmPushConfigMapper.insertRmAlarmPushConfig(rmAlarmPushConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改告警推送配置
|
||||
*
|
||||
* @param rmAlarmPushConfig 告警推送配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig)
|
||||
{
|
||||
rmAlarmPushConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmAlarmPushConfigMapper.updateRmAlarmPushConfig(rmAlarmPushConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除告警推送配置
|
||||
*
|
||||
* @param ids 需要删除的告警推送配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmAlarmPushConfigByIds(Long[] ids)
|
||||
{
|
||||
return rmAlarmPushConfigMapper.deleteRmAlarmPushConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除告警推送配置信息
|
||||
*
|
||||
* @param id 告警推送配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmAlarmPushConfigById(Long id)
|
||||
{
|
||||
return rmAlarmPushConfigMapper.deleteRmAlarmPushConfigById(id);
|
||||
}
|
||||
}
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.core.enums.MsgEnum;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.mtragent.domain.DeviceMessage;
|
||||
import com.ruoyi.mtragent.domain.RmMtrClientRegistration;
|
||||
import com.ruoyi.mtragent.domain.vo.AgentUpdateMsgVo;
|
||||
import com.ruoyi.mtragent.domain.vo.PolicyTypeVo;
|
||||
import com.ruoyi.mtragent.domain.vo.PolicyVo;
|
||||
import com.ruoyi.mtragent.mapper.RmMtrClientRegistrationMapper;
|
||||
import com.ruoyi.mtragent.model.ProducerMode;
|
||||
import com.ruoyi.mtragent.producer.MessageProducer;
|
||||
import com.ruoyi.mtragent.service.IRmMtrClientRegistrationService;
|
||||
import com.ruoyi.system.api.domain.NetworkInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* MTR客户端注册Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RmMtrClientRegistrationServiceImpl implements IRmMtrClientRegistrationService
|
||||
{
|
||||
@Autowired
|
||||
private RmMtrClientRegistrationMapper rmMtrClientRegistrationMapper;
|
||||
@Autowired
|
||||
private ProducerMode producerMode;
|
||||
|
||||
/**
|
||||
* 查询MTR客户端注册
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return MTR客户端注册
|
||||
*/
|
||||
@Override
|
||||
public RmMtrClientRegistration selectRmMtrClientRegistrationById(Long id)
|
||||
{
|
||||
RmMtrClientRegistration rmMtrClientRegistration = rmMtrClientRegistrationMapper.selectRmMtrClientRegistrationById(id);
|
||||
// 处理网卡信息
|
||||
setNetworkMsg(rmMtrClientRegistration);
|
||||
return rmMtrClientRegistration;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询MTR客户端注册列表
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return MTR客户端注册
|
||||
*/
|
||||
@Override
|
||||
public List<RmMtrClientRegistration> selectRmMtrClientRegistrationList(RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
List<RmMtrClientRegistration> list = rmMtrClientRegistrationMapper.selectRmMtrClientRegistrationList(rmMtrClientRegistration);
|
||||
for (RmMtrClientRegistration mtrClientRegistration : list) {
|
||||
// 处理网卡信息
|
||||
setNetworkMsg(rmMtrClientRegistration);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网卡信息处理
|
||||
* @param rmMtrClientRegistration
|
||||
*/
|
||||
public void setNetworkMsg(RmMtrClientRegistration rmMtrClientRegistration){
|
||||
String networkMsg = rmMtrClientRegistration.getNetworkInfo();
|
||||
StringJoiner resultJoiner = new StringJoiner(";");
|
||||
if(networkMsg != null){
|
||||
List<NetworkInfo> networkInfoList = JSONObject.parseArray(networkMsg, NetworkInfo.class);
|
||||
for (NetworkInfo networkInfo : networkInfoList) {
|
||||
String name = networkInfo.getName() != null ? networkInfo.getName() : "";
|
||||
String mac = networkInfo.getMac() != null ? networkInfo.getMac() : "";
|
||||
String type = networkInfo.getType() != null ? networkInfo.getType() : "";
|
||||
String ipv4 = networkInfo.getIpv4() != null ? networkInfo.getIpv4() : "";
|
||||
// 单个对象的字段用逗号隔开
|
||||
StringJoiner objectJoiner = new StringJoiner(",");
|
||||
objectJoiner.add("接口名称:" + name)
|
||||
.add("MAC地址:" + mac)
|
||||
.add("接口类型:" + type)
|
||||
.add("IPv4地址:" + ipv4);
|
||||
resultJoiner.add(objectJoiner.toString());
|
||||
}
|
||||
rmMtrClientRegistration.setNetworkInfo(resultJoiner.toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 新增MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
rmMtrClientRegistration.setCreateTime(DateUtils.getNowDate());
|
||||
return rmMtrClientRegistrationMapper.insertRmMtrClientRegistration(rmMtrClientRegistration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改MTR客户端注册
|
||||
*
|
||||
* @param rmMtrClientRegistration MTR客户端注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmMtrClientRegistration(RmMtrClientRegistration rmMtrClientRegistration)
|
||||
{
|
||||
rmMtrClientRegistration.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmMtrClientRegistrationMapper.updateRmMtrClientRegistration(rmMtrClientRegistration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除MTR客户端注册
|
||||
*
|
||||
* @param ids 需要删除的MTR客户端注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmMtrClientRegistrationByIds(Long[] ids)
|
||||
{
|
||||
return rmMtrClientRegistrationMapper.deleteRmMtrClientRegistrationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除MTR客户端注册信息
|
||||
*
|
||||
* @param id MTR客户端注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmMtrClientRegistrationById(Long id)
|
||||
{
|
||||
return rmMtrClientRegistrationMapper.deleteRmMtrClientRegistrationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置更新策略
|
||||
* @param rmMtrClientRegistration
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int addAgentUpdatePolicy(RmMtrClientRegistration rmMtrClientRegistration) {
|
||||
String mtrClientIdStr = rmMtrClientRegistration.getMtrClientIds();
|
||||
String[] mtrClientIdArr = mtrClientIdStr.split("\n");
|
||||
|
||||
// 只提取公共变量
|
||||
String method = rmMtrClientRegistration.getMethod();
|
||||
String fileMd5 = rmMtrClientRegistration.getFileMd5();
|
||||
String filePath = rmMtrClientRegistration.getFilePath();
|
||||
Date scheduledUpdateTime = rmMtrClientRegistration.getScheduledUpdateTime();
|
||||
|
||||
for (String mtrClientId : mtrClientIdArr) {
|
||||
// 配置更新参数
|
||||
RmMtrClientRegistration updateData = new RmMtrClientRegistration();
|
||||
updateData.setMtrClientId(mtrClientId);
|
||||
updateData.setMethod(method);
|
||||
updateData.setFileMd5(fileMd5);
|
||||
updateData.setFilePath(filePath);
|
||||
updateData.setScheduledUpdateTime(scheduledUpdateTime);
|
||||
if("0".equals(method)){
|
||||
updateData.setScheduledUpdateTime(null);
|
||||
}
|
||||
rmMtrClientRegistrationMapper.updateRmMtrClientRegistration(updateData);
|
||||
// 构建更新策略
|
||||
AgentUpdateMsgVo agentUpdateMsgVo = new AgentUpdateMsgVo();
|
||||
agentUpdateMsgVo.setFileUrl(filePath);
|
||||
agentUpdateMsgVo.setFileMd5(fileMd5);
|
||||
agentUpdateMsgVo.setMethod(Integer.valueOf(method));
|
||||
if("1".equals(method)){
|
||||
Date scheduledUpdateTimeInner = scheduledUpdateTime;
|
||||
long scheduledTime = scheduledUpdateTimeInner.toInstant().getEpochSecond();
|
||||
agentUpdateMsgVo.setPolicyTime(scheduledTime);
|
||||
}
|
||||
try {
|
||||
PolicyVo<AgentUpdateMsgVo> policyVo = new PolicyVo();
|
||||
List<AgentUpdateMsgVo> list = new ArrayList<>();
|
||||
list.add(agentUpdateMsgVo);
|
||||
policyVo.setContents(list);
|
||||
String policyVoStr = JSONObject.toJSONString(policyVo);
|
||||
PolicyTypeVo policyTypeVo = new PolicyTypeVo();
|
||||
policyTypeVo.setVersions(policyVoStr);
|
||||
String configJson = JSONObject.toJSONString(policyTypeVo);
|
||||
DeviceMessage deviceMessage = new DeviceMessage();
|
||||
deviceMessage.setClientId(mtrClientId);
|
||||
deviceMessage.setDataType(MsgEnum.获取最新策略应答.getValue());
|
||||
deviceMessage.setData(configJson);
|
||||
MessageProducer messageProducer = new MessageProducer();
|
||||
|
||||
messageProducer.sendAsyncProducerMessage(
|
||||
producerMode.getAgentTopic(),
|
||||
"",
|
||||
"",
|
||||
JSONObject.toJSONString(deviceMessage)
|
||||
);
|
||||
} catch (Exception e) {
|
||||
log.error("发送设备配置失败,deviceId: {}", mtrClientId, e);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.mtragent.domain.RmMtrPolicyConfig;
|
||||
import com.ruoyi.mtragent.mapper.RmMtrPolicyConfigMapper;
|
||||
import com.ruoyi.mtragent.service.IRmMtrPolicyConfigService;
|
||||
import com.ruoyi.system.api.RemoteRocketMqService;
|
||||
import com.ruoyi.system.api.domain.RmNetworkInterfaceRemote;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* mtr探测策略配置Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Service
|
||||
public class RmMtrPolicyConfigServiceImpl implements IRmMtrPolicyConfigService
|
||||
{
|
||||
@Autowired
|
||||
private RmMtrPolicyConfigMapper rmMtrPolicyConfigMapper;
|
||||
@Autowired
|
||||
private RemoteRocketMqService remoteRocketMqService;
|
||||
|
||||
/**
|
||||
* 查询mtr探测策略配置
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return mtr探测策略配置
|
||||
*/
|
||||
@Override
|
||||
public RmMtrPolicyConfig selectRmMtrPolicyConfigById(Long id)
|
||||
{
|
||||
RmMtrPolicyConfig mtrPolicyConfig = rmMtrPolicyConfigMapper.selectRmMtrPolicyConfigById(id);
|
||||
mtrPolicyConfig.setServerGroup(mtrPolicyConfig.getServerGroup().replace("\n", ";"));
|
||||
return mtrPolicyConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询mtr探测策略配置列表
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return mtr探测策略配置
|
||||
*/
|
||||
@Override
|
||||
public List<RmMtrPolicyConfig> selectRmMtrPolicyConfigList(RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
List<RmMtrPolicyConfig> list = rmMtrPolicyConfigMapper.selectRmMtrPolicyConfigList(rmMtrPolicyConfig);
|
||||
for (RmMtrPolicyConfig mtrPolicyConfig : list) {
|
||||
mtrPolicyConfig.setServerGroup(mtrPolicyConfig.getServerGroup().replace("\n", ";"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 辅助方法,给ip集合赋值
|
||||
* @param mtrPolicyConfig
|
||||
*/
|
||||
public void setServerip(RmMtrPolicyConfig mtrPolicyConfig){
|
||||
StringJoiner resultJoiner = new StringJoiner(";");
|
||||
String serverGroupStr = mtrPolicyConfig.getServerGroup().replace("\n",",");
|
||||
RmNetworkInterfaceRemote query = new RmNetworkInterfaceRemote();
|
||||
query.setClientIds(serverGroupStr);
|
||||
R<List<RmNetworkInterfaceRemote>> networkList = remoteRocketMqService.getNetworkInterfaceList(query, SecurityConstants.INNER);
|
||||
if(networkList != null && networkList.getData() != null){
|
||||
List<RmNetworkInterfaceRemote> rmNetworkInterfaceRemoteList = networkList.getData();
|
||||
if(!rmNetworkInterfaceRemoteList.isEmpty()){
|
||||
for (RmNetworkInterfaceRemote rmNetworkInterfaceRemote : rmNetworkInterfaceRemoteList) {
|
||||
String publicIp = rmNetworkInterfaceRemote.getPublicIp();
|
||||
resultJoiner.add(publicIp);
|
||||
}
|
||||
mtrPolicyConfig.setServeripGroup(resultJoiner.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
rmMtrPolicyConfig.setCreateTime(DateUtils.getNowDate());
|
||||
rmMtrPolicyConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
rmMtrPolicyConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
// 给ip赋值
|
||||
setServerip(rmMtrPolicyConfig);
|
||||
int rows = rmMtrPolicyConfigMapper.insertRmMtrPolicyConfig(rmMtrPolicyConfig);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改mtr探测策略配置
|
||||
*
|
||||
* @param rmMtrPolicyConfig mtr探测策略配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmMtrPolicyConfig(RmMtrPolicyConfig rmMtrPolicyConfig)
|
||||
{
|
||||
rmMtrPolicyConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmMtrPolicyConfigMapper.updateRmMtrPolicyConfig(rmMtrPolicyConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除mtr探测策略配置
|
||||
*
|
||||
* @param ids 需要删除的mtr探测策略配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmMtrPolicyConfigByIds(Long[] ids)
|
||||
{
|
||||
return rmMtrPolicyConfigMapper.deleteRmMtrPolicyConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除mtr探测策略配置信息
|
||||
*
|
||||
* @param id mtr探测策略配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmMtrPolicyConfigById(Long id)
|
||||
{
|
||||
return rmMtrPolicyConfigMapper.deleteRmMtrPolicyConfigById(id);
|
||||
}
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
package com.ruoyi.mtragent.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.core.enums.MsgEnum;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.mtragent.domain.DeviceMessage;
|
||||
import com.ruoyi.mtragent.domain.RmNetworkInterface;
|
||||
import com.ruoyi.mtragent.domain.vo.PolicyTypeVo;
|
||||
import com.ruoyi.mtragent.mapper.RmNetworkInterfaceMapper;
|
||||
import com.ruoyi.mtragent.model.ProducerMode;
|
||||
import com.ruoyi.mtragent.producer.MessageProducer;
|
||||
import com.ruoyi.mtragent.service.IRmNetworkInterfaceService;
|
||||
import com.ruoyi.system.api.domain.RouteMsg;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 客户端网络接口信息Service业务层处理
|
||||
*
|
||||
* @author gyt
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@Service
|
||||
public class RmNetworkInterfaceServiceImpl implements IRmNetworkInterfaceService
|
||||
{
|
||||
@Autowired
|
||||
private RmNetworkInterfaceMapper rmNetworkInterfaceMapper;
|
||||
@Autowired
|
||||
private ProducerMode producerMode;
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
@Override
|
||||
public RmNetworkInterface selectRmNetworkInterfaceById(Long id)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户端网络接口信息列表
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 客户端网络接口信息
|
||||
*/
|
||||
@Override
|
||||
public List<RmNetworkInterface> selectRmNetworkInterfaceList(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
rmNetworkInterface.setCreateTime(DateUtils.getNowDate());
|
||||
return rmNetworkInterfaceMapper.insertRmNetworkInterface(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户端网络接口信息
|
||||
*
|
||||
* @param rmNetworkInterface 客户端网络接口信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRmNetworkInterface(RmNetworkInterface rmNetworkInterface)
|
||||
{
|
||||
rmNetworkInterface.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmNetworkInterfaceMapper.updateRmNetworkInterface(rmNetworkInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRmNetworkInterfaceByMac(RmNetworkInterface rmNetworkInterface) {
|
||||
rmNetworkInterface.setUpdateTime(DateUtils.getNowDate());
|
||||
return rmNetworkInterfaceMapper.updateRmNetworkInterfaceByMac(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户端网络接口信息
|
||||
*
|
||||
* @param ids 需要删除的客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmNetworkInterfaceByIds(Long[] ids)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户端网络接口信息信息
|
||||
*
|
||||
* @param id 客户端网络接口信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRmNetworkInterfaceById(Long id)
|
||||
{
|
||||
return rmNetworkInterfaceMapper.deleteRmNetworkInterfaceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定公网ip
|
||||
* @param rmNetworkInterface
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int bindPublicIp(RmNetworkInterface rmNetworkInterface) {
|
||||
return rmNetworkInterfaceMapper.updateRmNetworkInterface(rmNetworkInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新路由信息
|
||||
* @param clientId
|
||||
*/
|
||||
public void updateRouteMsg(String clientId){
|
||||
MessageProducer messageProducer = new MessageProducer();
|
||||
// 查询路由是否有变化
|
||||
RmNetworkInterface rmNetworkInterface = new RmNetworkInterface();
|
||||
rmNetworkInterface.setClientId(clientId);
|
||||
rmNetworkInterface.setBindIp("2");
|
||||
List<RmNetworkInterface> networkInterfaces = rmNetworkInterfaceMapper.selectRmNetworkInterfaceList(rmNetworkInterface);
|
||||
if(!networkInterfaces.isEmpty()){
|
||||
List<RmNetworkInterface> oldList = networkInterfaces.stream()
|
||||
.filter(networkInterface -> networkInterface.getNewFlag() == 0)
|
||||
.collect(Collectors.toList());
|
||||
if(!oldList.isEmpty()){
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// 增加静态路由
|
||||
RmNetworkInterface oldMsg = oldList.get(0);
|
||||
RouteMsg oldRouteMsg = new RouteMsg();
|
||||
oldRouteMsg.setGateway(oldMsg.getGateway());
|
||||
oldRouteMsg.setName(oldMsg.getInterfaceName());
|
||||
resultMap.put("delRoute", oldRouteMsg);
|
||||
List<RmNetworkInterface> newList = networkInterfaces.stream()
|
||||
.filter(networkInterface -> networkInterface.getNewFlag() == 1)
|
||||
.collect(Collectors.toList());
|
||||
RmNetworkInterface newMsg = newList.get(0);
|
||||
RouteMsg newRouteMsg = new RouteMsg();
|
||||
newRouteMsg.setGateway(newMsg.getGateway());
|
||||
newRouteMsg.setName(newMsg.getInterfaceName());
|
||||
resultMap.put("addRoute", newRouteMsg);
|
||||
resultMap.put("upTime", Instant.now().getEpochSecond());
|
||||
PolicyTypeVo policyTypeVo = new PolicyTypeVo();
|
||||
policyTypeVo.setRoutes(JSONObject.toJSONString(resultMap));
|
||||
String configJson = JSONObject.toJSONString(policyTypeVo);
|
||||
// 构建发送消息
|
||||
DeviceMessage message = new DeviceMessage();
|
||||
message.setClientId(clientId);
|
||||
message.setData(configJson);
|
||||
message.setDataType(MsgEnum.获取最新策略应答.getValue());
|
||||
|
||||
messageProducer.sendAsyncProducerMessage(
|
||||
producerMode.getAgentTopic(),
|
||||
"",
|
||||
"",
|
||||
JSONObject.toJSONString(message)
|
||||
);
|
||||
// 更新网卡信息表
|
||||
RmNetworkInterface updateQuery = new RmNetworkInterface();
|
||||
updateQuery.setNewFlag(999);
|
||||
updateQuery.setMacAddress(networkInterfaces.get(0).getMacAddress());
|
||||
rmNetworkInterfaceMapper.updateRmNetworkInterfaceByMac(updateQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.InitialHeartbeatListenLogMapper">
|
||||
|
||||
<resultMap type="InitialHeartbeatListenLog" id="InitialHeartbeatListenLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialHeartbeatListenLogVo">
|
||||
select id, client_id, status, remark, create_time, update_time, create_by, update_by from initial_heartbeat_listen_log
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialHeartbeatListenLogList" parameterType="InitialHeartbeatListenLog" resultMap="InitialHeartbeatListenLogResult">
|
||||
<include refid="selectInitialHeartbeatListenLogVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialHeartbeatListenLogById" parameterType="Long" resultMap="InitialHeartbeatListenLogResult">
|
||||
<include refid="selectInitialHeartbeatListenLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialHeartbeatListenLog" parameterType="InitialHeartbeatListenLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_heartbeat_listen_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialHeartbeatListenLog" parameterType="InitialHeartbeatListenLog">
|
||||
update initial_heartbeat_listen_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialHeartbeatListenLogById" parameterType="Long">
|
||||
delete from initial_heartbeat_listen_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialHeartbeatListenLogByIds" parameterType="String">
|
||||
delete from initial_heartbeat_listen_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.RmAlarmLogMapper">
|
||||
|
||||
<resultMap type="RmAlarmLog" id="RmAlarmLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="alarmTime" column="alarm_time" />
|
||||
<result property="mgmPublicIp" column="mgm_public_ip" />
|
||||
<result property="alarmType" column="alarm_type" />
|
||||
<result property="alarmContent" column="alarm_content" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmAlarmLogVo">
|
||||
select id, client_id, alarm_time, mgm_public_ip, alarm_type, alarm_content, create_time, update_time, create_by, update_by from rm_alarm_log
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmLogList" parameterType="RmAlarmLog" resultMap="RmAlarmLogResult">
|
||||
<include refid="selectRmAlarmLogVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>
|
||||
<if test="mgmPublicIp != null and mgmPublicIp != ''"> and mgm_public_ip = #{mgmPublicIp}</if>
|
||||
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
|
||||
<if test="alarmContent != null and alarmContent != ''"> and alarm_content = #{alarmContent}</if>
|
||||
</where>
|
||||
order by alarm_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmLogById" parameterType="Long" resultMap="RmAlarmLogResult">
|
||||
<include refid="selectRmAlarmLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmLog" parameterType="RmAlarmLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="alarmTime != null">alarm_time,</if>
|
||||
<if test="mgmPublicIp != null">mgm_public_ip,</if>
|
||||
<if test="alarmType != null">alarm_type,</if>
|
||||
<if test="alarmContent != null">alarm_content,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="alarmTime != null">#{alarmTime},</if>
|
||||
<if test="mgmPublicIp != null">#{mgmPublicIp},</if>
|
||||
<if test="alarmType != null">#{alarmType},</if>
|
||||
<if test="alarmContent != null">#{alarmContent},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmAlarmLog" parameterType="RmAlarmLog">
|
||||
update rm_alarm_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mgmPublicIp != null">mgm_public_ip = #{mgmPublicIp},</if>
|
||||
<if test="alarmContent != null">alarm_content = #{alarmContent},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<choose>
|
||||
<when test="id != null">
|
||||
and id = #[id]
|
||||
</when>
|
||||
<when test="clientId != null and alarmType != null">
|
||||
and client_id = #{clientId} and alarm_type = #{alarmType}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1=0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmAlarmLogById" parameterType="Long">
|
||||
delete from rm_alarm_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmLogByIds" parameterType="String">
|
||||
delete from rm_alarm_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.RmAlarmPushConfigMapper">
|
||||
|
||||
<resultMap type="RmAlarmPushConfig" id="RmAlarmPushConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="pushMethod" column="push_method" />
|
||||
<result property="pushAddress" column="push_address" />
|
||||
<result property="pushAlarmTypes" column="push_alarm_types" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="contactPhones" column="contact_phones" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmAlarmPushConfigVo">
|
||||
select id, config_name, push_method, push_address, push_alarm_types, message_content, contact_phones, create_time, update_time, create_by, update_by from rm_alarm_push_config
|
||||
</sql>
|
||||
|
||||
<select id="selectRmAlarmPushConfigList" parameterType="RmAlarmPushConfig" resultMap="RmAlarmPushConfigResult">
|
||||
<include refid="selectRmAlarmPushConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''"> and config_name like concat('%', #{configName}, '%')</if>
|
||||
<if test="pushMethod != null and pushMethod != ''"> and push_method = #{pushMethod}</if>
|
||||
<if test="pushAddress != null and pushAddress != ''"> and push_address = #{pushAddress}</if>
|
||||
<if test="pushAlarmTypes != null and pushAlarmTypes != ''"> and push_alarm_types = #{pushAlarmTypes}</if>
|
||||
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
|
||||
<if test="contactPhones != null and contactPhones != ''"> and contact_phones = #{contactPhones}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmAlarmPushConfigById" parameterType="Long" resultMap="RmAlarmPushConfigResult">
|
||||
<include refid="selectRmAlarmPushConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmAlarmPushConfig" parameterType="RmAlarmPushConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_alarm_push_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="configName != null and configName != ''">config_name,</if>
|
||||
<if test="pushMethod != null and pushMethod != ''">push_method,</if>
|
||||
<if test="pushAddress != null and pushAddress != ''">push_address,</if>
|
||||
<if test="pushAlarmTypes != null">push_alarm_types,</if>
|
||||
<if test="messageContent != null">message_content,</if>
|
||||
<if test="contactPhones != null">contact_phones,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="pushMethod != null and pushMethod != ''">#{pushMethod},</if>
|
||||
<if test="pushAddress != null and pushAddress != ''">#{pushAddress},</if>
|
||||
<if test="pushAlarmTypes != null">#{pushAlarmTypes},</if>
|
||||
<if test="messageContent != null">#{messageContent},</if>
|
||||
<if test="contactPhones != null">#{contactPhones},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmAlarmPushConfig" parameterType="RmAlarmPushConfig">
|
||||
update rm_alarm_push_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="pushMethod != null and pushMethod != ''">push_method = #{pushMethod},</if>
|
||||
<if test="pushAddress != null and pushAddress != ''">push_address = #{pushAddress},</if>
|
||||
<if test="pushAlarmTypes != null">push_alarm_types = #{pushAlarmTypes},</if>
|
||||
<if test="messageContent != null">message_content = #{messageContent},</if>
|
||||
<if test="contactPhones != null">contact_phones = #{contactPhones},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmAlarmPushConfigById" parameterType="Long">
|
||||
delete from rm_alarm_push_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmAlarmPushConfigByIds" parameterType="String">
|
||||
delete from rm_alarm_push_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.RmMtrClientRegistrationMapper">
|
||||
|
||||
<resultMap type="RmMtrClientRegistration" id="RmMtrClientRegistrationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mtrClientId" column="mtr_client_id" />
|
||||
<result property="description" column="description" />
|
||||
<result property="version" column="version" />
|
||||
<result property="logicalNode" column="logical_node" />
|
||||
<result property="registerTime" column="register_time" />
|
||||
<result property="registerStatus" column="register_status" />
|
||||
<result property="onlineStatus" column="online_status" />
|
||||
<result property="heartbeatInterval" column="heartbeat_interval" />
|
||||
<result property="heartbeatCount" column="heartbeat_count" />
|
||||
<result property="method" column="method" />
|
||||
<result property="scheduledUpdateTime" column="scheduled_update_time" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileMd5" column="file_md5" />
|
||||
<result property="lastUpdateResult" column="last_update_result" />
|
||||
<result property="lastUpdateTime" column="last_update_time" />
|
||||
<result property="networkInfo" column="network_info" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmMtrClientRegistrationVo">
|
||||
select id, mtr_client_id, description, version, logical_node, register_time, register_status, online_status, heartbeat_interval, heartbeat_count, method, scheduled_update_time, file_path, file_md5, last_update_result, last_update_time, network_info, create_time, update_time, create_by, update_by from rm_mtr_client_registration
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMtrClientRegistrationList" parameterType="RmMtrClientRegistration" resultMap="RmMtrClientRegistrationResult">
|
||||
<include refid="selectRmMtrClientRegistrationVo"/>
|
||||
<where>
|
||||
<if test="mtrClientId != null and mtrClientId != ''"> and mtr_client_id = #{mtrClientId}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="version != null and version != ''"> and version = #{version}</if>
|
||||
<if test="logicalNode != null and logicalNode != ''"> and logical_node = #{logicalNode}</if>
|
||||
<if test="registerTime != null "> and register_time = #{registerTime}</if>
|
||||
<if test="registerStatus != null and registerStatus != ''"> and register_status = #{registerStatus}</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''"> and online_status = #{onlineStatus}</if>
|
||||
<if test="heartbeatInterval != null "> and heartbeat_interval = #{heartbeatInterval}</if>
|
||||
<if test="heartbeatCount != null "> and heartbeat_count = #{heartbeatCount}</if>
|
||||
<if test="method != null and method != ''"> and method = #{method}</if>
|
||||
<if test="scheduledUpdateTime != null and scheduledUpdateTime != ''"> and scheduled_update_time = #{scheduledUpdateTime}</if>
|
||||
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
|
||||
<if test="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
|
||||
<if test="lastUpdateResult != null and lastUpdateResult != ''"> and last_update_result = #{lastUpdateResult}</if>
|
||||
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
|
||||
<if test="networkInfo != null and networkInfo != ''"> and network_info = #{networkInfo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmMtrClientRegistrationById" parameterType="Long" resultMap="RmMtrClientRegistrationResult">
|
||||
<include refid="selectRmMtrClientRegistrationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmMtrClientRegistration" parameterType="RmMtrClientRegistration" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_mtr_client_registration
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="version != null and version != ''">version,</if>
|
||||
<if test="logicalNode != null">logical_node,</if>
|
||||
<if test="registerTime != null">register_time,</if>
|
||||
<if test="registerStatus != null and registerStatus != ''">register_status,</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status,</if>
|
||||
<if test="heartbeatInterval != null">heartbeat_interval,</if>
|
||||
<if test="heartbeatCount != null">heartbeat_count,</if>
|
||||
<if test="method != null">method,</if>
|
||||
<if test="scheduledUpdateTime != null">scheduled_update_time,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileMd5 != null">file_md5,</if>
|
||||
<if test="lastUpdateResult != null">last_update_result,</if>
|
||||
<if test="lastUpdateTime != null">last_update_time,</if>
|
||||
<if test="networkInfo != null">network_info,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mtrClientId != null and mtrClientId != ''">#{mtrClientId},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="version != null and version != ''">#{version},</if>
|
||||
<if test="logicalNode != null">#{logicalNode},</if>
|
||||
<if test="registerTime != null">#{registerTime},</if>
|
||||
<if test="registerStatus != null and registerStatus != ''">#{registerStatus},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">#{onlineStatus},</if>
|
||||
<if test="heartbeatInterval != null">#{heartbeatInterval},</if>
|
||||
<if test="heartbeatCount != null">#{heartbeatCount},</if>
|
||||
<if test="method != null">#{method},</if>
|
||||
<if test="scheduledUpdateTime != null">#{scheduledUpdateTime},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileMd5 != null">#{fileMd5},</if>
|
||||
<if test="lastUpdateResult != null">#{lastUpdateResult},</if>
|
||||
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
|
||||
<if test="networkInfo != null">#{networkInfo},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmMtrClientRegistration" parameterType="RmMtrClientRegistration">
|
||||
update rm_mtr_client_registration
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id = #{mtrClientId},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="version != null and version != ''">version = #{version},</if>
|
||||
<if test="logicalNode != null">logical_node = #{logicalNode},</if>
|
||||
<if test="registerTime != null">register_time = #{registerTime},</if>
|
||||
<if test="registerStatus != null and registerStatus != ''">register_status = #{registerStatus},</if>
|
||||
<if test="onlineStatus != null and onlineStatus != ''">online_status = #{onlineStatus},</if>
|
||||
<if test="heartbeatInterval != null">heartbeat_interval = #{heartbeatInterval},</if>
|
||||
<if test="heartbeatCount != null">heartbeat_count = #{heartbeatCount},</if>
|
||||
<if test="method != null">method = #{method},</if>
|
||||
<if test="scheduledUpdateTime != null">scheduled_update_time = #{scheduledUpdateTime},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileMd5 != null">file_md5 = #{fileMd5},</if>
|
||||
<if test="lastUpdateResult != null">last_update_result = #{lastUpdateResult},</if>
|
||||
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</if>
|
||||
<if test="networkInfo != null">network_info = #{networkInfo},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<choose>
|
||||
<when test="id != null">
|
||||
and id=#{id}
|
||||
</when>
|
||||
<when test="mtrClientId">
|
||||
and mtr_client_id = #{mtrClientId}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1=0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmMtrClientRegistrationById" parameterType="Long">
|
||||
delete from rm_mtr_client_registration where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmMtrClientRegistrationByIds" parameterType="String">
|
||||
delete from rm_mtr_client_registration where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.RmMtrPolicyConfigMapper">
|
||||
|
||||
<resultMap type="RmMtrPolicyConfig" id="RmMtrPolicyConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="policyName" column="policy_name" />
|
||||
<result property="priority" column="priority" />
|
||||
<result property="mtrClientId" column="mtr_client_id" />
|
||||
<result property="serverGroup" column="server_group" />
|
||||
<result property="serveripGroup" column="serverip_group" />
|
||||
<result property="probeFlag" column="probe_flag" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="probeFrequency" column="probe_frequency" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmMtrPolicyConfigVo">
|
||||
select id, policy_name, priority, mtr_client_id, server_group, serverip_group, probe_flag, start_time, end_time, probe_frequency, create_time, update_time, create_by, update_by from rm_mtr_policy_config
|
||||
</sql>
|
||||
|
||||
<select id="selectRmMtrPolicyConfigList" parameterType="RmMtrPolicyConfig" resultMap="RmMtrPolicyConfigResult">
|
||||
<include refid="selectRmMtrPolicyConfigVo"/>
|
||||
<where>
|
||||
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="mtrClientId != null and mtrClientId != ''"> and mtr_client_id = #{mtrClientId}</if>
|
||||
<if test="serverGroup != null and serverGroup != ''"> and server_group = #{serverGroup}</if>
|
||||
<if test="serveripGroup != null and serveripGroup != ''"> and serverip_group = #{serveripGroup}</if>
|
||||
<if test="probeFlag != null "> and probe_flag = #{probeFlag}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="probeFrequency != null "> and probe_frequency = #{probeFrequency}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmMtrPolicyConfigById" parameterType="Long" resultMap="RmMtrPolicyConfigResult">
|
||||
<include refid="selectRmMtrPolicyConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmMtrPolicyConfig" parameterType="RmMtrPolicyConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_mtr_policy_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">policy_name,</if>
|
||||
<if test="priority != null">priority,</if>
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id,</if>
|
||||
<if test="serverGroup != null">server_group,</if>
|
||||
<if test="serveripGroup != null">serverip_group,</if>
|
||||
<if test="probeFlag != null">probe_flag,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="probeFrequency != null">probe_frequency,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">#{policyName},</if>
|
||||
<if test="priority != null">#{priority},</if>
|
||||
<if test="mtrClientId != null and mtrClientId != ''">#{mtrClientId},</if>
|
||||
<if test="serverGroup != null">#{serverGroup},</if>
|
||||
<if test="serveripGroup != null">#{serveripGroup},</if>
|
||||
<if test="probeFlag != null">#{probeFlag},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="probeFrequency != null">#{probeFrequency},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmMtrPolicyConfig" parameterType="RmMtrPolicyConfig">
|
||||
update rm_mtr_policy_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="policyName != null and policyName != ''">policy_name = #{policyName},</if>
|
||||
<if test="priority != null">priority = #{priority},</if>
|
||||
<if test="mtrClientId != null and mtrClientId != ''">mtr_client_id = #{mtrClientId},</if>
|
||||
<if test="serverGroup != null">server_group = #{serverGroup},</if>
|
||||
<if test="serveripGroup != null">serverip_group = #{serveripGroup},</if>
|
||||
<if test="probeFlag != null">probe_flag = #{probeFlag},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="probeFrequency != null">probe_frequency = #{probeFrequency},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmMtrPolicyConfigById" parameterType="Long">
|
||||
delete from rm_mtr_policy_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmMtrPolicyConfigByIds" parameterType="String">
|
||||
delete from rm_mtr_policy_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mtragent.mapper.RmNetworkInterfaceMapper">
|
||||
|
||||
<resultMap type="RmNetworkInterface" id="RmNetworkInterfaceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="isp" column="isp" />
|
||||
<result property="province" column="province" />
|
||||
<result property="city" column="city" />
|
||||
<result property="publicIp" column="public_ip" />
|
||||
<result property="interfaceName" column="interface_name" />
|
||||
<result property="macAddress" column="mac_address" />
|
||||
<result property="interfaceType" column="interface_type" />
|
||||
<result property="ipv4Address" column="ipv4_address" />
|
||||
<result property="gateway" column="gateway" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="bindIp" column="bind_ip" />
|
||||
<result property="newFlag" column="new_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmNetworkInterfaceVo">
|
||||
select id, client_id, isp, province, city, public_ip, interface_name, mac_address, interface_type, ipv4_address, gateway, create_time, update_time, create_by, update_by, bind_ip, new_flag from rm_network_interface
|
||||
</sql>
|
||||
|
||||
<select id="selectRmNetworkInterfaceList" parameterType="RmNetworkInterface" resultMap="RmNetworkInterfaceResult">
|
||||
<include refid="selectRmNetworkInterfaceVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="isp != null and isp != ''"> and isp = #{isp}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="city != null and city != ''"> and city = #{city}</if>
|
||||
<if test="publicIp != null and publicIp != ''"> and public_ip = #{publicIp}</if>
|
||||
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
|
||||
<if test="macAddress != null and macAddress != ''"> and mac_address = #{macAddress}</if>
|
||||
<if test="interfaceType != null and interfaceType != ''"> and interface_type = #{interfaceType}</if>
|
||||
<if test="ipv4Address != null and ipv4Address != ''"> and ipv4_address = #{ipv4Address}</if>
|
||||
<if test="gateway != null and gateway != ''"> and gateway = #{gateway}</if>
|
||||
<if test="bindIp != null and bindIp != ''"> and bind_ip = #{bindIp}</if>
|
||||
<if test="newFlag != null "> and new_flag = #{newFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRmNetworkInterfaceById" parameterType="Long" resultMap="RmNetworkInterfaceResult">
|
||||
<include refid="selectRmNetworkInterfaceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRmNetworkInterface" parameterType="RmNetworkInterface" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rm_network_interface
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id,</if>
|
||||
<if test="isp != null">isp,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="publicIp != null">public_ip,</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name,</if>
|
||||
<if test="macAddress != null">mac_address,</if>
|
||||
<if test="interfaceType != null">interface_type,</if>
|
||||
<if test="ipv4Address != null">ipv4_address,</if>
|
||||
<if test="gateway != null">gateway,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="bindIp != null">bind_ip,</if>
|
||||
<if test="newFlag != null">new_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">#{clientId},</if>
|
||||
<if test="isp != null">#{isp},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="publicIp != null">#{publicIp},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">#{interfaceName},</if>
|
||||
<if test="macAddress != null">#{macAddress},</if>
|
||||
<if test="interfaceType != null">#{interfaceType},</if>
|
||||
<if test="ipv4Address != null">#{ipv4Address},</if>
|
||||
<if test="gateway != null">#{gateway},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="bindIp != null">#{bindIp},</if>
|
||||
<if test="newFlag != null">#{newFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRmNetworkInterface" parameterType="RmNetworkInterface">
|
||||
update rm_network_interface
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
|
||||
<if test="isp != null">isp = #{isp},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="publicIp != null">public_ip = #{publicIp},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name = #{interfaceName},</if>
|
||||
<if test="macAddress != null">mac_address = #{macAddress},</if>
|
||||
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
|
||||
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
|
||||
<if test="gateway != null">gateway = #{gateway},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="bindIp != null">bind_ip = #{bindIp},</if>
|
||||
<if test="newFlag != null">new_flag = #{newFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRmNetworkInterfaceById" parameterType="Long">
|
||||
delete from rm_network_interface where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRmNetworkInterfaceByIds" parameterType="String">
|
||||
delete from rm_network_interface where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="updateRmNetworkInterfaceByMac" parameterType="RmNetworkInterface">
|
||||
update rm_network_interface
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="isp != null">isp = #{isp},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="publicIp != null">public_ip = #{publicIp},</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">interface_name = #{interfaceName},</if>
|
||||
<if test="macAddress != null">mac_address = #{macAddress},</if>
|
||||
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
|
||||
<if test="ipv4Address != null">ipv4_address = #{ipv4Address},</if>
|
||||
<if test="gateway != null">gateway = #{gateway},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="bindIp != null">bind_ip = #{bindIp},</if>
|
||||
<if test="newFlag != null">new_flag = #{newFlag},</if>
|
||||
</trim>
|
||||
where mac_address = #{macAddress} and clientId = #{clientId}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user