Commit df902246 by gdj

放行取流关流接口

parent 285a5c1e
......@@ -35,6 +35,9 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer {
excludePaths.add("/v3/**");
excludePaths.add("/ui/**");
excludePaths.add("/" + managePrefix + manageVersion + "/devices/**/deviceInfo");
excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/start2");
excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/stop2");
excludePaths.add("/" + managePrefix + manageVersion + "/live/oneCapacity2");
// Intercept for all request interfaces.
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths);
}
......
......@@ -64,6 +64,20 @@ public class LiveStreamController {
}
/**
* Get live capability data of all drones in the current user's workspace from the database.
* @param request
* @return live capability
*/
@GetMapping("/oneCapacity2")
public HttpResultResponse<CapacityDeviceDTO> getLiveCapacityByDeviceSn2(HttpServletRequest request,
@RequestParam(value = "device_sn") String deviceSn) {
CapacityDeviceDTO liveCapacity = liveStreamService.getLiveCapacity2(deviceSn);
return HttpResultResponse.success(liveCapacity);
}
/**
* Live streaming according to the parameters passed in from the web side.
* @param liveParam Live streaming parameters.
* @return
......@@ -74,6 +88,16 @@ public class LiveStreamController {
}
/**
* 不需要权限 Live streaming according to the parameters passed in from the web side.
* @param liveParam Live streaming parameters.
* @return
*/
@PostMapping("/streams/start2")
public HttpResultResponse liveStart2(@RequestBody LiveTypeDTO liveParam) {
return liveStreamService.liveStart(liveParam);
}
/**
* Stop live streaming according to the parameters passed in from the web side.
* @param liveParam Live streaming parameters.
* @return
......@@ -84,6 +108,16 @@ public class LiveStreamController {
}
/**
* 不需要权限 Stop live streaming according to the parameters passed in from the web side.
* @param liveParam Live streaming parameters.
* @return
*/
@PostMapping("/streams/stop2")
public HttpResultResponse liveStop2(@RequestBody LiveTypeDTO liveParam) {
return liveStreamService.liveStop(liveParam.getVideoId());
}
/**
* Set the quality of the live streaming according to the parameters passed in from the web side.
* @param liveParam Live streaming parameters.
* @return
......
......@@ -23,6 +23,13 @@ public interface ILiveStreamService {
CapacityDeviceDTO getLiveCapacity(String workspaceId, String deviceSn);
/**
* Get the drone data that can be broadcast live in this workspace.
* @param deviceSn 设备sn
* @return
*/
CapacityDeviceDTO getLiveCapacity2(String deviceSn);
/**
* Get all the drone data that can be broadcast live in this workspace.
* @param workspaceId
* @return
......
......@@ -69,6 +69,28 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
}
@Override
public CapacityDeviceDTO getLiveCapacity2(String deviceSn) {
// Query the devices in this workspace.
List<DeviceDTO> devicesList = deviceService.getDevicesByParams(
DeviceQueryParam.builder()
.domains(List.of(DeviceDomainEnum.DRONE.getDomain(), DeviceDomainEnum.DOCK.getDomain()))
.deviceSn(deviceSn)
.build());
CapacityDeviceDTO capacityDeviceDTO = new CapacityDeviceDTO();
if (CollectionUtils.isEmpty(devicesList)) {
return capacityDeviceDTO;
}
DeviceDTO device = devicesList.get(0);
capacityDeviceDTO.setName(Objects.requireNonNullElse(device.getNickname(), device.getDeviceName()));
capacityDeviceDTO.setSn(device.getDeviceSn());
capacityDeviceDTO.setCamerasList(capacityCameraService.getCapacityCameraByDeviceSn(device.getDeviceSn()));
return capacityDeviceDTO;
}
@Override
public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId) {
// Query all devices in this workspace.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment