This commit is contained in:
龚祖望 2023-08-29 09:23:07 +08:00
commit ce82dfcc88
6 changed files with 54 additions and 4 deletions

View File

@ -12,7 +12,7 @@
<artifactId>xiuos</artifactId> <artifactId>xiuos</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>xiuos</name> <name>xiuos</name>
<description>Demo project for Spring Boot</description> <description>xiuosiot</description>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
</properties> </properties>
@ -123,11 +123,18 @@
</dependency> </dependency>
<!-- okhttps --> <!-- okhttps -->
<dependency> <dependency>
<groupId>cn.zhxu</groupId> <groupId>com.ejlchina</groupId>
<artifactId>okhttps-fastjson</artifactId> <artifactId>okhttps-fastjson</artifactId>
<version>4.0.1</version> <version>3.5.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>2.8.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
@ -163,6 +170,7 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -68,6 +68,30 @@ public class FzDeviceManageController {
} }
@GetMapping("/selectByStatus")
public ResultRespons selectDeviceByStatus(@RequestParam("status") String status, HttpServletRequest request){
List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectByStatus(status);
if(fzDeviceInfos!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",fzDeviceInfos);
}else
{
return new ResultRespons(Constant.SUCCESS_CODE,"设备不存在!");
}
}
@GetMapping("/selectByUser")
public ResultRespons selectDeviceByUser(@RequestParam("user") String user, HttpServletRequest request){
List<FzDeviceInfo> fzDeviceInfos= fzDeviceInfoService.selectByUser(user);
if(fzDeviceInfos!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",fzDeviceInfos);
}else
{
return new ResultRespons(Constant.SUCCESS_CODE,"设备不存在!");
}
}
@GetMapping("/selectAll") @GetMapping("/selectAll")
public ResultRespons selectDevice(){ public ResultRespons selectDevice(){
List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectAll(); List<FzDeviceInfo> fzDeviceInfos = fzDeviceInfoService.selectAll();

View File

@ -26,4 +26,10 @@ public interface FzDeviceInfoMapper {
@Select("select * from fz_device_info where fz_device_type =#{type}") @Select("select * from fz_device_info where fz_device_type =#{type}")
List<FzDeviceInfo> selectByType(@Param("type") String type); List<FzDeviceInfo> selectByType(@Param("type") String type);
@Select("select * from fz_device_info where fz_device_status =#{status}")
List<FzDeviceInfo> selectByStatus(@Param("status") String status);
@Select("select * from fz_device_info where fz_device_user =#{user}")
List<FzDeviceInfo> selectByUser(@Param("user") String user);
} }

View File

@ -11,5 +11,7 @@ public interface FzDeviceInfoService {
int addDevice(FzDeviceInfo fzDeviceInfo); int addDevice(FzDeviceInfo fzDeviceInfo);
int updateDevice(FzDeviceInfo fzDeviceInfo); int updateDevice(FzDeviceInfo fzDeviceInfo);
int deleteDevice(String deviceNo); int deleteDevice(String deviceNo);
List<FzDeviceInfo> selectByStatus(String status);
List<FzDeviceInfo> selectByUser(String user);
} }

View File

@ -40,4 +40,14 @@ public class FzDeviceInfoServiceImpl implements FzDeviceInfoService {
public int deleteDevice(String deviceNo) { public int deleteDevice(String deviceNo) {
return fzDeviceInfoMapper.deleteByPrimaryKey(deviceNo); return fzDeviceInfoMapper.deleteByPrimaryKey(deviceNo);
} }
@Override
public List<FzDeviceInfo> selectByStatus(String status) {
return fzDeviceInfoMapper.selectByStatus(status);
}
@Override
public List<FzDeviceInfo> selectByUser(String user) {
return fzDeviceInfoMapper.selectByUser(user);
}
} }

View File

@ -10,7 +10,7 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ServerEndpoint(value = "/websocket/haier/{clientId}") @ServerEndpoint(value = "/websocket/gzjc/{clientId}")
@Component @Component
@Slf4j @Slf4j
public class GZJCWebSocketServer { public class GZJCWebSocketServer {