diff --git a/src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java b/src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java index 70be1882..84aa3d9d 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java @@ -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() diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java index 9db7a299..4b752a0e 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java +++ b/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.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; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java index 52774259..a73bc511 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java +++ b/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.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; diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index ade4f46a..49d06adc 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -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); diff --git a/src/main/java/com/genersoft/iot/vmp/service/IPlayService.java b/src/main/java/com/genersoft/iot/vmp/service/IPlayService.java index 7f4d9c7c..a6492677 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/IPlayService.java +++ b/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.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; /** * 点播处理 diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index e7298d20..abe22780 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/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.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; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java index 846e8c77..632d2437 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java +++ b/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.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; /** diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index e35f3cdd..b98b66f3 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -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; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java index a88f2664..db2bb777 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java +++ b/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.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; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 63fbbd11..6d35eb2a 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/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.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; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java similarity index 93% rename from src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java index c284fe9a..6dd31eef 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java +++ b/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; @@ -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> 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 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> 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 positionSubscribe(@PathVariable String deviceId, diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java similarity index 68% rename from src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java index 1e55c326..145855dd 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java +++ b/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 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); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java similarity index 90% rename from src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java index a9885504..5aa626e2 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java @@ -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> 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> configDownloadApi(@PathVariable String deviceId, diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceControl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java similarity index 92% rename from src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceControl.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java index ae517aff..220d3219 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceControl.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java @@ -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 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> 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> 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> 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 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> homePositionApi(@PathVariable String deviceId, diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java similarity index 88% rename from src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index bded1b97..e243d23e 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java +++ b/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.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 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 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 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> 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 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 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 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> 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> alarmApi(@PathVariable String deviceId, diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java similarity index 86% rename from src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java index 64e45674..36535a36 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java +++ b/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.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 diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/bean/GbStreamParam.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/bean/GbStreamParam.java similarity index 89% rename from src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/bean/GbStreamParam.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/bean/GbStreamParam.java index 2181cc8b..40456a85 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/bean/GbStreamParam.java +++ b/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; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java similarity index 77% rename from src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java index a195cc9f..7598178c 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java +++ b/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.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 diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java similarity index 68% rename from src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java index 834c00b6..ce476f7b 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java +++ b/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.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 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 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 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 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 exitPlatform(@PathVariable String deviceGbId){ + public ResponseEntity 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 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 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 delChannelForGB(@RequestBody UpdateChannelParam param){ diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/ChannelReduce.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/ChannelReduce.java similarity index 96% rename from src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/ChannelReduce.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/ChannelReduce.java index cf626506..d4ef0bcb 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/ChannelReduce.java +++ b/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信息展示,主要是选择通道的时候展示列表使用 diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/UpdateChannelParam.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/UpdateChannelParam.java similarity index 89% rename from src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/UpdateChannelParam.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/UpdateChannelParam.java index 34192cad..445b08b7 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/UpdateChannelParam.java +++ b/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; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platformGbStream/PlatformGbStreamController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java similarity index 60% rename from src/main/java/com/genersoft/iot/vmp/vmanager/platformGbStream/PlatformGbStreamController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java index f040d1a1..58591023 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/platformGbStream/PlatformGbStreamController.java +++ b/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.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 list(@RequestParam(required = false)Integer page, diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java similarity index 87% rename from src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index df16dd85..1af7e6e0 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java +++ b/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.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> 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> 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 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 playConvertStop(@PathVariable String key) { @@ -201,11 +223,10 @@ public class PlayController { return new ResponseEntity( 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> broadcastApi(@PathVariable String deviceId) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/play/bean/PlayResult.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java similarity index 93% rename from src/main/java/com/genersoft/iot/vmp/vmanager/play/bean/PlayResult.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java index 3d21349e..42a6e8b3 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/play/bean/PlayResult.java +++ b/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 org.springframework.http.ResponseEntity; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java similarity index 80% rename from src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java index e816562d..f55083e9 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java +++ b/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.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> play(@PathVariable String deviceId, @PathVariable String channelId, String startTime, - String endTime) { + public DeferredResult> 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 playStop(@PathVariable String ssrc) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java similarity index 66% rename from src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java index 1efdd3d1..7e57e0dd 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java +++ b/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.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 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("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 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("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> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { if (logger.isDebugEnabled()) { logger.debug("设备预置位查询API调用"); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/RecordController.java similarity index 74% rename from src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java rename to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/RecordController.java index 519d299e..18c687f7 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java +++ b/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 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> 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秒 diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index 675fc01f..84d246fe 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/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.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(){ diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java index 6fc3beec..d7e62015 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/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.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 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){ diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 1dd9036e..6396b10f 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -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 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 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)){ diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java index 5ebfd2d3..c3f8b3f2 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java @@ -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)) { diff --git a/src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java index 5a56bef7..9627cdd9 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java +++ b/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.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; diff --git a/web_src/index.html b/web_src/index.html index 9cdf57e9..8b59cb9c 100644 --- a/web_src/index.html +++ b/web_src/index.html @@ -6,7 +6,7 @@ 国标28181 - +
diff --git a/web_src/src/components/PushVideoList.vue b/web_src/src/components/PushVideoList.vue index 1199a391..3e155c2a 100644 --- a/web_src/src/components/PushVideoList.vue +++ b/web_src/src/components/PushVideoList.vue @@ -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"); diff --git a/web_src/src/components/dialog/addStreamTOGB.vue b/web_src/src/components/dialog/addStreamTOGB.vue index d5373fb8..7dc8a87b 100644 --- a/web_src/src/components/dialog/addStreamTOGB.vue +++ b/web_src/src/components/dialog/addStreamTOGB.vue @@ -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"); diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index 30de142f..82bce090 100644 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -26,7 +26,7 @@ - + @@ -70,7 +70,7 @@ - +
预置位编号 @@ -136,7 +136,8 @@ - - \ No newline at end of file