fix:【iot 物联网】增强 jdk8 的兼容性
This commit is contained in:
parent
a303e09ae9
commit
5573ce20db
@ -125,7 +125,7 @@ public class IotMqttConnectionManager {
|
|||||||
*/
|
*/
|
||||||
public IotMqttConnectionManager.ConnectionInfo getConnectionInfoByDeviceId(Long deviceId) {
|
public IotMqttConnectionManager.ConnectionInfo getConnectionInfoByDeviceId(Long deviceId) {
|
||||||
// 通过设备 ID 获取连接端点
|
// 通过设备 ID 获取连接端点
|
||||||
var endpoint = getDeviceEndpoint(deviceId);
|
MqttEndpoint endpoint = getDeviceEndpoint(deviceId);
|
||||||
if (endpoint == null) {
|
if (endpoint == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
|
|||||||
*/
|
*/
|
||||||
private final LoadingCache<Long, IotDeviceRespDTO> deviceCaches = buildAsyncReloadingCache(
|
private final LoadingCache<Long, IotDeviceRespDTO> deviceCaches = buildAsyncReloadingCache(
|
||||||
CACHE_EXPIRE,
|
CACHE_EXPIRE,
|
||||||
new CacheLoader<>() {
|
new CacheLoader<Long, IotDeviceRespDTO>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IotDeviceRespDTO load(Long id) {
|
public IotDeviceRespDTO load(Long id) {
|
||||||
@ -51,7 +51,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
|
|||||||
*/
|
*/
|
||||||
private final LoadingCache<KeyValue<String, String>, IotDeviceRespDTO> deviceCaches2 = buildAsyncReloadingCache(
|
private final LoadingCache<KeyValue<String, String>, IotDeviceRespDTO> deviceCaches2 = buildAsyncReloadingCache(
|
||||||
CACHE_EXPIRE,
|
CACHE_EXPIRE,
|
||||||
new CacheLoader<>() {
|
new CacheLoader<KeyValue<String, String>, IotDeviceRespDTO>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IotDeviceRespDTO load(KeyValue<String, String> kv) {
|
public IotDeviceRespDTO load(KeyValue<String, String> kv) {
|
||||||
|
|||||||
@ -40,19 +40,19 @@ public class IotDeviceApiImpl implements IotDeviceCommonApi {
|
|||||||
IotGatewayProperties.RpcProperties rpc = gatewayProperties.getRpc();
|
IotGatewayProperties.RpcProperties rpc = gatewayProperties.getRpc();
|
||||||
restTemplate = new RestTemplateBuilder()
|
restTemplate = new RestTemplateBuilder()
|
||||||
.rootUri(rpc.getUrl() + "/rpc-api/iot/device")
|
.rootUri(rpc.getUrl() + "/rpc-api/iot/device")
|
||||||
.readTimeout(rpc.getReadTimeout())
|
.setConnectTimeout(rpc.getReadTimeout())
|
||||||
.connectTimeout(rpc.getConnectTimeout())
|
.setReadTimeout(rpc.getConnectTimeout())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Boolean> authDevice(IotDeviceAuthReqDTO authReqDTO) {
|
public CommonResult<Boolean> authDevice(IotDeviceAuthReqDTO authReqDTO) {
|
||||||
return doPost("/auth", authReqDTO, new ParameterizedTypeReference<>() { });
|
return doPost("/auth", authReqDTO, new ParameterizedTypeReference<CommonResult<Boolean>>() { });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<IotDeviceRespDTO> getDevice(IotDeviceGetReqDTO getReqDTO) {
|
public CommonResult<IotDeviceRespDTO> getDevice(IotDeviceGetReqDTO getReqDTO) {
|
||||||
return doPost("/get", getReqDTO, new ParameterizedTypeReference<>() { });
|
return doPost("/get", getReqDTO, new ParameterizedTypeReference<CommonResult<IotDeviceRespDTO>>() { });
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T, R> CommonResult<R> doPost(String url, T body,
|
private <T, R> CommonResult<R> doPost(String url, T body,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user