Browse Source

规范api

pull/80/head
panlinlin 4 years ago
parent
commit
a004a978fa
  1. 58
      src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java
  2. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
  3. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
  4. 6
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
  5. 2
      src/main/java/com/genersoft/iot/vmp/service/IPlayService.java
  6. 2
      src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
  7. 2
      src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
  8. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
  9. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
  10. 2
      src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
  11. 18
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
  12. 17
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
  13. 21
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java
  14. 35
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
  15. 62
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
  16. 13
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
  17. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/bean/GbStreamParam.java
  18. 11
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
  19. 104
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
  20. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/ChannelReduce.java
  21. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/UpdateChannelParam.java
  22. 14
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java
  23. 35
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
  24. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java
  25. 22
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
  26. 72
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java
  27. 30
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/RecordController.java
  28. 5
      src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
  29. 34
      src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
  30. 31
      src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
  31. 15
      src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
  32. 2
      src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java
  33. 2
      web_src/index.html
  34. 2
      web_src/src/components/PushVideoList.vue
  35. 2
      web_src/src/components/dialog/addStreamTOGB.vue
  36. 20
      web_src/src/components/dialog/devicePlayer.vue
  37. 57
      web_src/src/components/dialog/player.vue

58
src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java

@ -23,12 +23,70 @@ public class Swagger3Config {
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.OAS_30) return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.groupName("全部")
.select() .select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager"))
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build() .build()
.pathMapping("/"); .pathMapping("/");
} }
@Bean
public Docket createRestGBApi() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.groupName("国标")
.select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.gb28181"))
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
@Bean
public Docket createRestStreamProxyApi() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.groupName("拉流转发")
.select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamProxy"))
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
@Bean
public Docket createRestStreamPushApi() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.groupName("推流管理")
.select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamPush"))
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
@Bean
public Docket createServerApi() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.groupName("服务管理")
.select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.server"))
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
@Bean
public Docket createUserApi() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.groupName("用户管理")
.select()
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.user"))
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
private ApiInfo apiInfo() { private ApiInfo apiInfo() {
return new ApiInfoBuilder() return new ApiInfoBuilder()

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java

@ -19,7 +19,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.request.SIPRequestAbstractProcesso
import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult;
import com.genersoft.iot.vmp.service.IPlayService; import com.genersoft.iot.vmp.service.IPlayService;
import gov.nist.javax.sip.address.AddressImpl; import gov.nist.javax.sip.address.AddressImpl;
import gov.nist.javax.sip.address.SipUri; import gov.nist.javax.sip.address.SipUri;

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java

@ -40,7 +40,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.utils.GpsUtil; import com.genersoft.iot.vmp.utils.GpsUtil;
import com.genersoft.iot.vmp.utils.SpringBeanFactory; import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.utils.redis.RedisUtil; import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import gov.nist.javax.sip.SipStackImpl; import gov.nist.javax.sip.SipStackImpl;
import gov.nist.javax.sip.address.AddressImpl; import gov.nist.javax.sip.address.AddressImpl;

6
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java

@ -245,13 +245,13 @@ public class ZLMHttpHookListener {
String streamId = json.getString("stream"); String streamId = json.getString("stream");
String schema = json.getString("schema"); String schema = json.getString("schema");
JSONArray tracks = json.getJSONArray("tracks"); JSONArray tracks = json.getJSONArray("tracks");
String regist = json.getString("regist"); boolean regist = json.getBoolean("regist");
if (tracks != null) { if (tracks != null) {
System.out.println("222222" + schema); System.out.println("222222" + schema);
} }
if ("rtmp".equals(schema)){ if ("rtmp".equals(schema)){
if ("rtp".equals(app) && regist != null ) { if ("rtp".equals(app) && !regist ) {
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
if (streamInfo!=null){ if (streamInfo!=null){
redisCatchStorage.stopPlay(streamInfo); redisCatchStorage.stopPlay(streamInfo);
@ -262,7 +262,7 @@ public class ZLMHttpHookListener {
} }
}else { }else {
if (!"rtp".equals(app) ){ if (!"rtp".equals(app) ){
if (regist == null) { if (regist) {
zlmMediaListManager.addMedia(app, streamId); zlmMediaListManager.addMedia(app, streamId);
}else { }else {
zlmMediaListManager.removeMedia(app, streamId); zlmMediaListManager.removeMedia(app, streamId);

2
src/main/java/com/genersoft/iot/vmp/service/IPlayService.java

@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult;
/** /**
* 点播处理 * 点播处理

2
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java

@ -13,7 +13,7 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult;
import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.service.IPlayService; import com.genersoft.iot.vmp.service.IPlayService;
import org.slf4j.Logger; import org.slf4j.Logger;

2
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java

@ -5,7 +5,7 @@ import java.util.List;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
/** /**

2
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java

@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.storager.dao; package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

2
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java

@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;

2
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java

@ -7,7 +7,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.*; import com.genersoft.iot.vmp.storager.dao.*;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

18
src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.MobilePosition; package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition;
import java.util.List; import java.util.List;
@ -58,9 +58,9 @@ public class MobilePositionController {
*/ */
@ApiOperation("查询历史轨迹") @ApiOperation("查询历史轨迹")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "start", value = "开始时间", required = true), @ApiImplicitParam(name = "start", value = "开始时间", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "end", value = "结束时间", required = true), @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/history/{deviceId}") @GetMapping("/history/{deviceId}")
public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId,
@ -88,7 +88,7 @@ public class MobilePositionController {
*/ */
@ApiOperation("查询设备最新位置") @ApiOperation("查询设备最新位置")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/latest/{deviceId}") @GetMapping("/latest/{deviceId}")
public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) {
@ -106,7 +106,7 @@ public class MobilePositionController {
*/ */
@ApiOperation("获取移动位置信息") @ApiOperation("获取移动位置信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/realtime/{deviceId}") @GetMapping("/realtime/{deviceId}")
public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) {
@ -140,9 +140,9 @@ public class MobilePositionController {
*/ */
@ApiOperation("订阅位置信息") @ApiOperation("订阅位置信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "expires", value = "订阅超时时间"), @ApiImplicitParam(name = "expires", value = "订阅超时时间", dataTypeClass = String.class),
@ApiImplicitParam(name = "interval", value = "上报时间间隔"), @ApiImplicitParam(name = "interval", value = "上报时间间隔", dataTypeClass = String.class),
}) })
@GetMapping("/subscribe/{deviceId}") @GetMapping("/subscribe/{deviceId}")
public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId, public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId,

17
src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java

@ -1,6 +1,10 @@
package com.genersoft.iot.vmp.vmanager.SseController; package com.genersoft.iot.vmp.vmanager.gb28181.SseController;
import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener; import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
@ -13,15 +17,18 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
* @author: lawrencehj * @author: lawrencehj
* @data: 2021-01-20 * @data: 2021-01-20
*/ */
@Api(tags = "SSE推送")
@CrossOrigin @CrossOrigin
@Controller @Controller
@RequestMapping("/api") @RequestMapping("/api")
public class SseController { public class SseController {
@Autowired @Autowired
AlarmEventListener alarmEventListener; AlarmEventListener alarmEventListener;
//设置响应 @ApiOperation("设置响应")
@ApiImplicitParams({
@ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class),
})
@RequestMapping("/emit") @RequestMapping("/emit")
public SseEmitter emit(@RequestParam String browserId) { public SseEmitter emit(@RequestParam String browserId) {
final SseEmitter sseEmitter = new SseEmitter(0L); final SseEmitter sseEmitter = new SseEmitter(0L);

21
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java

@ -5,7 +5,7 @@
* @date 2021年2月2日 * @date 2021年2月2日
*/ */
package com.genersoft.iot.vmp.vmanager.device; package com.genersoft.iot.vmp.vmanager.gb28181.device;
import javax.sip.message.Response; import javax.sip.message.Response;
@ -24,7 +24,6 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web.context.request.async.DeferredResult;
@ -59,12 +58,12 @@ public class DeviceConfig {
@ApiOperation("看守位控制命令") @ApiOperation("看守位控制命令")
@GetMapping("/basicParam/{deviceId}") @GetMapping("/basicParam/{deviceId}")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value ="设备ID" ), @ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value ="通道ID" ), @ApiImplicitParam(name = "channelId", value ="通道ID",dataTypeClass = String.class ),
@ApiImplicitParam(name = "name", value ="名称" ), @ApiImplicitParam(name = "name", value ="名称" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "expiration", value ="到期时间" ), @ApiImplicitParam(name = "expiration", value ="到期时间" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ), @ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ), @ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ,dataTypeClass = String.class),
}) })
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,
@RequestParam(required = false) String channelId, @RequestParam(required = false) String channelId,
@ -109,9 +108,9 @@ public class DeviceConfig {
*/ */
@ApiOperation("设备配置查询请求") @ApiOperation("设备配置查询请求")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value ="设备ID" ), @ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value ="通道ID" ), @ApiImplicitParam(name = "channelId", value ="通道ID" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "configType", value ="配置类型" ), @ApiImplicitParam(name = "configType", value ="配置类型" ,dataTypeClass = String.class),
}) })
@GetMapping("/query/{deviceId}/{configType}") @GetMapping("/query/{deviceId}/{configType}")
public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId,

35
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceControl.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java

@ -5,7 +5,7 @@
* @date 2021年2月1日 * @date 2021年2月1日
*/ */
package com.genersoft.iot.vmp.vmanager.device; package com.genersoft.iot.vmp.vmanager.gb28181.device;
import javax.sip.message.Response; import javax.sip.message.Response;
@ -53,7 +53,7 @@ public class DeviceControl {
*/ */
@ApiOperation("远程启动控制命令") @ApiOperation("远程启动控制命令")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true), @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/teleboot/{deviceId}") @GetMapping("/teleboot/{deviceId}")
public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) { public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) {
@ -82,10 +82,10 @@ public class DeviceControl {
*/ */
@ApiOperation("录像控制命令") @ApiOperation("录像控制命令")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true), @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value ="通道编码"), @ApiImplicitParam(name = "channelId", value ="通道编码" ,dataTypeClass = String.class),
@ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", @ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)",
required = true), required = true ,dataTypeClass = String.class),
}) })
@GetMapping("/record/{deviceId}/{recordCmdStr}") @GetMapping("/record/{deviceId}/{recordCmdStr}")
public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId,
@ -122,8 +122,9 @@ public class DeviceControl {
*/ */
@ApiOperation("录像控制命令") @ApiOperation("录像控制命令")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true) @ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true,
dataTypeClass = String.class)
}) })
@GetMapping("/guard/{deviceId}/{guardCmdStr}") @GetMapping("/guard/{deviceId}/{guardCmdStr}")
public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) { public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) {
@ -160,9 +161,9 @@ public class DeviceControl {
*/ */
@ApiOperation("报警复位") @ApiOperation("报警复位")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "alarmMethod", value ="报警方式"), @ApiImplicitParam(name = "alarmMethod", value ="报警方式", dataTypeClass = String.class),
@ApiImplicitParam(name = "alarmType", value ="报警类型"), @ApiImplicitParam(name = "alarmType", value ="报警类型", dataTypeClass = String.class),
}) })
@GetMapping("/reset_alarm/{deviceId}") @GetMapping("/reset_alarm/{deviceId}")
public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId,
@ -200,8 +201,8 @@ public class DeviceControl {
*/ */
@ApiOperation("强制关键帧") @ApiOperation("强制关键帧")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value ="通道ID", required = true), @ApiImplicitParam(name = "channelId", value ="通道ID", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/i_frame/{deviceId}") @GetMapping("/i_frame/{deviceId}")
public ResponseEntity<String> iFrame(@PathVariable String deviceId, public ResponseEntity<String> iFrame(@PathVariable String deviceId,
@ -234,11 +235,11 @@ public class DeviceControl {
*/ */
@ApiOperation("看守位控制") @ApiOperation("看守位控制")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true), @ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔"), @ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔", dataTypeClass = String.class),
@ApiImplicitParam(name = "presetIndex", value = "调用预置位编号"), @ApiImplicitParam(name = "presetIndex", value = "调用预置位编号", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value ="通道ID"), @ApiImplicitParam(name = "channelId", value ="通道ID", dataTypeClass = String.class),
}) })
@GetMapping("/home_position/{deviceId}/{enabled}") @GetMapping("/home_position/{deviceId}/{enabled}")
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,

