【同步】jdk21 和 jdk8 的代码

This commit is contained in:
YunaiV
2025-03-17 13:37:52 +08:00
parent de171c592a
commit 7119350a37
103 changed files with 211 additions and 169 deletions

View File

@@ -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();
}

View File

@@ -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;
/**

View File

@@ -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);