优化通用通道接口

结构优化
648540858 2024-01-14 16:01:32 +08:00
parent 25a46d1833
commit e2fd8ddf8b
3 changed files with 16 additions and 6 deletions

View File

@ -31,7 +31,7 @@ public interface ICommonGbChannelService {
PageInfo<CommonGbChannel> queryChannelListInGroup(int page, int count, String query, String groupDeviceId,
String regionDeviceId, Boolean inGroup, Boolean inRegion,
String type);
String type, String ptzType, Boolean online);
PageInfo<CommonGbChannel> queryChannelList(String query, int page, int count);

View File

@ -137,8 +137,11 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
@Override
public PageInfo<CommonGbChannel> queryChannelListInGroup(int page, int count, String query, String groupDeviceId,
String regionDeviceId, Boolean inGroup, Boolean inRegion,
String type) {
String type, String ptzType, Boolean online) {
PageHelper.startPage(page, count);
if (query != null && ObjectUtils.isEmpty(query.trim())) {
query = null;
}
if (groupDeviceId != null && ObjectUtils.isEmpty(groupDeviceId.trim())) {
inGroup = null;
}
@ -148,6 +151,9 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
if (type != null && ObjectUtils.isEmpty(type.trim())) {
type = null;
}
if (ptzType != null && ObjectUtils.isEmpty(ptzType.trim())) {
ptzType = null;
}
List<CommonGbChannel> all = commonGbChannelMapper.queryChannelListInGroup(query, groupDeviceId,
regionDeviceId, inGroup, inRegion, type);
return new PageInfo<>(all);

View File

@ -54,9 +54,8 @@ public class CommonChannelController {
@Operation(summary = "更新通道信息")
@Parameter(name = "CommonGbChannel", description = "commonGbChannel", required = true)
@ResponseBody
@GetMapping("/update")
public void update(
@RequestParam(required = false) CommonGbChannel commonGbChannel
@PostMapping("/update")
public void update(@RequestBody CommonGbChannel commonGbChannel
){
commonGbChannelService.update(commonGbChannel);
}
@ -108,6 +107,8 @@ public class CommonChannelController {
@RequestParam(required = false) String regionDeviceId,
@RequestParam(required = false) String query,
@RequestParam(required = false) String type,
@RequestParam(required = false) String ptzType,
@RequestParam(required = false) Boolean online,
@RequestParam(required = false) Boolean inGroup,
@RequestParam(required = false) Boolean inRegion,
@RequestParam(required = true) int page,
@ -125,9 +126,12 @@ public class CommonChannelController {
if (type != null && ObjectUtils.isEmpty(type.trim())) {
type = null;
}
if (ptzType != null && ObjectUtils.isEmpty(ptzType.trim())) {
ptzType = null;
}
assert !ObjectUtils.isEmpty(groupDeviceId);
return commonGbChannelService.queryChannelListInGroup(page, count, query, groupDeviceId, regionDeviceId,
inGroup, inRegion, type);
inGroup, inRegion, type, ptzType, online);
}
@Operation(summary = "为区域添加分组")