62
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.device; package com.genersoft.iot.vmp.vmanager.gb28181.device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
@ -22,7 +22,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import javax.sip.message.Response; import javax.sip.message.Response;
@Api(tags = "国标设备查询1", value = "国标设备查询") @Api(tags = "国标设备查询", value = "国标设备查询")
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@CrossOrigin @CrossOrigin
@RestController @RestController
@ -50,7 +50,7 @@ public class DeviceQuery {
*/ */
@ApiOperation("使用ID查询国标设备") @ApiOperation("使用ID查询国标设备")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/devices/{deviceId}") @GetMapping("/devices/{deviceId}")
public ResponseEntity<Device> devices(@PathVariable String deviceId){ public ResponseEntity<Device> devices(@PathVariable String deviceId){
@ -71,8 +71,8 @@ public class DeviceQuery {
*/ */
@ApiOperation("分页查询国标设备") @ApiOperation("分页查询国标设备")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true), @ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name = "count", value = "每页查询数量", required = true), @ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
}) })
@GetMapping("/devices") @GetMapping("/devices")
public PageInfo<Device> devices(int page, int count){ public PageInfo<Device> devices(int page, int count){
@ -98,12 +98,12 @@ public class DeviceQuery {
@ApiOperation("分页查询通道") @ApiOperation("分页查询通道")
@GetMapping("/devices/{deviceId}/channels") @GetMapping("/devices/{deviceId}/channels")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="deviceId", value = "设备id", required = true), @ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class),
@ApiImplicitParam(name="page", value = "当前页", required = true), @ApiImplicitParam(name="page", value = "当前页", required = true ,dataTypeClass = Integer.class),
@ApiImplicitParam(name="count", value = "每页查询数量", required = true), @ApiImplicitParam(name="count", value = "每页查询数量", required = true ,dataTypeClass = Integer.class),
@ApiImplicitParam(name="query", value = "查询内容"), @ApiImplicitParam(name="query", value = "查询内容" ,dataTypeClass = String.class),
@ApiImplicitParam(name="online", value = "是否在线"), @ApiImplicitParam(name="online", value = "是否在线" ,dataTypeClass = Boolean.class),
@ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true"), @ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true" ,dataTypeClass = Boolean.class),
}) })
public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, public ResponseEntity<PageInfo> channels(@PathVariable String deviceId,
int page, int count, int page, int count,
@ -128,7 +128,7 @@ public class DeviceQuery {
*/ */
@ApiOperation("同步设备通道") @ApiOperation("同步设备通道")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="deviceId", value = "设备id", required = true), @ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class),
}) })
@PostMapping("/devices/{deviceId}/sync") @PostMapping("/devices/{deviceId}/sync")
public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){ public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){
@ -165,7 +165,7 @@ public class DeviceQuery {
*/ */
@ApiOperation("移除设备") @ApiOperation("移除设备")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="deviceId", value = "设备id", required = true), @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
}) })
@DeleteMapping("/devices/{deviceId}/delete") @DeleteMapping("/devices/{deviceId}/delete")
public ResponseEntity<String> delete(@PathVariable String deviceId){ public ResponseEntity<String> delete(@PathVariable String deviceId){
@ -201,13 +201,13 @@ public class DeviceQuery {
*/ */
@ApiOperation("分页查询子目录通道") @ApiOperation("分页查询子目录通道")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="deviceId", value = "设备id", required = true), @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name="channelId", value = "通道id", required = true), @ApiImplicitParam(name="channelId", value = "通道id", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name="page", value = "当前页", required = true), @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="count", value = "每页条数", required = true), @ApiImplicitParam(name="count", value = "每页条数", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="query", value = "查询内容"), @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
@ApiImplicitParam(name="online", value = "是否在线"), @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = String.class),
@ApiImplicitParam(name="channelType", value = "通道类型, 子目录"), @ApiImplicitParam(name="channelType", value = "通道类型, 子目录", dataTypeClass = Boolean.class),
}) })
@GetMapping("/sub_channels/{deviceId}/{channelId}/channels") @GetMapping("/sub_channels/{deviceId}/{channelId}/channels")
public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId, public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId,
@ -239,8 +239,8 @@ public class DeviceQuery {
*/ */
@ApiOperation("更新通道信息") @ApiOperation("更新通道信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="deviceId", value = "设备id", required = true), @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name="channel", value = "通道", required = true), @ApiImplicitParam(name="channel", value = "通道", required = true, dataTypeClass = String.class),
}) })
@PostMapping("/channel/update/{deviceId}") @PostMapping("/channel/update/{deviceId}")
public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){ public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){
@ -256,7 +256,7 @@ public class DeviceQuery {
*/ */
@ApiOperation("修改数据流传输模式") @ApiOperation("修改数据流传输模式")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true), @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" + @ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" +
"UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"), "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"),
}) })
@ -275,7 +275,7 @@ public class DeviceQuery {
*/ */
@ApiOperation("设备状态查询") @ApiOperation("设备状态查询")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true), @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
}) })
@GetMapping("/devices/{deviceId}/status") @GetMapping("/devices/{deviceId}/status")
public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) {
@ -316,13 +316,13 @@ public class DeviceQuery {
*/ */
@ApiOperation("设备报警查询") @ApiOperation("设备报警查询")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true), @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "startPriority", value = "报警起始级别"), @ApiImplicitParam(name = "startPriority", value = "报警起始级别", dataTypeClass = String.class),
@ApiImplicitParam(name = "endPriority", value = "报警终止级别"), @ApiImplicitParam(name = "endPriority", value = "报警终止级别", dataTypeClass = String.class),
@ApiImplicitParam(name = "alarmMethod", value = "报警方式条件"), @ApiImplicitParam(name = "alarmMethod", value = "报警方式条件", dataTypeClass = String.class),
@ApiImplicitParam(name = "alarmType", value = "报警类型"), @ApiImplicitParam(name = "alarmType", value = "报警类型", dataTypeClass = String.class),
@ApiImplicitParam(name = "startTime", value = "报警发生起始时间"), @ApiImplicitParam(name = "startTime", value = "报警发生起始时间", dataTypeClass = String.class),
@ApiImplicitParam(name = "endTime", value = "报警发生终止时间"), @ApiImplicitParam(name = "endTime", value = "报警发生终止时间", dataTypeClass = String.class),
}) })
@GetMapping("/alarm/{deviceId}") @GetMapping("/alarm/{deviceId}")
public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId,

