【同步】jdk21 和 jdk8 的代码
This commit is contained in:
@@ -25,8 +25,8 @@ public class IotPluginCommonAutoConfiguration {
|
||||
@Bean
|
||||
public RestTemplate restTemplate(IotPluginCommonProperties properties) {
|
||||
return new RestTemplateBuilder()
|
||||
.connectTimeout(properties.getUpstreamConnectTimeout())
|
||||
.readTimeout(properties.getUpstreamReadTimeout())
|
||||
.setConnectTimeout(properties.getUpstreamConnectTimeout())
|
||||
.setReadTimeout(properties.getUpstreamReadTimeout())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package cn.iocoder.yudao.module.iot.plugin.common.config;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
|
@@ -255,7 +255,8 @@ public class IotDeviceMqttMessageHandler {
|
||||
Object valueObj = entry.getValue();
|
||||
|
||||
// 如果是复杂结构(包含value和time)
|
||||
if (valueObj instanceof JSONObject valueJson) {
|
||||
if (valueObj instanceof JSONObject) {
|
||||
JSONObject valueJson = (JSONObject) valueObj;
|
||||
properties.put(key, valueJson.getOrDefault("value", valueObj));
|
||||
} else {
|
||||
properties.put(key, valueObj);
|
||||
|
Reference in New Issue
Block a user