规范api
parent
89244932c6
commit
a004a978fa
|
@ -23,12 +23,70 @@ public class Swagger3Config {
|
|||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(apiInfo())
|
||||
.groupName("全部")
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager"))
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.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() {
|
||||
return new ApiInfoBuilder()
|
||||
|
|
|
@ -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.storager.IRedisCatchStorage;
|
||||
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 gov.nist.javax.sip.address.AddressImpl;
|
||||
import gov.nist.javax.sip.address.SipUri;
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
|||
import com.genersoft.iot.vmp.utils.GpsUtil;
|
||||
import com.genersoft.iot.vmp.utils.SpringBeanFactory;
|
||||
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.address.AddressImpl;
|
||||
|
|
|
@ -245,13 +245,13 @@ public class ZLMHttpHookListener {
|
|||
String streamId = json.getString("stream");
|
||||
String schema = json.getString("schema");
|
||||
JSONArray tracks = json.getJSONArray("tracks");
|
||||
String regist = json.getString("regist");
|
||||
boolean regist = json.getBoolean("regist");
|
||||
if (tracks != null) {
|
||||
System.out.println("222222" + schema);
|
||||
}
|
||||
if ("rtmp".equals(schema)){
|
||||
|
||||
if ("rtp".equals(app) && regist != null ) {
|
||||
if ("rtp".equals(app) && !regist ) {
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
|
||||
if (streamInfo!=null){
|
||||
redisCatchStorage.stopPlay(streamInfo);
|
||||
|
@ -262,7 +262,7 @@ public class ZLMHttpHookListener {
|
|||
}
|
||||
}else {
|
||||
if (!"rtp".equals(app) ){
|
||||
if (regist == null) {
|
||||
if (regist) {
|
||||
zlmMediaListManager.addMedia(app, streamId);
|
||||
}else {
|
||||
zlmMediaListManager.removeMedia(app, streamId);
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 点播处理
|
||||
|
|
|
@ -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.storager.IRedisCatchStorage;
|
||||
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.IPlayService;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
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.springframework.stereotype.Repository;
|
||||
|
||||
|
|
|
@ -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.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.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
|
@ -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.storager.IRedisCatchStorage;
|
||||
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.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.genersoft.iot.vmp.vmanager.MobilePosition;
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -58,9 +58,9 @@ public class MobilePositionController {
|
|||
*/
|
||||
@ApiOperation("查询历史轨迹")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", required = true),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/history/{deviceId}")
|
||||
public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId,
|
||||
|
@ -88,7 +88,7 @@ public class MobilePositionController {
|
|||
*/
|
||||
@ApiOperation("查询设备最新位置")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/latest/{deviceId}")
|
||||
public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) {
|
||||
|
@ -106,7 +106,7 @@ public class MobilePositionController {
|
|||
*/
|
||||
@ApiOperation("获取移动位置信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/realtime/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) {
|
||||
|
@ -140,9 +140,9 @@ public class MobilePositionController {
|
|||
*/
|
||||
@ApiOperation("订阅位置信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "expires", value = "订阅超时时间"),
|
||||
@ApiImplicitParam(name = "interval", value = "上报时间间隔"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "expires", value = "订阅超时时间", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "interval", value = "上报时间间隔", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/subscribe/{deviceId}")
|
||||
public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId,
|
|
@ -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 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.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
@ -13,15 +17,18 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|||
* @author: lawrencehj
|
||||
* @data: 2021-01-20
|
||||
*/
|
||||
|
||||
@Api(tags = "SSE推送")
|
||||
@CrossOrigin
|
||||
@Controller
|
||||
@RequestMapping("/api")
|
||||
public class SseController {
|
||||
@Autowired
|
||||
@Autowired
|
||||
AlarmEventListener alarmEventListener;
|
||||
|
||||
//设置响应
|
||||
|
||||
@ApiOperation("设置响应")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping("/emit")
|
||||
public SseEmitter emit(@RequestParam String browserId) {
|
||||
final SseEmitter sseEmitter = new SseEmitter(0L);
|
|
@ -5,7 +5,7 @@
|
|||
* @date 2021年2月2日
|
||||
*/
|
||||
|
||||
package com.genersoft.iot.vmp.vmanager.device;
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.device;
|
||||
|
||||
import javax.sip.message.Response;
|
||||
|
||||
|
@ -24,7 +24,6 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.async.DeferredResult;
|
||||
|
@ -59,12 +58,12 @@ public class DeviceConfig {
|
|||
@ApiOperation("看守位控制命令")
|
||||
@GetMapping("/basicParam/{deviceId}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID" ),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID" ),
|
||||
@ApiImplicitParam(name = "name", value ="名称" ),
|
||||
@ApiImplicitParam(name = "expiration", value ="到期时间" ),
|
||||
@ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ),
|
||||
@ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ),
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID",dataTypeClass = String.class ),
|
||||
@ApiImplicitParam(name = "name", value ="名称" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "expiration", value ="到期时间" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ,dataTypeClass = String.class),
|
||||
})
|
||||
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,
|
||||
@RequestParam(required = false) String channelId,
|
||||
|
@ -109,9 +108,9 @@ public class DeviceConfig {
|
|||
*/
|
||||
@ApiOperation("设备配置查询请求")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID" ),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID" ),
|
||||
@ApiImplicitParam(name = "configType", value ="配置类型" ),
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "configType", value ="配置类型" ,dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/query/{deviceId}/{configType}")
|
||||
public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId,
|
|
@ -5,7 +5,7 @@
|
|||
* @date 2021年2月1日
|
||||
*/
|
||||
|
||||
package com.genersoft.iot.vmp.vmanager.device;
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.device;
|
||||
|
||||
import javax.sip.message.Response;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("远程启动控制命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/teleboot/{deviceId}")
|
||||
public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) {
|
||||
|
@ -82,10 +82,10 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("录像控制命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道编码"),
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道编码" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)",
|
||||
required = true),
|
||||
required = true ,dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/record/{deviceId}/{recordCmdStr}")
|
||||
public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId,
|
||||
|
@ -122,8 +122,9 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("录像控制命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true)
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true,
|
||||
dataTypeClass = String.class)
|
||||
})
|
||||
@GetMapping("/guard/{deviceId}/{guardCmdStr}")
|
||||
public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) {
|
||||
|
@ -160,9 +161,9 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("报警复位")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "alarmMethod", value ="报警方式"),
|
||||
@ApiImplicitParam(name = "alarmType", value ="报警类型"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmMethod", value ="报警方式", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmType", value ="报警类型", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/reset_alarm/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId,
|
||||
|
@ -200,8 +201,8 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("强制关键帧")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/i_frame/{deviceId}")
|
||||
public ResponseEntity<String> iFrame(@PathVariable String deviceId,
|
||||
|
@ -234,11 +235,11 @@ public class DeviceControl {
|
|||
*/
|
||||
@ApiOperation("看守位控制")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true),
|
||||
@ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔"),
|
||||
@ApiImplicitParam(name = "presetIndex", value = "调用预置位编号"),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "presetIndex", value = "调用预置位编号", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/home_position/{deviceId}/{enabled}")
|
||||
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,
|
|
@ -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.transmit.callback.RequestMessage;
|
||||
|
@ -22,7 +22,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
|||
|
||||
import javax.sip.message.Response;
|
||||
|
||||
@Api(tags = "国标设备查询1", value = "国标设备查询")
|
||||
@Api(tags = "国标设备查询", value = "国标设备查询")
|
||||
@SuppressWarnings("rawtypes")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
|
@ -50,7 +50,7 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("使用ID查询国标设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/devices/{deviceId}")
|
||||
public ResponseEntity<Device> devices(@PathVariable String deviceId){
|
||||
|
@ -71,8 +71,8 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("分页查询国标设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true),
|
||||
@ApiImplicitParam(name = "count", value = "每页查询数量", required = true),
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@GetMapping("/devices")
|
||||
public PageInfo<Device> devices(int page, int count){
|
||||
|
@ -98,12 +98,12 @@ public class DeviceQuery {
|
|||
@ApiOperation("分页查询通道")
|
||||
@GetMapping("/devices/{deviceId}/channels")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true),
|
||||
@ApiImplicitParam(name="count", value = "每页查询数量", required = true),
|
||||
@ApiImplicitParam(name="query", value = "查询内容"),
|
||||
@ApiImplicitParam(name="online", value = "是否在线"),
|
||||
@ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true"),
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class),
|
||||
@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),
|
||||
@ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true" ,dataTypeClass = Boolean.class),
|
||||
})
|
||||
public ResponseEntity<PageInfo> channels(@PathVariable String deviceId,
|
||||
int page, int count,
|
||||
|
@ -128,7 +128,7 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("同步设备通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/devices/{deviceId}/sync")
|
||||
public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){
|
||||
|
@ -165,7 +165,7 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("移除设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@DeleteMapping("/devices/{deviceId}/delete")
|
||||
public ResponseEntity<String> delete(@PathVariable String deviceId){
|
||||
|
@ -201,13 +201,13 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("分页查询子目录通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name="channelId", value = "通道id", required = true),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true),
|
||||
@ApiImplicitParam(name="count", value = "每页条数", required = true),
|
||||
@ApiImplicitParam(name="query", value = "查询内容"),
|
||||
@ApiImplicitParam(name="online", value = "是否在线"),
|
||||
@ApiImplicitParam(name="channelType", value = "通道类型, 子目录"),
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="channelId", value = "通道id", required = true, dataTypeClass = String.class),
|
||||
@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 = String.class),
|
||||
@ApiImplicitParam(name="channelType", value = "通道类型, 子目录", dataTypeClass = Boolean.class),
|
||||
})
|
||||
@GetMapping("/sub_channels/{deviceId}/{channelId}/channels")
|
||||
public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId,
|
||||
|
@ -239,8 +239,8 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("更新通道信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name="channel", value = "通道", required = true),
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="channel", value = "通道", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/channel/update/{deviceId}")
|
||||
public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){
|
||||
|
@ -256,7 +256,7 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("修改数据流传输模式")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" +
|
||||
"UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"),
|
||||
})
|
||||
|
@ -275,7 +275,7 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("设备状态查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/devices/{deviceId}/status")
|
||||
public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) {
|
||||
|
@ -316,13 +316,13 @@ public class DeviceQuery {
|
|||
*/
|
||||
@ApiOperation("设备报警查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "startPriority", value = "报警起始级别"),
|
||||
@ApiImplicitParam(name = "endPriority", value = "报警终止级别"),
|
||||
@ApiImplicitParam(name = "alarmMethod", value = "报警方式条件"),
|
||||
@ApiImplicitParam(name = "alarmType", value = "报警类型"),
|
||||
@ApiImplicitParam(name = "startTime", value = "报警发生起始时间"),
|
||||
@ApiImplicitParam(name = "endTime", value = "报警发生终止时间"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "startPriority", value = "报警起始级别", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "endPriority", value = "报警终止级别", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmMethod", value = "报警方式条件", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmType", value = "报警类型", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "startTime", value = "报警发生起始时间", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "endTime", value = "报警发生终止时间", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/alarm/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId,
|
|
@ -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.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.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -37,8 +37,8 @@ public class GbStreamController {
|
|||
*/
|
||||
@ApiOperation("查询国标通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true ),
|
||||
@ApiImplicitParam(name = "count", value = "每页条数", required = true ),
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true , dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页条数", required = true , dataTypeClass = Integer.class),
|
||||
})
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
|
@ -56,7 +56,8 @@ public class GbStreamController {
|
|||
*/
|
||||
@ApiOperation("移除国标关联")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ),
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ,
|
||||
dataTypeClass = GbStreamParam.class),
|
||||
})
|
||||
@DeleteMapping(value = "/del")
|
||||
@ResponseBody
|
||||
|
@ -76,7 +77,7 @@ public class GbStreamController {
|
|||
*/
|
||||
@ApiOperation("保存国标关联")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ),
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true , dataTypeClass = GbStreamParam.class),
|
||||
})
|
||||
@PostMapping(value = "/add")
|
||||
@ResponseBody
|
|
@ -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;
|
||||
|
|
@ -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.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
|
||||
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.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -46,8 +41,8 @@ public class MediaController {
|
|||
*/
|
||||
@ApiOperation("根据应用名和流id获取播放地址")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名"),
|
||||
@ApiImplicitParam(name = "stream", value = "流id"),
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping(value = "/getStreamInfoByAppAndStream")
|
||||
@ResponseBody
|
|
@ -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.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce;
|
||||
import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
|
||||
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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -21,7 +24,7 @@ import com.genersoft.iot.vmp.conf.SipConfig;
|
|||
/**
|
||||
* 级联平台管理
|
||||
*/
|
||||
@Api("级联平台管理")
|
||||
@Api(tags = "级联平台管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/platform")
|
||||
|
@ -41,6 +44,11 @@ public class PlatformController {
|
|||
@Autowired
|
||||
private SipConfig sipConfig;
|
||||
|
||||
/**
|
||||
* 获取国标服务的配置
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取国标服务的配置")
|
||||
@GetMapping("/server_config")
|
||||
public ResponseEntity<JSONObject> serverConfig() {
|
||||
JSONObject result = new JSONObject();
|
||||
|
@ -51,7 +59,18 @@ public class PlatformController {
|
|||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询级联平台
|
||||
* @param page 当前页
|
||||
* @param count 每页条数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("分页查询级联平台")
|
||||
@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){
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -60,6 +79,15 @@ public class PlatformController {
|
|||
return storager.queryParentPlatformList(page, count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存上级平台信息
|
||||
* @param parentPlatform
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("保存上级平台信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentPlatform", value = "上级平台信息", dataTypeClass = ParentPlatform.class),
|
||||
})
|
||||
@PostMapping("/save")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){
|
||||
|
@ -96,13 +124,22 @@ public class PlatformController {
|
|||
commanderForPlatform.unregister(parentPlatform, null, null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return new ResponseEntity<>("success", HttpStatus.OK);
|
||||
} else {
|
||||
return new ResponseEntity<>("fail", HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除上级平台
|
||||
* @param serverGBId 上级平台国标ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除上级平台")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class),
|
||||
})
|
||||
@DeleteMapping("/delete/{serverGBId}")
|
||||
@ResponseBody
|
||||
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
|
||||
public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){
|
||||
public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询级联平台的所有所有通道
|
||||
* @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")
|
||||
@ResponseBody
|
||||
public PageInfo<ChannelReduce> channelList(int page, int count,
|
||||
|
@ -172,7 +239,15 @@ public class PlatformController {
|
|||
return channelReduces;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向上级平台添加国标通道
|
||||
* @param param 通道关联参数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("向上级平台添加国标通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class),
|
||||
})
|
||||
@PostMapping("/update_channel_for_gb")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){
|
||||
|
@ -185,6 +260,15 @@ public class PlatformController {
|
|||
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")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){
|
|
@ -1,4 +1,4 @@
|
|||
package com.genersoft.iot.vmp.vmanager.platform.bean;
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
|
||||
|
||||
/**
|
||||
* 精简的channel信息展示,主要是选择通道的时候展示列表使用
|
|
@ -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;
|
||||
|
|
@ -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.storager.IVideoManagerStorager;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "级联平台关联视频流")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@RequestMapping("/api/platform_gb_stream")
|
||||
public class PlatformGbStreamController {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class);
|
||||
|
@ -22,6 +27,11 @@ public class PlatformGbStreamController {
|
|||
@Autowired
|
||||
private IVideoManagerStorager storager;
|
||||
|
||||
@ApiOperation("分页查询级联平台关联的视频流")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class),
|
||||
})
|
||||
@RequestMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public PageInfo<GbStream> list(@RequestParam(required = false)Integer page,
|
|
@ -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.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.media.zlm.ZLMRESTfulUtils;
|
||||
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.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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -31,6 +35,7 @@ import java.util.UUID;
|
|||
|
||||
import javax.sip.message.Response;
|
||||
|
||||
@Api(tags = "国标设备点播")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/play")
|
||||
|
@ -59,6 +64,11 @@ public class PlayController {
|
|||
@Autowired
|
||||
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}")
|
||||
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId,
|
||||
@PathVariable String channelId) {
|
||||
|
@ -79,6 +89,10 @@ public class PlayController {
|
|||
return playResult.getResult();
|
||||
}
|
||||
|
||||
@ApiOperation("停止点播")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/stop/{streamId}")
|
||||
public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) {
|
||||
|
||||
|
@ -139,6 +153,10 @@ public class PlayController {
|
|||
* @param streamId 流ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/convert/{streamId}")
|
||||
public ResponseEntity<String> playConvert(@PathVariable String streamId) {
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
|
||||
|
@ -179,6 +197,10 @@ public class PlayController {
|
|||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("结束转码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/convertStop/{key}")
|
||||
public ResponseEntity<String> playConvertStop(@PathVariable String key) {
|
||||
|
||||
|
@ -201,11 +223,10 @@ public class PlayController {
|
|||
return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音广播命令API接口
|
||||
*
|
||||
* @param deviceId
|
||||
*/
|
||||
@ApiOperation("语音广播命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/broadcast/{deviceId}")
|
||||
@PostMapping("/broadcast/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) {
|
|
@ -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 org.springframework.http.ResponseEntity;
|
|
@ -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.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.storager.IRedisCatchStorage;
|
||||
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.LoggerFactory;
|
||||
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 java.util.UUID;
|
||||
|
||||
@Api(tags = "视频回放")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/playback")
|
||||
|
@ -51,9 +56,16 @@ public class PlaybackController {
|
|||
@Autowired
|
||||
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}")
|
||||
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId, String startTime,
|
||||
String endTime) {
|
||||
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
|
||||
String startTime,String endTime) {
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId));
|
||||
|
@ -89,6 +101,10 @@ public class PlaybackController {
|
|||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("停止视频回放")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping("/stop/{ssrc}")
|
||||
public ResponseEntity<String> playStop(@PathVariable String ssrc) {
|
||||
|
|
@ -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.LoggerFactory;
|
||||
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.storager.IVideoManagerStorager;
|
||||
|
||||
@Api(tags = "云台控制")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@RequestMapping("/api/ptz")
|
||||
public class PtzController {
|
||||
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PtzController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private SIPCommander cmder;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IVideoManagerStorager storager;
|
||||
|
||||
@Autowired
|
||||
private DeferredResultHolder resultHolder;
|
||||
|
||||
|
||||
/***
|
||||
* 云台控制
|
||||
* @param deviceId 设备id
|
||||
|
@ -43,49 +48,54 @@ public class PtzController {
|
|||
* @param zoomSpeed 缩放速度
|
||||
* @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){
|
||||
|
||||
|
||||
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));
|
||||
}
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
|
||||
|
||||
cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed);
|
||||
return new ResponseEntity<String>("success",HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用前端控制命令API接口
|
||||
*
|
||||
* @param deviceId
|
||||
* @param channelId
|
||||
* @param cmdCode
|
||||
* @param parameter1
|
||||
* @param parameter2
|
||||
* @param combindCode2
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/frontEndCommand/{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 = "parameter1", value = "数据一", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "parameter2", value = "数据二", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "combindCode2", value = "组合码二", dataTypeClass = Integer.class),
|
||||
})
|
||||
@PostMapping("/front_end_command/{deviceId}/{channelId}")
|
||||
public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){
|
||||
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
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);
|
||||
|
||||
|
||||
cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2);
|
||||
return new ResponseEntity<String>("success",HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预置位查询命令API接口
|
||||
*
|
||||
* @param deviceId
|
||||
* @param channelId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/presetQuery/{deviceId}/{channelId}")
|
||||
@ApiOperation("预置位查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/preset/query/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("设备预置位查询API调用");
|
|
@ -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 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.LoggerFactory;
|
||||
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.storager.IVideoManagerStorager;
|
||||
|
||||
@Api(tags = "国标录像")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@RequestMapping("/api/gb_record")
|
||||
public class RecordController {
|
||||
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(RecordController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private SIPCommander cmder;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IVideoManagerStorager storager;
|
||||
|
||||
|
||||
@Autowired
|
||||
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){
|
||||
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime));
|
||||
}
|
||||
|
||||
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
cmder.recordInfoQuery(device, channelId, startTime, endTime);
|
||||
// 指定超时时间 1分钟30秒
|
|
@ -2,8 +2,9 @@ package com.genersoft.iot.vmp.vmanager.server;
|
|||
|
||||
import com.genersoft.iot.vmp.VManageBootstrap;
|
||||
import com.genersoft.iot.vmp.utils.SpringBeanFactory;
|
||||
import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam;
|
||||
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.context.ConfigurableApplicationContext;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -13,6 +14,7 @@ import javax.sip.ObjectInUseException;
|
|||
import javax.sip.SipProvider;
|
||||
import java.util.Iterator;
|
||||
|
||||
@Api(tags = "服务控制")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/server")
|
||||
|
@ -22,6 +24,7 @@ public class ServerController {
|
|||
private ConfigurableApplicationContext context;
|
||||
|
||||
|
||||
@ApiOperation("重启服务")
|
||||
@RequestMapping(value = "/restart")
|
||||
@ResponseBody
|
||||
public Object restart(){
|
||||
|
|
|
@ -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.service.IStreamProxyService;
|
||||
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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -14,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
/**
|
||||
* 拉流代理接口
|
||||
*/
|
||||
@Api(tags = "拉流代理")
|
||||
@Controller
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = "/api/proxy")
|
||||
|
@ -28,16 +34,27 @@ public class StreamProxyController {
|
|||
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")
|
||||
@ResponseBody
|
||||
public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String q,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean online ){
|
||||
|
||||
return streamProxyService.getAll(page, count);
|
||||
}
|
||||
|
||||
@ApiOperation("保存代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class),
|
||||
})
|
||||
@RequestMapping(value = "/save")
|
||||
@ResponseBody
|
||||
public Object save(@RequestBody StreamProxyItem param){
|
||||
|
@ -46,6 +63,11 @@ public class StreamProxyController {
|
|||
return "success";
|
||||
}
|
||||
|
||||
@ApiOperation("移除代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping(value = "/del")
|
||||
@ResponseBody
|
||||
public Object del(String app, String stream){
|
||||
|
@ -54,6 +76,11 @@ public class StreamProxyController {
|
|||
return "success";
|
||||
}
|
||||
|
||||
@ApiOperation("启用代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping(value = "/start")
|
||||
@ResponseBody
|
||||
public Object start(String app, String stream){
|
||||
|
@ -62,6 +89,11 @@ public class StreamProxyController {
|
|||
return "success";
|
||||
}
|
||||
|
||||
@ApiOperation("停用代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping(value = "/stop")
|
||||
@ResponseBody
|
||||
public Object stop(String app, String stream){
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
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.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
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 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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "推流信息管理")
|
||||
@Controller
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = "/api/push")
|
||||
|
@ -24,18 +25,29 @@ public class StreamPushController {
|
|||
@Autowired
|
||||
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")
|
||||
@ResponseBody
|
||||
public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String q,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean online ){
|
||||
|
||||
PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count);
|
||||
return pushList;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/saveToGB")
|
||||
@ApiOperation("将推流添加到国标")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class),
|
||||
})
|
||||
@RequestMapping(value = "/save_to_gb")
|
||||
@ResponseBody
|
||||
public Object saveToGB(@RequestBody GbStream 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
|
||||
public Object removeFormGB(@RequestBody GbStream stream){
|
||||
if (streamPushService.removeFromGB(stream)){
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
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.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "用户管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@RequestMapping("/api/user")
|
||||
public class UserController {
|
||||
|
||||
@Value("${auth.username}")
|
||||
|
@ -17,7 +23,12 @@ public class UserController {
|
|||
@Value("${auth.password}")
|
||||
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){
|
||||
if (!StringUtils.isEmpty(username) && username.equals(usernameConfig)
|
||||
&& !StringUtils.isEmpty(password) && password.equals(passwordConfig)) {
|
||||
|
|
|
@ -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.storager.IRedisCatchStorage;
|
||||
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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<title>国标28181</title>
|
||||
</head>
|
||||
<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="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script>
|
||||
<div id="app"></div>
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
},
|
||||
removeFromGB: function(row){
|
||||
var that = this;
|
||||
that.$axios.post(`/api/push/removeFormGB`, row)
|
||||
that.$axios.post(`/api/push/remove_form_gb`, row)
|
||||
.then(function (res) {
|
||||
console.log(res);
|
||||
console.log(res.data == "success");
|
||||
|
|
|
@ -90,7 +90,7 @@ export default {
|
|||
console.log("onSubmit");
|
||||
var that = this;
|
||||
that.$axios
|
||||
.post(`/api/push/saveToGB`, that.proxyParam)
|
||||
.post(`/api/push/save_to_gb`, that.proxyParam)
|
||||
.then(function (res) {
|
||||
console.log(res);
|
||||
console.log(res.data == "success");
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
</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/"}}-->
|
||||
<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-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading">
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<el-slider v-model="controSpeed" :max="255"></el-slider>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-panel">
|
||||
<el-button-group>
|
||||
<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>
|
||||
|
||||
<script>
|
||||
import player from '../dialog/rtcPlayer.vue'
|
||||
// import player from '../dialog/rtcPlayer.vue'
|
||||
import player from '../dialog/easyPlayer.vue'
|
||||
export default {
|
||||
name: 'devicePlayer',
|
||||
props: {},
|
||||
|
@ -250,7 +251,8 @@ export default {
|
|||
|
||||
this.hasaudio = hasAudio;
|
||||
this.isLoging = false;
|
||||
this.videoUrl = streamInfo.rtc;
|
||||
// this.videoUrl = streamInfo.rtc;
|
||||
this.videoUrl = streamInfo.ws_flv;
|
||||
this.streamId = streamInfo.streamId;
|
||||
this.app = streamInfo.app;
|
||||
this.playFromStreamInfo(false, streamInfo)
|
||||
|
@ -369,7 +371,7 @@ export default {
|
|||
var endTime = this.videoHistory.date + " 23:59:59";
|
||||
this.$axios({
|
||||
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) {
|
||||
// 处理时间信息
|
||||
that.videoHistory.searchHistoryResult = res.data.recordList;
|
||||
|
@ -420,7 +422,7 @@ export default {
|
|||
method: 'post',
|
||||
// url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown +
|
||||
// '&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) {});
|
||||
},
|
||||
//////////////////////播放器事件处理//////////////////////////
|
||||
|
@ -432,7 +434,7 @@ export default {
|
|||
let that = this;
|
||||
this.$axios({
|
||||
method: 'post',
|
||||
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0'
|
||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0'
|
||||
}).then(function (res) {});
|
||||
},
|
||||
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));
|
||||
this.$axios({
|
||||
method: 'post',
|
||||
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2
|
||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2
|
||||
}).then(function (res) {});
|
||||
},
|
||||
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');
|
||||
this.$axios({
|
||||
method: 'post',
|
||||
url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0'
|
||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0'
|
||||
}).then(function (res) {});
|
||||
},
|
||||
formatTooltip: function (val) {
|
||||
|
|
|
@ -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…
Reference in New Issue