13
src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java

@ -1,8 +1,8 @@
package com.genersoft.iot.vmp.vmanager.gbStream; package com.genersoft.iot.vmp.vmanager.gb28181.gbStream;
import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam; import com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean.GbStreamParam;
import com.genersoft.iot.vmp.service.IGbStreamService; import com.genersoft.iot.vmp.service.IGbStreamService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -37,8 +37,8 @@ public class GbStreamController {
*/ */
@ApiOperation("查询国标通道") @ApiOperation("查询国标通道")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true ), @ApiImplicitParam(name = "page", value = "当前页", required = true , dataTypeClass = Integer.class),
@ApiImplicitParam(name = "count", value = "每页条数", required = true ), @ApiImplicitParam(name = "count", value = "每页条数", required = true , dataTypeClass = Integer.class),
}) })
@GetMapping(value = "/list") @GetMapping(value = "/list")
@ResponseBody @ResponseBody
@ -56,7 +56,8 @@ public class GbStreamController {
*/ */
@ApiOperation("移除国标关联") @ApiOperation("移除国标关联")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ,
dataTypeClass = GbStreamParam.class),
}) })
@DeleteMapping(value = "/del") @DeleteMapping(value = "/del")
@ResponseBody @ResponseBody
@ -76,7 +77,7 @@ public class GbStreamController {
*/ */
@ApiOperation("保存国标关联") @ApiOperation("保存国标关联")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true , dataTypeClass = GbStreamParam.class),
}) })
@PostMapping(value = "/add") @PostMapping(value = "/add")
@ResponseBody @ResponseBody

