接口优化
parent
b1ec6c6dd6
commit
1d8dd248a5
|
@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.CommonGbChannel;
|
|||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "通道信息")
|
||||
public class DeviceChannel extends CommonGbChannel {
|
||||
public class DeviceChannel {
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -140,7 +140,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
|
|||
commonGbChannel.setCommonGbLongitude(deviceChannel.getLongitude());
|
||||
commonGbChannel.setCommonGbLatitude(deviceChannel.getLatitude());
|
||||
commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType());
|
||||
commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
|
||||
// commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
|
||||
commonGbChannel.setCommonGbBusinessGroupID(deviceChannel.getBusinessGroupId());
|
||||
} else {
|
||||
for (String key : syncKeys) {
|
||||
|
@ -217,7 +217,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
|
|||
commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType());
|
||||
break;
|
||||
case "commonGbPositionType":
|
||||
commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
|
||||
// commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
|
||||
break;
|
||||
case "commonGbRoomType":
|
||||
break;
|
||||
|
|
|
@ -139,7 +139,6 @@ public class DeviceQuery {
|
|||
if (ObjectUtils.isEmpty(query)) {
|
||||
query = null;
|
||||
}
|
||||
|
||||
return storager.queryChannelsByDeviceId(deviceId, query, channelType, online, catalogUnderDevice, page, count);
|
||||
}
|
||||
|
||||
|
@ -257,8 +256,14 @@ public class DeviceQuery {
|
|||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channel", description = "通道信息", required = true)
|
||||
@PostMapping("/channel/update/{deviceId}")
|
||||
public void updateChannel(@PathVariable String deviceId,DeviceChannel channel){
|
||||
deviceChannelService.updateChannel(deviceId, channel);
|
||||
public void updateChannel(@PathVariable String deviceId, DeviceChannel channel, @RequestBody DeviceChannel channelJSON){
|
||||
DeviceChannel deviceChannel;
|
||||
if (!ObjectUtils.isEmpty(channel) && !ObjectUtils.isEmpty(channel.getChannelId()) ) {
|
||||
deviceChannel = channel;
|
||||
}else {
|
||||
deviceChannel = channelJSON;
|
||||
}
|
||||
deviceChannelService.updateChannel(deviceId, deviceChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@ spring:
|
|||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root123
|
||||
hikari:
|
||||
|
|
|
@ -26,7 +26,7 @@ spring:
|
|||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
hikari:
|
||||
|
|
|
@ -20,7 +20,7 @@ spring:
|
|||
datasource:
|
||||
# 使用mysql 打开23-28行注释, 删除29-36行
|
||||
name: wvp
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&allowMultiQueries=true
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
|
|
Loading…
Reference in New Issue