服务器自动注册
This commit is contained in:
+9
@@ -98,4 +98,13 @@ public interface RemoteRevenueConfigService
|
||||
@PostMapping("/switchManagement/getSwitchNameByClientId")
|
||||
public R<List<RmSwitchManagementRemote>> getSwitchNameByClientId(@RequestBody RmSwitchManagementRemote rmSwitchManagementRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 自动注册
|
||||
* @param rmRegisterMsgRemote
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/registration/innerAddRegist")
|
||||
public R<Integer> innerAddRegist(@RequestBody RmRegisterMsgRemote rmRegisterMsgRemote, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NetworkInfo {
|
||||
// 运营商
|
||||
@JsonProperty("carrier")
|
||||
private String carrier;
|
||||
// 市
|
||||
@JsonProperty("city")
|
||||
private String city;
|
||||
// 网关
|
||||
@JsonProperty("gateway")
|
||||
private String gateway;
|
||||
// IPv4 地址
|
||||
@JsonProperty("ipv4")
|
||||
private String ipv4;
|
||||
// MAC 地址
|
||||
@JsonProperty("mac")
|
||||
private String mac;
|
||||
// 接口名称:eth0, enp3s0
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
// 省
|
||||
@JsonProperty("province")
|
||||
private String province;
|
||||
// 公网 IP
|
||||
@JsonProperty("publicIp")
|
||||
private String publicIp;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RmRegisterMsgRemote {
|
||||
@JsonProperty("clientId")
|
||||
private String clientId;
|
||||
|
||||
@JsonProperty("sn")
|
||||
private String sn;
|
||||
|
||||
@JsonProperty("networkInfo")
|
||||
private List<NetworkInfo> networkInfo;
|
||||
|
||||
@JsonProperty("timestamp")
|
||||
private long timestamp;
|
||||
}
|
||||
+44
@@ -127,5 +127,49 @@ public class RmResourceRegistrationRemote extends BaseEntity
|
||||
private String monitorItems;
|
||||
/** 自动发现项 */
|
||||
private String discoveryRules;
|
||||
/**
|
||||
* 客户端ID
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 运营商
|
||||
*/
|
||||
private String operator;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 公网IP
|
||||
*/
|
||||
private String publicIp;
|
||||
|
||||
/**
|
||||
* 业务名称
|
||||
*/
|
||||
private String businessName;
|
||||
|
||||
/**
|
||||
* 逻辑节点标识
|
||||
*/
|
||||
private String logicalNodeId;
|
||||
|
||||
/**
|
||||
* 多公网IP状态
|
||||
*/
|
||||
private String multiPublicIpStatus;
|
||||
|
||||
/**
|
||||
* 心跳次数
|
||||
*/
|
||||
private Integer heartbeatCount;
|
||||
|
||||
/**
|
||||
* 心跳周期(单位:秒)
|
||||
*/
|
||||
private Integer heartbeatInterval;
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -71,6 +71,11 @@ public class RemoteRevenueConfigFallbackFactory implements FallbackFactory<Remot
|
||||
public R<List<RmSwitchManagementRemote>> getSwitchNameByClientId(RmSwitchManagementRemote rmSwitchManagementRemote, String source) {
|
||||
return R.fail("根据clientId获取交换机信息失败" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Integer> innerAddRegist(RmRegisterMsgRemote rmRegisterMsgRemote, String source) {
|
||||
return R.fail("自动注册失败" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user