Merge remote-tracking branch 'origin/master'
commit
389e333fe0
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwDeviceModeFunction;
|
||||
|
||||
/**
|
||||
* 设备模型功能Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-05
|
||||
*/
|
||||
public interface HwDeviceModeFunctionMapper
|
||||
{
|
||||
/**
|
||||
* 根据主键查询设备模型功能
|
||||
*
|
||||
* @param modeFunctionId 设备模型功能主键
|
||||
* @return 设备模型功能
|
||||
*/
|
||||
public HwDeviceModeFunction selectHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId);
|
||||
|
||||
/**
|
||||
* 查询设备模型功能列表
|
||||
*
|
||||
* @param hwDeviceModeFunction 设备模型功能
|
||||
* @return 设备模型功能集合
|
||||
*/
|
||||
public List<HwDeviceModeFunction> selectHwDeviceModeFunctionList(HwDeviceModeFunction hwDeviceModeFunction);
|
||||
|
||||
/**
|
||||
* 新增设备模型功能
|
||||
*
|
||||
* @param hwDeviceModeFunction 设备模型功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction);
|
||||
|
||||
/**
|
||||
* 修改设备模型功能
|
||||
*
|
||||
* @param hwDeviceModeFunction 设备模型功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwDeviceModeFunction(HwDeviceModeFunction hwDeviceModeFunction);
|
||||
|
||||
/**
|
||||
* 删除设备模型功能
|
||||
*
|
||||
* @param modeFunctionId 设备模型功能主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceModeFunctionByModeFunctionId(Long modeFunctionId);
|
||||
|
||||
/**
|
||||
* 批量删除设备模型功能
|
||||
*
|
||||
* @param modeFunctionIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceModeFunctionByModeFunctionIds(Long[] modeFunctionIds);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- <artifactId>hw-mqtt-broker</artifactId>-->
|
||||
<artifactId>ruoyi-modules-websocket</artifactId>
|
||||
|
||||
<description>
|
||||
海威物联网平台WebSocket模块
|
||||
</description>
|
||||
|
||||
|
||||
<properties>
|
||||
<java.version>8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos discovery -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<!-- <dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,14 @@
|
||||
package com.hw.websocket;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
|
||||
public class HwWebsocketServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HwWebsocketServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.hw.websocket.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.hw.websocket.operate.WebSocket;
|
||||
import com.ruoyi.common.core.utils.uuid.UUID;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author Wen JY
|
||||
* @description: TODO
|
||||
* @date 2023-09-14 17:07:06
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/webSocketApi")
|
||||
public class WebSocketApi {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(WebSocketApi.class);
|
||||
@Resource
|
||||
private WebSocket webSocket;
|
||||
|
||||
@PostMapping()
|
||||
@ResponseBody
|
||||
public void push(String message){
|
||||
try{
|
||||
webSocket.sendAllMessage(message);
|
||||
}catch (Exception ex){
|
||||
logger.error("WebSocket Api接口异常:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9607
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# ????
|
||||
name: hw-websocket
|
||||
profiles:
|
||||
# ????
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# ??????
|
||||
server-addr: localhost:8848
|
||||
config:
|
||||
# ??????
|
||||
server-addr: localhost:8848
|
||||
# ??????
|
||||
file-extension: yml
|
||||
# ????
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
Loading…
Reference in New Issue