接口优化

结构优化
648540858 2023-09-15 09:34:29 +08:00
parent b1ec6c6dd6
commit 1d8dd248a5
6 changed files with 14 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.CommonGbChannel;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "通道信息") @Schema(description = "通道信息")
public class DeviceChannel extends CommonGbChannel { public class DeviceChannel {
/** /**

View File

@ -140,7 +140,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
commonGbChannel.setCommonGbLongitude(deviceChannel.getLongitude()); commonGbChannel.setCommonGbLongitude(deviceChannel.getLongitude());
commonGbChannel.setCommonGbLatitude(deviceChannel.getLatitude()); commonGbChannel.setCommonGbLatitude(deviceChannel.getLatitude());
commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType()); commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType());
commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); // commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
commonGbChannel.setCommonGbBusinessGroupID(deviceChannel.getBusinessGroupId()); commonGbChannel.setCommonGbBusinessGroupID(deviceChannel.getBusinessGroupId());
} else { } else {
for (String key : syncKeys) { for (String key : syncKeys) {
@ -217,7 +217,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType()); commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType());
break; break;
case "commonGbPositionType": case "commonGbPositionType":
commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); // commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType());
break; break;
case "commonGbRoomType": case "commonGbRoomType":
break; break;

View File

@ -139,7 +139,6 @@ public class DeviceQuery {
if (ObjectUtils.isEmpty(query)) { if (ObjectUtils.isEmpty(query)) {
query = null; query = null;
} }
return storager.queryChannelsByDeviceId(deviceId, query, channelType, online, catalogUnderDevice, page, count); 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 = "deviceId", description = "设备国标编号", required = true)
@Parameter(name = "channel", description = "通道信息", required = true) @Parameter(name = "channel", description = "通道信息", required = true)
@PostMapping("/channel/update/{deviceId}") @PostMapping("/channel/update/{deviceId}")
public void updateChannel(@PathVariable String deviceId,DeviceChannel channel){ public void updateChannel(@PathVariable String deviceId, DeviceChannel channel, @RequestBody DeviceChannel channelJSON){
deviceChannelService.updateChannel(deviceId, channel); DeviceChannel deviceChannel;
if (!ObjectUtils.isEmpty(channel) && !ObjectUtils.isEmpty(channel.getChannelId()) ) {
deviceChannel = channel;
}else {
deviceChannel = channelJSON;
}
deviceChannelService.updateChannel(deviceId, deviceChannel);
} }
/** /**

View File

@ -36,7 +36,7 @@ spring:
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver 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 username: root
password: root123 password: root123
hikari: hikari:

View File

@ -26,7 +26,7 @@ spring:
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver 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 username: root
password: root password: root
hikari: hikari:

View File

@ -20,7 +20,7 @@ spring:
datasource: datasource:
# 使用mysql 打开23-28行注释 删除29-36行 # 使用mysql 打开23-28行注释 删除29-36行
name: wvp 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 username: root
password: root password: root
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource