Commit fafa968d by YG8999

mqtt服务迁移system模块下面

parent 9d66a9a5
...@@ -17,7 +17,7 @@ import share.common.core.controller.BaseController; ...@@ -17,7 +17,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.utils.SecurityUtils; import share.common.utils.SecurityUtils;
import share.framework.mqtt.MqttGatewayComponent; import share.system.mqtt.MqttGatewayComponent;
import share.system.domain.Device; import share.system.domain.Device;
import share.system.domain.vo.DeviceParamVo; import share.system.domain.vo.DeviceParamVo;
import share.system.domain.vo.MqttxVo; import share.system.domain.vo.MqttxVo;
......
...@@ -60,21 +60,6 @@ ...@@ -60,21 +60,6 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mqtt</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.8.16</version> <version>5.8.16</version>
......
...@@ -128,6 +128,21 @@ ...@@ -128,6 +128,21 @@
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
<version>2.4</version> <version>2.4</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mqtt</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package share.framework.mqtt; package share.system.mqtt;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
package share.framework.mqtt; package share.system.mqtt;
import org.springframework.integration.annotation.MessagingGateway; import org.springframework.integration.annotation.MessagingGateway;
......
package share.framework.mqtt; package share.system.mqtt;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.integration.mqtt.support.MqttHeaders; import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.Message; import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler; import org.springframework.messaging.MessageHandler;
......
package share.framework.mqtt; package share.system.mqtt;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
......
package share.framework.mqtt; package share.system.mqtt;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package share.framework.mqtt; package share.system.mqtt;
import org.springframework.integration.mqtt.core.MqttPahoClientFactory; import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler; import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
......
package share.framework.mqtt; package share.system.mqtt;
import cn.hutool.core.lang.Singleton; import cn.hutool.core.lang.Singleton;
/** /**
......
package share.system.service;
import share.system.domain.vo.DeviceParamVo;
/**
* @className: share.system.service.DeviceOpService
* @description: 设备操作接口
* @author: lwj
* @create: 2023-11-09 13:58
*/
public interface DeviceOpService {
/**
* 小程序订单开门
* @param deviceParam
*/
void openDoor(DeviceParamVo deviceParam);
/**
* 小程序订单开门
* @param roomId 房间id
* @param phone 操作用户
*/
void openDoor(Long roomId, String phone);
}
package share.web.service; package share.system.service.impl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.enums.DeviceType; import share.common.enums.DeviceType;
import share.framework.mqtt.MqttGatewayComponent; import share.system.mqtt.MqttGatewayComponent;
import share.system.domain.Device; import share.system.domain.Device;
import share.system.domain.SRoom; import share.system.domain.SRoom;
import share.system.domain.vo.DeviceParamVo; import share.system.domain.vo.DeviceParamVo;
...@@ -11,18 +11,19 @@ import share.system.domain.vo.MqttxVo; ...@@ -11,18 +11,19 @@ import share.system.domain.vo.MqttxVo;
import share.system.mapper.DeviceMapper; import share.system.mapper.DeviceMapper;
import share.system.mapper.SRoomMapper; import share.system.mapper.SRoomMapper;
import share.system.service.DeviceLogService; import share.system.service.DeviceLogService;
import share.system.service.DeviceOpService;
import share.system.service.MqttxService; import share.system.service.MqttxService;
import java.util.List; import java.util.List;
/** /**
* @className: share.web.service.DeviceOpService * @className: share.system.service.impl.DeviceOpService
* @description: 设备操作接口 * @description: 设备操作接口
* @author: lwj * @author: lwj
* @create: 2023-11-09 10:38 * @create: 2023-11-09 10:38
*/ */
@Service @Service
public class DeviceOpService { public class DeviceOpServiceImpl implements DeviceOpService {
@Autowired @Autowired
private MqttGatewayComponent mqttGatewayComponent; private MqttGatewayComponent mqttGatewayComponent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment