feat(支持springboot3): 支持springboot3框架

This commit is contained in:
zhuangpeng.li
2025-04-27 17:56:52 +08:00
parent 5b6ec185c4
commit 4d8e1c5167
156 changed files with 528 additions and 549 deletions

View File

@@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
/**
* 客户端认证
@@ -49,7 +49,9 @@ public class AuthService {
*/
public boolean auth(String clientId, String username, String password) {
//不需要账号密码校验,直接返回true
if (!mustPass) return true;
if (!mustPass) {
return true;
}
if (StringUtils.isEmpty(clientId) || StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
log.error("=>客户端参数缺少,clientId:{},username:{},password:{}", clientId, username, password);
return false;

View File

@@ -1,6 +1,5 @@
package com.fastbee.mqtt.handler;
import com.fastbee.common.constant.FastBeeConstant;
import com.fastbee.common.core.redis.RedisCache;
import com.fastbee.common.enums.ServerType;
import com.fastbee.common.utils.DateUtils;
@@ -21,7 +20,7 @@ import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.net.InetSocketAddress;

View File

@@ -27,7 +27,7 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.nio.charset.StandardCharsets;
import java.util.Objects;

View File

@@ -19,7 +19,7 @@ import io.netty.handler.codec.mqtt.*;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

View File

@@ -12,7 +12,7 @@ import io.netty.handler.codec.mqtt.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.nio.charset.StandardCharsets;

View File

@@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@@ -117,6 +117,7 @@ public class DataHandlerImpl implements IDataHandler {
/**
* 上报设备信息
*/
@Override
public void reportDevice(ReportDataBo bo) {
try {
// 设备实体

View File

@@ -19,7 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.util.Optional;
/**

View File

@@ -45,7 +45,7 @@ import com.fastbee.ruleEngine.context.MsgContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

View File

@@ -9,7 +9,6 @@ import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.mqtt.*;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;