2
src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/bean/GbStreamParam.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/bean/GbStreamParam.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.gbStream.bean; package com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean;
import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.GbStream;

11
src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java

@ -1,13 +1,8 @@
package com.genersoft.iot.vmp.vmanager.media; package com.genersoft.iot.vmp.vmanager.gb28181.media;
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
import com.genersoft.iot.vmp.service.IStreamPushService; import com.genersoft.iot.vmp.service.IStreamPushService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -46,8 +41,8 @@ public class MediaController {
*/ */
@ApiOperation("根据应用名和流id获取播放地址") @ApiOperation("根据应用名和流id获取播放地址")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "app", value = "应用名"), @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
@ApiImplicitParam(name = "stream", value = "流id"), @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class),
}) })
@RequestMapping(value = "/getStreamInfoByAppAndStream") @RequestMapping(value = "/getStreamInfoByAppAndStream")
@ResponseBody @ResponseBody

104
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java

@ -1,14 +1,17 @@
package com.genersoft.iot.vmp.vmanager.platform; package com.genersoft.iot.vmp.vmanager.gb28181.platform;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,7 +24,7 @@ import com.genersoft.iot.vmp.conf.SipConfig;
/** /**
* 级联平台管理 * 级联平台管理
*/ */
@Api("级联平台管理") @Api(tags = "级联平台管理")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api/platform") @RequestMapping("/api/platform")
@ -41,6 +44,11 @@ public class PlatformController {
@Autowired @Autowired
private SipConfig sipConfig; private SipConfig sipConfig;
/**
* 获取国标服务的配置
* @return
*/
@ApiOperation("获取国标服务的配置")
@GetMapping("/server_config") @GetMapping("/server_config")
public ResponseEntity<JSONObject> serverConfig() { public ResponseEntity<JSONObject> serverConfig() {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
@ -51,7 +59,18 @@ public class PlatformController {
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
/**
* 分页查询级联平台
* @param page 当前页
* @param count 每页条数
* @return
*/
@ApiOperation("分页查询级联平台")
@GetMapping("/query/{count}/{page}") @GetMapping("/query/{count}/{page}")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class),
})
public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
@ -60,6 +79,15 @@ public class PlatformController {
return storager.queryParentPlatformList(page, count); return storager.queryParentPlatformList(page, count);
} }
/**
* 保存上级平台信息
* @param parentPlatform
* @return
*/
@ApiOperation("保存上级平台信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "parentPlatform", value = "上级平台信息", dataTypeClass = ParentPlatform.class),
})
@PostMapping("/save") @PostMapping("/save")
@ResponseBody @ResponseBody
public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){
@ -96,13 +124,22 @@ public class PlatformController {
commanderForPlatform.unregister(parentPlatform, null, null); commanderForPlatform.unregister(parentPlatform, null, null);
} }
return new ResponseEntity<>("success", HttpStatus.OK); return new ResponseEntity<>("success", HttpStatus.OK);
} else { } else {
return new ResponseEntity<>("fail", HttpStatus.OK); return new ResponseEntity<>("fail", HttpStatus.OK);
} }
} }
/**
* 删除上级平台
* @param serverGBId 上级平台国标ID
* @return
*/
@ApiOperation("删除上级平台")
@ApiImplicitParams({
@ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class),
})
@DeleteMapping("/delete/{serverGBId}") @DeleteMapping("/delete/{serverGBId}")
@ResponseBody @ResponseBody
public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){
@ -139,17 +176,47 @@ public class PlatformController {
} }
} }
@GetMapping("/exit/{deviceGbId}") /**
* 查询上级平台是否存在
* @param serverGBId 上级平台国标ID
* @return
*/
@ApiOperation("查询上级平台是否存在")
@ApiImplicitParams({
@ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class),
})
@GetMapping("/exit/{serverGBId}")
@ResponseBody @ResponseBody
public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){ public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("查询上级平台是否存在API调用:" + deviceGbId); logger.debug("查询上级平台是否存在API调用:" + serverGBId);
} }
ParentPlatform parentPlatform = storager.queryParentPlatById(deviceGbId); ParentPlatform parentPlatform = storager.queryParentPlatById(serverGBId);
return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK);
} }
/**
* 分页查询级联平台的所有所有通道
* @param page 当前页
* @param count 每页条数
* @param platformId 上级平台ID
* @param query 查询内容
* @param online 是否在线
* @param choosed 是否已选中
* @param channelType 通道类型
* @return
*/
@ApiOperation("分页查询级联平台的所有所有通道")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "platformId", value = "上级平台ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "query", value = "查询内容", dataTypeClass = String.class),
@ApiImplicitParam(name = "online", value = "是否在线", dataTypeClass = Boolean.class),
@ApiImplicitParam(name = "choosed", value = "是否已选中", dataTypeClass = Boolean.class),
@ApiImplicitParam(name = "channelType", value = "通道类型", dataTypeClass = Boolean.class),
})
@GetMapping("/channel_list") @GetMapping("/channel_list")
@ResponseBody @ResponseBody
public PageInfo<ChannelReduce> channelList(int page, int count, public PageInfo<ChannelReduce> channelList(int page, int count,
@ -172,7 +239,15 @@ public class PlatformController {
return channelReduces; return channelReduces;
} }
/**
* 向上级平台添加国标通道
* @param param 通道关联参数
* @return
*/
@ApiOperation("向上级平台添加国标通道")
@ApiImplicitParams({
@ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class),
})
@PostMapping("/update_channel_for_gb") @PostMapping("/update_channel_for_gb")
@ResponseBody @ResponseBody
public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){
@ -185,6 +260,15 @@ public class PlatformController {
return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
} }
/**
* 从上级平台移除国标通道
* @param param 通道关联参数
* @return
*/
@ApiOperation("从上级平台移除国标通道")
@ApiImplicitParams({
@ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class),
})
@DeleteMapping("/del_channel_for_gb") @DeleteMapping("/del_channel_for_gb")
@ResponseBody @ResponseBody
public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){

2
src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/ChannelReduce.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/ChannelReduce.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.platform.bean; package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
/** /**
* 精简的channel信息展示主要是选择通道的时候展示列表使用 * 精简的channel信息展示主要是选择通道的时候展示列表使用

2
src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/UpdateChannelParam.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/UpdateChannelParam.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.platform.bean; package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
import java.util.List; import java.util.List;

14
src/main/java/com/genersoft/iot/vmp/vmanager/platformGbStream/PlatformGbStreamController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java

@ -1,17 +1,22 @@
package com.genersoft.iot.vmp.vmanager.platformGbStream; package com.genersoft.iot.vmp.vmanager.gb28181.platformGbStream;
import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.service.IGbStreamService; import com.genersoft.iot.vmp.service.IGbStreamService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@Api(tags = "级联平台关联视频流")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api/platform_gb_stream")
public class PlatformGbStreamController { public class PlatformGbStreamController {
private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class); private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class);
@ -22,6 +27,11 @@ public class PlatformGbStreamController {
@Autowired @Autowired
private IVideoManagerStorager storager; private IVideoManagerStorager storager;
@ApiOperation("分页查询级联平台关联的视频流")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class),
})
@RequestMapping(value = "/list") @RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, public PageInfo<GbStream> list(@RequestParam(required = false)Integer page,

35
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.play; package com.genersoft.iot.vmp.vmanager.gb28181.play;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.MediaServerConfig; import com.genersoft.iot.vmp.conf.MediaServerConfig;
@ -7,9 +7,13 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult;
import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.service.IPlayService; import com.genersoft.iot.vmp.service.IPlayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -31,6 +35,7 @@ import java.util.UUID;
import javax.sip.message.Response; import javax.sip.message.Response;
@Api(tags = "国标设备点播")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api/play") @RequestMapping("/api/play")
@ -59,6 +64,11 @@ public class PlayController {
@Autowired @Autowired
private IMediaService mediaService; private IMediaService mediaService;
@ApiOperation("开始点播")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
})
@GetMapping("/start/{deviceId}/{channelId}") @GetMapping("/start/{deviceId}/{channelId}")
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId,
@PathVariable String channelId) { @PathVariable String channelId) {
@ -79,6 +89,10 @@ public class PlayController {
return playResult.getResult(); return playResult.getResult();
} }
@ApiOperation("停止点播")
@ApiImplicitParams({
@ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class),
})
@PostMapping("/stop/{streamId}") @PostMapping("/stop/{streamId}")
public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) {
@ -139,6 +153,10 @@ public class PlayController {
* @param streamId 流ID * @param streamId 流ID
* @return * @return
*/ */
@ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac")
@ApiImplicitParams({
@ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class),
})
@PostMapping("/convert/{streamId}") @PostMapping("/convert/{streamId}")
public ResponseEntity<String> playConvert(@PathVariable String streamId) { public ResponseEntity<String> playConvert(@PathVariable String streamId) {
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
@ -179,6 +197,10 @@ public class PlayController {
* @param key * @param key
* @return * @return
*/ */
@ApiOperation("结束转码")
@ApiImplicitParams({
@ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class),
})
@PostMapping("/convertStop/{key}") @PostMapping("/convertStop/{key}")
public ResponseEntity<String> playConvertStop(@PathVariable String key) { public ResponseEntity<String> playConvertStop(@PathVariable String key) {
@ -201,11 +223,10 @@ public class PlayController {
return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK); return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK);
} }
/** @ApiOperation("语音广播命令")
* 语音广播命令API接口 @ApiImplicitParams({
* @ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
* @param deviceId })
*/
@GetMapping("/broadcast/{deviceId}") @GetMapping("/broadcast/{deviceId}")
@PostMapping("/broadcast/{deviceId}") @PostMapping("/broadcast/{deviceId}")
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) { public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) {

2
src/main/java/com/genersoft/iot/vmp/vmanager/play/bean/PlayResult.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.play.bean; package com.genersoft.iot.vmp.vmanager.gb28181.play.bean;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;

22
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java

@ -1,4 +1,4 @@
package com.genersoft.iot.vmp.vmanager.playback; package com.genersoft.iot.vmp.vmanager.gb28181.playback;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
@ -6,6 +6,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
//import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; //import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.service.IPlayService; import com.genersoft.iot.vmp.service.IPlayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +30,7 @@ import org.springframework.web.context.request.async.DeferredResult;
import javax.sip.message.Response; import javax.sip.message.Response;
import java.util.UUID; import java.util.UUID;
@Api(tags = "视频回放")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api/playback") @RequestMapping("/api/playback")
@ -51,9 +56,16 @@ public class PlaybackController {
@Autowired @Autowired
private DeferredResultHolder resultHolder; private DeferredResultHolder resultHolder;
@ApiOperation("开始视频回放")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataTypeClass = String.class),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataTypeClass = String.class),
})
@GetMapping("/start/{deviceId}/{channelId}") @GetMapping("/start/{deviceId}/{channelId}")
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId, String startTime, public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
String endTime) { String startTime,String endTime) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId)); logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId));
@ -89,6 +101,10 @@ public class PlaybackController {
return result; return result;
} }
@ApiOperation("停止视频回放")
@ApiImplicitParams({
@ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class),
})
@RequestMapping("/stop/{ssrc}") @RequestMapping("/stop/{ssrc}")
public ResponseEntity<String> playStop(@PathVariable String ssrc) { public ResponseEntity<String> playStop(@PathVariable String ssrc) {

72
src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java

@ -1,5 +1,9 @@
package com.genersoft.iot.vmp.vmanager.ptz; package com.genersoft.iot.vmp.vmanager.gb28181.ptz;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -17,22 +21,23 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
@Api(tags = "云台控制")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api/ptz")
public class PtzController { public class PtzController {
private final static Logger logger = LoggerFactory.getLogger(PtzController.class); private final static Logger logger = LoggerFactory.getLogger(PtzController.class);
@Autowired @Autowired
private SIPCommander cmder; private SIPCommander cmder;
@Autowired @Autowired
private IVideoManagerStorager storager; private IVideoManagerStorager storager;
@Autowired @Autowired
private DeferredResultHolder resultHolder; private DeferredResultHolder resultHolder;
/*** /***
* 云台控制 * 云台控制
* @param deviceId 设备id * @param deviceId 设备id
@ -43,49 +48,54 @@ public class PtzController {
* @param zoomSpeed 缩放速度 * @param zoomSpeed 缩放速度
* @return String 控制结果 * @return String 控制结果
*/ */
@PostMapping("/ptz/{deviceId}/{channelId}") @ApiOperation("云台控制")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "cmdCode", value = "指令码", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "horizonSpeed", value = "水平速度", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "verticalSpeed", value = "垂直速度", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "zoomSpeed", value = "缩放速度", dataTypeClass = Integer.class),
})
@PostMapping("/control/{deviceId}/{channelId}")
public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){ public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed)); logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed));
} }
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);
cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed);
return new ResponseEntity<String>("success",HttpStatus.OK); return new ResponseEntity<String>("success",HttpStatus.OK);
} }
/** @ApiOperation("通用前端控制命令")
* 通用前端控制命令API接口 @ApiImplicitParams({
* @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
* @param deviceId @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
* @param channelId @ApiImplicitParam(name = "cmdCode", value = "指令码", dataTypeClass = Integer.class),
* @param cmdCode @ApiImplicitParam(name = "parameter1", value = "数据一", dataTypeClass = Integer.class),
* @param parameter1 @ApiImplicitParam(name = "parameter2", value = "数据二", dataTypeClass = Integer.class),
* @param parameter2 @ApiImplicitParam(name = "combindCode2", value = "组合码二", dataTypeClass = Integer.class),
* @param combindCode2 })
* @return @PostMapping("/front_end_command/{deviceId}/{channelId}")
*/
@PostMapping("/frontEndCommand/{deviceId}/{channelId}")
public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2)); logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2));
} }
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);
cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2); cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2);
return new ResponseEntity<String>("success",HttpStatus.OK); return new ResponseEntity<String>("success",HttpStatus.OK);
} }
/** @ApiOperation("预置位查询")
* 预置位查询命令API接口 @ApiImplicitParams({
* @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
* @param deviceId @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
* @param channelId })
* @return @GetMapping("/preset/query/{deviceId}/{channelId}")
*/
@GetMapping("/presetQuery/{deviceId}/{channelId}")
public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("设备预置位查询API调用"); logger.debug("设备预置位查询API调用");

