|
@@ -11,6 +11,7 @@ import com.inspur.device.domain.constants.DeviceConstants;
|
|
|
import com.inspur.device.domain.vo.*;
|
|
import com.inspur.device.domain.vo.*;
|
|
|
import com.inspur.device.mapper.*;
|
|
import com.inspur.device.mapper.*;
|
|
|
import com.inspur.device.service.ISmsbDeviceAuthService;
|
|
import com.inspur.device.service.ISmsbDeviceAuthService;
|
|
|
|
|
+import com.inspur.device.service.ISmsbDeviceService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.common.core.domain.R;
|
|
import org.dromara.common.core.domain.R;
|
|
@@ -41,6 +42,8 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
|
|
|
private final SmsbDeviceXfApiMapper xfApiMapper;
|
|
private final SmsbDeviceXfApiMapper xfApiMapper;
|
|
|
private final SmsbDeviceChatKeyMapper chatKeyMapper;
|
|
private final SmsbDeviceChatKeyMapper chatKeyMapper;
|
|
|
|
|
|
|
|
|
|
+ private final ISmsbDeviceService smsbDeviceService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询设备鉴权
|
|
* 查询设备鉴权
|
|
|
*
|
|
*
|
|
@@ -143,7 +146,6 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public R<String> deviceAuth(HttpHeartbeatReq requestParam) {
|
|
public R<String> deviceAuth(HttpHeartbeatReq requestParam) {
|
|
|
-
|
|
|
|
|
SmsbDeviceAuth insert = new SmsbDeviceAuth();
|
|
SmsbDeviceAuth insert = new SmsbDeviceAuth();
|
|
|
String deviceIp = requestParam.getDeviceIp();
|
|
String deviceIp = requestParam.getDeviceIp();
|
|
|
insert.setDeviceIp(deviceIp);
|
|
insert.setDeviceIp(deviceIp);
|
|
@@ -151,6 +153,10 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
|
|
|
insert.setEncryptCode(encryptCode);
|
|
insert.setEncryptCode(encryptCode);
|
|
|
// test for fan 设备mac加密出来的设备表示,
|
|
// test for fan 设备mac加密出来的设备表示,
|
|
|
String identifier = requestParam.getIdentifier();
|
|
String identifier = requestParam.getIdentifier();
|
|
|
|
|
+ SmsbDeviceVo smsbDeviceVo = smsbDeviceService.getDeviceByIdentifier(identifier);
|
|
|
|
|
+ if (null != smsbDeviceVo) {
|
|
|
|
|
+ insert.setTenantId(smsbDeviceVo.getTenantId());
|
|
|
|
|
+ }
|
|
|
insert.setIdentifier(identifier);
|
|
insert.setIdentifier(identifier);
|
|
|
Integer authResult = 1;
|
|
Integer authResult = 1;
|
|
|
String authRemark = "";
|
|
String authRemark = "";
|
|
@@ -197,7 +203,6 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
|
|
|
return R.ok(authRemark);
|
|
return R.ok(authRemark);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// test for fan 这里是鉴权实现
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public R<AgentAuthRes> deviceAgentAuth(HttpHeartbeatReq requestParam) {
|
|
public R<AgentAuthRes> deviceAgentAuth(HttpHeartbeatReq requestParam) {
|
|
|
SmsbDeviceAuth insert = new SmsbDeviceAuth();
|
|
SmsbDeviceAuth insert = new SmsbDeviceAuth();
|
|
@@ -207,6 +212,10 @@ public class SmsbDeviceAuthServiceImpl implements ISmsbDeviceAuthService {
|
|
|
insert.setEncryptCode(encryptCode);
|
|
insert.setEncryptCode(encryptCode);
|
|
|
// test for fan 设备mac加密出来的设备表示,
|
|
// test for fan 设备mac加密出来的设备表示,
|
|
|
String identifier = requestParam.getIdentifier();
|
|
String identifier = requestParam.getIdentifier();
|
|
|
|
|
+ SmsbDeviceVo smsbDeviceVo = smsbDeviceService.getDeviceByIdentifier(identifier);
|
|
|
|
|
+ if (null != smsbDeviceVo) {
|
|
|
|
|
+ insert.setTenantId(smsbDeviceVo.getTenantId());
|
|
|
|
|
+ }
|
|
|
insert.setIdentifier(identifier);
|
|
insert.setIdentifier(identifier);
|
|
|
Integer authResult = 1;
|
|
Integer authResult = 1;
|
|
|
String authRemark = "";
|
|
String authRemark = "";
|