30
src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java → src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/RecordController.java

@ -1,6 +1,10 @@
package com.genersoft.iot.vmp.vmanager.record; package com.genersoft.iot.vmp.vmanager.gb28181.record;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -18,29 +22,37 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
@Api(tags = "国标录像")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api/gb_record")
public class RecordController { public class RecordController {
private final static Logger logger = LoggerFactory.getLogger(RecordController.class); private final static Logger logger = LoggerFactory.getLogger(RecordController.class);
@Autowired @Autowired
private SIPCommander cmder; private SIPCommander cmder;
@Autowired @Autowired
private IVideoManagerStorager storager; private IVideoManagerStorager storager;
@Autowired @Autowired
private DeferredResultHolder resultHolder; private DeferredResultHolder resultHolder;
@GetMapping("/record/{deviceId}/{channelId}") @ApiOperation("录像查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataTypeClass = String.class),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataTypeClass = String.class),
})
@GetMapping("/query/{deviceId}/{channelId}")
public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){ public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime)); logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime));
} }
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);
cmder.recordInfoQuery(device, channelId, startTime, endTime); cmder.recordInfoQuery(device, channelId, startTime, endTime);
// 指定超时时间 1分钟30秒 // 指定超时时间 1分钟30秒

5
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java

@ -2,8 +2,9 @@ package com.genersoft.iot.vmp.vmanager.server;
import com.genersoft.iot.vmp.VManageBootstrap; import com.genersoft.iot.vmp.VManageBootstrap;
import com.genersoft.iot.vmp.utils.SpringBeanFactory; import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam;
import gov.nist.javax.sip.SipStackImpl; import gov.nist.javax.sip.SipStackImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -13,6 +14,7 @@ import javax.sip.ObjectInUseException;
import javax.sip.SipProvider; import javax.sip.SipProvider;
import java.util.Iterator; import java.util.Iterator;
@Api(tags = "服务控制")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api/server") @RequestMapping("/api/server")
@ -22,6 +24,7 @@ public class ServerController {
private ConfigurableApplicationContext context; private ConfigurableApplicationContext context;
@ApiOperation("重启服务")
@RequestMapping(value = "/restart") @RequestMapping(value = "/restart")
@ResponseBody @ResponseBody
public Object restart(){ public Object restart(){

34
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java

@ -5,6 +5,11 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.service.IStreamProxyService; import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
/** /**
* 拉流代理接口 * 拉流代理接口
*/ */
@Api(tags = "拉流代理")
@Controller @Controller
@CrossOrigin @CrossOrigin
@RequestMapping(value = "/api/proxy") @RequestMapping(value = "/api/proxy")
@ -28,16 +34,27 @@ public class StreamProxyController {
private IStreamProxyService streamProxyService; private IStreamProxyService streamProxyService;
@ApiOperation("分页查询流代理")
@ApiImplicitParams({
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
@ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class),
})
@RequestMapping(value = "/list") @RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page,
@RequestParam(required = false)Integer count, @RequestParam(required = false)Integer count,
@RequestParam(required = false)String q, @RequestParam(required = false)String query,
@RequestParam(required = false)Boolean online ){ @RequestParam(required = false)Boolean online ){
return streamProxyService.getAll(page, count); return streamProxyService.getAll(page, count);
} }
@ApiOperation("保存代理")
@ApiImplicitParams({
@ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class),
})
@RequestMapping(value = "/save") @RequestMapping(value = "/save")
@ResponseBody @ResponseBody
public Object save(@RequestBody StreamProxyItem param){ public Object save(@RequestBody StreamProxyItem param){
@ -46,6 +63,11 @@ public class StreamProxyController {
return "success"; return "success";
} }
@ApiOperation("移除代理")
@ApiImplicitParams({
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
})
@RequestMapping(value = "/del") @RequestMapping(value = "/del")
@ResponseBody @ResponseBody
public Object del(String app, String stream){ public Object del(String app, String stream){
@ -54,6 +76,11 @@ public class StreamProxyController {
return "success"; return "success";
} }
@ApiOperation("启用代理")
@ApiImplicitParams({
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
})
@RequestMapping(value = "/start") @RequestMapping(value = "/start")
@ResponseBody @ResponseBody
public Object start(String app, String stream){ public Object start(String app, String stream){
@ -62,6 +89,11 @@ public class StreamProxyController {
return "success"; return "success";
} }
@ApiOperation("停用代理")
@ApiImplicitParams({
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
})
@RequestMapping(value = "/stop") @RequestMapping(value = "/stop")
@ResponseBody @ResponseBody
public Object stop(String app, String stream){ public Object stop(String app, String stream){

31
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java

@ -1,19 +1,20 @@
package com.genersoft.iot.vmp.vmanager.streamPush; package com.genersoft.iot.vmp.vmanager.streamPush;
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
import com.genersoft.iot.vmp.service.IStreamPushService; import com.genersoft.iot.vmp.service.IStreamPushService;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.media.MediaController;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@Api(tags = "推流信息管理")
@Controller @Controller
@CrossOrigin @CrossOrigin
@RequestMapping(value = "/api/push") @RequestMapping(value = "/api/push")
@ -24,18 +25,29 @@ public class StreamPushController {
@Autowired @Autowired
private IStreamPushService streamPushService; private IStreamPushService streamPushService;
@ApiOperation("推流列表查询")
@ApiImplicitParams({
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
@ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
@ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class),
})
@RequestMapping(value = "/list") @RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page,
@RequestParam(required = false)Integer count, @RequestParam(required = false)Integer count,
@RequestParam(required = false)String q, @RequestParam(required = false)String query,
@RequestParam(required = false)Boolean online ){ @RequestParam(required = false)Boolean online ){
PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count); PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count);
return pushList; return pushList;
} }
@RequestMapping(value = "/saveToGB") @ApiOperation("将推流添加到国标")
@ApiImplicitParams({
@ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class),
})
@RequestMapping(value = "/save_to_gb")
@ResponseBody @ResponseBody
public Object saveToGB(@RequestBody GbStream stream){ public Object saveToGB(@RequestBody GbStream stream){
if (streamPushService.saveToGB(stream)){ if (streamPushService.saveToGB(stream)){
@ -45,7 +57,12 @@ public class StreamPushController {
} }
} }
@RequestMapping(value = "/removeFormGB")
@ApiOperation("将推流移出到国标")
@ApiImplicitParams({
@ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class),
})
@RequestMapping(value = "/remove_form_gb")
@ResponseBody @ResponseBody
public Object removeFormGB(@RequestBody GbStream stream){ public Object removeFormGB(@RequestBody GbStream stream){
if (streamPushService.removeFromGB(stream)){ if (streamPushService.removeFromGB(stream)){

15
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java

@ -1,14 +1,20 @@
package com.genersoft.iot.vmp.vmanager.user; package com.genersoft.iot.vmp.vmanager.user;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Api(tags = "用户管理")
@CrossOrigin @CrossOrigin
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api/user")
public class UserController { public class UserController {
@Value("${auth.username}") @Value("${auth.username}")
@ -17,7 +23,12 @@ public class UserController {
@Value("${auth.password}") @Value("${auth.password}")
private String passwordConfig; private String passwordConfig;
@RequestMapping("/user/login") @ApiOperation("登录")
@ApiImplicitParams({
@ApiImplicitParam(name = "username", value = "用户名", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "密码(32未md5加密)", dataTypeClass = String.class),
})
@RequestMapping("/login")
public String login(String username, String password){ public String login(String username, String password){
if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) if (!StringUtils.isEmpty(username) && username.equals(usernameConfig)
&& !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) {

2
src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java

@ -9,7 +9,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
// import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; // import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.play.PlayController; import com.genersoft.iot.vmp.vmanager.gb28181.play.PlayController;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

2
web_src/index.html

@ -6,7 +6,7 @@
<title>国标28181</title> <title>国标28181</title>
</head> </head>
<body> <body>
<!-- <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script> --> <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script>
<script type="text/javascript" src="/static/js/ZLMRTCClient.js"></script> <script type="text/javascript" src="/static/js/ZLMRTCClient.js"></script>
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script> <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script>
<div id="app"></div> <div id="app"></div>

2
web_src/src/components/PushVideoList.vue

@ -155,7 +155,7 @@
}, },
removeFromGB: function(row){ removeFromGB: function(row){
var that = this; var that = this;
that.$axios.post(`/api/push/removeFormGB`, row) that.$axios.post(`/api/push/remove_form_gb`, row)
.then(function (res) { .then(function (res) {
console.log(res); console.log(res);
console.log(res.data == "success"); console.log(res.data == "success");

2
web_src/src/components/dialog/addStreamTOGB.vue

@ -90,7 +90,7 @@ export default {
console.log("onSubmit"); console.log("onSubmit");
var that = this; var that = this;
that.$axios that.$axios
.post(`/api/push/saveToGB`, that.proxyParam) .post(`/api/push/save_to_gb`, that.proxyParam)
.then(function (res) { .then(function (res) {
console.log(res); console.log(res);
console.log(res.data == "success"); console.log(res.data == "success");

20
web_src/src/components/dialog/devicePlayer.vue

@ -26,7 +26,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}-->
<el-tab-pane label="录像查询" name="record" v-if="showRrecord"> <el-tab-pane label="录像查询" name="record" v-if="showRrecord">
<el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker>
<el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading">
<el-table-column label="名称" prop="name"></el-table-column> <el-table-column label="名称" prop="name"></el-table-column>
@ -70,7 +70,7 @@
<el-slider v-model="controSpeed" :max="255"></el-slider> <el-slider v-model="controSpeed" :max="255"></el-slider>
</div> </div>
</div> </div>
<div class="control-panel"> <div class="control-panel">
<el-button-group> <el-button-group>
<el-tag style="position :absolute; left: 0rem; top: 0rem; width: 5rem; text-align: center" size="medium" type="info">预置位编号</el-tag> <el-tag style="position :absolute; left: 0rem; top: 0rem; width: 5rem; text-align: center" size="medium" type="info">预置位编号</el-tag>
@ -136,7 +136,8 @@
</template> </template>
<script> <script>
import player from '../dialog/rtcPlayer.vue' // import player from '../dialog/rtcPlayer.vue'
import player from '../dialog/easyPlayer.vue'
export default { export default {
name: 'devicePlayer', name: 'devicePlayer',
props: {}, props: {},
@ -250,7 +251,8 @@ export default {
this.hasaudio = hasAudio; this.hasaudio = hasAudio;
this.isLoging = false; this.isLoging = false;
this.videoUrl = streamInfo.rtc; // this.videoUrl = streamInfo.rtc;
this.videoUrl = streamInfo.ws_flv;
this.streamId = streamInfo.streamId; this.streamId = streamInfo.streamId;
this.app = streamInfo.app; this.app = streamInfo.app;
this.playFromStreamInfo(false, streamInfo) this.playFromStreamInfo(false, streamInfo)
@ -369,7 +371,7 @@ export default {
var endTime = this.videoHistory.date + " 23:59:59"; var endTime = this.videoHistory.date + " 23:59:59";
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/api/record/' + this.deviceId + '/' + this.channelId + '?startTime=' + startTime + '&endTime=' + endTime url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + startTime + '&endTime=' + endTime
}).then(function (res) { }).then(function (res) {
// //
that.videoHistory.searchHistoryResult = res.data.recordList; that.videoHistory.searchHistoryResult = res.data.recordList;
@ -420,7 +422,7 @@ export default {
method: 'post', method: 'post',
// url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown + // url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown +
// '&inOut=' + zoom + '&moveSpeed=50&zoomSpeed=50' // '&inOut=' + zoom + '&moveSpeed=50&zoomSpeed=50'
url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + (zoom * 16 + upDown * 4 + leftRight) + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + (zoom * 16 + upDown * 4 + leftRight) + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed
}).then(function (res) {}); }).then(function (res) {});
}, },
//////////////////////////////////////////////// ////////////////////////////////////////////////
@ -432,7 +434,7 @@ export default {
let that = this; let that = this;
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0' url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=0&parameter2=' + presetPos + '&combindCode2=0'
}).then(function (res) {}); }).then(function (res) {});
}, },
setSpeedOrTime: function (cmdCode, groupNum, parameter) { setSpeedOrTime: function (cmdCode, groupNum, parameter) {
@ -442,7 +444,7 @@ export default {
console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16));
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2 url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter2 + '&combindCode2=' + combindCode2
}).then(function (res) {}); }).then(function (res) {});
}, },
setCommand: function (cmdCode, groupNum, parameter) { setCommand: function (cmdCode, groupNum, parameter) {
@ -450,7 +452,7 @@ export default {
console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0');
this.$axios({ this.$axios({
method: 'post', method: 'post',
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0' url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '&parameter1=' + groupNum + '&parameter2=' + parameter + '&combindCode2=0'
}).then(function (res) {}); }).then(function (res) {});
}, },
formatTooltip: function (val) { formatTooltip: function (val) {

57
web_src/src/components/dialog/player.vue

@ -1,57 +0,0 @@
<template>
<div id="player">
<div id="easyplayer"></div>
</div>
</template>
<script>
export default {
name: 'player',
data() {
return {
easyPlayer: null
};
},
props: ['videoUrl', 'error', 'hasaudio'],
mounted () {
this.$nextTick(() =>{
console.log("初始化时的地址为: " + this.videoUrl)
this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
this.easyPlayer.play(this.videoUrl, 1)
})
},
watch:{
videoUrl(newData, oldData){
this.easyPlayer.destroy()
this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
this.easyPlayer.play(newData, 1)
},
immediate:true
},
methods: {
play: function (url) {
this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
this.easyPlayer.play(url, 1)
},
pause: function () {
this.easyPlayer.destroy();
},
eventcallbacK: function(type, message) {
console.log("player 事件回调")
console.log(type)
console.log(message)
}
},
}
</script>
<style>
.LodingTitle {
min-width: 70px;
}
/* 隐藏logo */
/* .iconqingxiLOGO {
display: none !important;
} */
</style>
Loading…
Cancel
Save