依赖包版本升级
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
package com.genersoft.iot.vmp.vmanager.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Schema(description = "多个推流信息")
|
||||
public class BatchGBStreamParam {
|
||||
@Schema(description = "推流信息列表")
|
||||
private List<GbStream> gbStreams;
|
||||
|
||||
public List<GbStream> getGbStreams() {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.genersoft.iot.vmp.vmanager.bean;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "统一返回结果")
|
||||
public class WVPResult<T> {
|
||||
|
||||
public WVPResult() {
|
||||
@@ -13,8 +16,11 @@ public class WVPResult<T> {
|
||||
}
|
||||
|
||||
|
||||
@Schema(description = "错误码,0为成功")
|
||||
private int code;
|
||||
@Schema(description = "描述,错误时描述错误原因")
|
||||
private String msg;
|
||||
@Schema(description = "数据")
|
||||
private T data;
|
||||
|
||||
private static final Integer SUCCESS = 200;
|
||||
|
||||
@@ -13,10 +13,9 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -33,7 +32,7 @@ import org.springframework.web.context.request.async.DeferredResult;
|
||||
/**
|
||||
* 位置信息管理
|
||||
*/
|
||||
@Api(tags = "位置信息管理")
|
||||
@Tag(name = "位置信息管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/position")
|
||||
@@ -54,27 +53,22 @@ public class MobilePositionController {
|
||||
private IDeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 查询历史轨迹
|
||||
* 查询历史轨迹
|
||||
* @param deviceId 设备ID
|
||||
* @param start 开始时间
|
||||
* @param end 结束时间
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询历史轨迹")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", required = false, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间", required = false, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间", required = false, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "查询历史轨迹")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号")
|
||||
@Parameter(name = "start", description = "开始时间")
|
||||
@Parameter(name = "end", description = "结束时间")
|
||||
@GetMapping("/history/{deviceId}")
|
||||
public ResponseEntity<WVPResult<List<MobilePosition>>> positions(@PathVariable String deviceId,
|
||||
@RequestParam(required = false) String channelId,
|
||||
@RequestParam(required = false) String start,
|
||||
@RequestParam(required = false) String end) {
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询设备" + deviceId + "的历史轨迹");
|
||||
// }
|
||||
|
||||
if (StringUtil.isEmpty(start)) {
|
||||
start = null;
|
||||
@@ -94,15 +88,10 @@ public class MobilePositionController {
|
||||
* @param deviceId 设备ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询设备最新位置")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "查询设备最新位置")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/latest/{deviceId}")
|
||||
public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) {
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询设备" + deviceId + "的最新位置");
|
||||
// }
|
||||
MobilePosition result = storager.queryLatestPosition(deviceId);
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
@@ -112,10 +101,8 @@ public class MobilePositionController {
|
||||
* @param deviceId 设备ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取移动位置信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "获取移动位置信息")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/realtime/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) {
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
@@ -149,12 +136,10 @@ public class MobilePositionController {
|
||||
* @param interval 上报时间间隔
|
||||
* @return true = 命令发送成功
|
||||
*/
|
||||
@ApiOperation("订阅位置信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "expires", value = "订阅超时时间", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "interval", value = "上报时间间隔", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "订阅位置信息")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "expires", description = "订阅超时时间", required = true)
|
||||
@Parameter(name = "interval", description = "上报时间间隔", required = true)
|
||||
@GetMapping("/subscribe/{deviceId}")
|
||||
public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId,
|
||||
@RequestParam String expires,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
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 io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
@@ -18,7 +16,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
* @author: lawrencehj
|
||||
* @data: 2021-01-20
|
||||
*/
|
||||
@Api(tags = "SSE推送")
|
||||
@Tag(name = "SSE推送")
|
||||
@CrossOrigin
|
||||
@Controller
|
||||
@RequestMapping("/api")
|
||||
@@ -26,10 +24,6 @@ public class SseController {
|
||||
@Autowired
|
||||
AlarmEventListener alarmEventListener;
|
||||
|
||||
@ApiOperation("浏览器推送")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/emit")
|
||||
public SseEmitter emit(@RequestParam String browserId) {
|
||||
final SseEmitter sseEmitter = new SseEmitter(0L);
|
||||
|
||||
@@ -3,32 +3,27 @@ package com.genersoft.iot.vmp.vmanager.gb28181.alarm;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.service.IDeviceAlarmService;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "报警信息管理")
|
||||
@Tag(name = "报警信息管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/alarm")
|
||||
@@ -46,68 +41,6 @@ public class AlarmController {
|
||||
@Autowired
|
||||
private IVideoManagerStorage storage;
|
||||
|
||||
/**
|
||||
* 分页查询报警
|
||||
*
|
||||
* @param deviceId 设备id
|
||||
* @param page 当前页
|
||||
* @param count 每页查询数量
|
||||
* @param alarmPriority 报警级别
|
||||
* @param alarmMethod 报警方式
|
||||
* @param alarmType 报警类型
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("分页查询报警")
|
||||
@GetMapping("/all")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true ,dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="count", value = "每页查询数量", required = true ,dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="alarmPriority", value = "查询内容" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="alarmMethod", 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),
|
||||
})
|
||||
public ResponseEntity<PageInfo<DeviceAlarm>> getAll(
|
||||
@RequestParam int page,
|
||||
@RequestParam int count,
|
||||
@RequestParam(required = false) String deviceId,
|
||||
@RequestParam(required = false) String alarmPriority,
|
||||
@RequestParam(required = false) String alarmMethod,
|
||||
@RequestParam(required = false) String alarmType,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime
|
||||
) {
|
||||
if (StringUtils.isEmpty(alarmPriority)) {
|
||||
alarmPriority = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(alarmMethod)) {
|
||||
alarmMethod = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(alarmType)) {
|
||||
alarmType = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
startTime = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(endTime)) {
|
||||
endTime = null;
|
||||
}
|
||||
|
||||
|
||||
if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
PageInfo<DeviceAlarm> allAlarm = deviceAlarmService.getAllAlarm(page, count, deviceId, alarmPriority, alarmMethod,
|
||||
alarmType, startTime, endTime);
|
||||
return new ResponseEntity<>(allAlarm, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除报警
|
||||
@@ -117,17 +50,15 @@ public class AlarmController {
|
||||
* @param time 结束时间(这个时间之前的报警会被删除)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除报警")
|
||||
@DeleteMapping("/delete")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="id", value = "ID", required = false ,dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="deviceIds", value = "多个设备id,逗号分隔", required = false ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="time", value = "结束时间", required = false ,dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "删除报警")
|
||||
@Parameter(name = "id", description = "ID")
|
||||
@Parameter(name = "deviceIds", description = "多个设备id,逗号分隔")
|
||||
@Parameter(name = "time", description = "结束时间")
|
||||
public ResponseEntity<WVPResult<String>> delete(
|
||||
@RequestParam(required = false) Integer id,
|
||||
@RequestParam(required = false) String deviceIds,
|
||||
@RequestParam(required = false) String time
|
||||
@RequestParam(required = false) Integer id,
|
||||
@RequestParam(required = false) String deviceIds,
|
||||
@RequestParam(required = false) String time
|
||||
) {
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
id = null;
|
||||
@@ -161,11 +92,9 @@ public class AlarmController {
|
||||
* @param deviceId 报警id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("测试向上级/设备发送模拟报警通知")
|
||||
@GetMapping("/test/notify/alarm")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "deviceId", required = true ,dataTypeClass = Integer.class)
|
||||
})
|
||||
@Operation(summary = "测试向上级/设备发送模拟报警通知")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号")
|
||||
public ResponseEntity<WVPResult<String>> delete(
|
||||
@RequestParam(required = false) String deviceId
|
||||
) {
|
||||
@@ -201,5 +130,64 @@ public class AlarmController {
|
||||
return new ResponseEntity<WVPResult<String>>(wvpResult, HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询报警
|
||||
*
|
||||
* @param deviceId 设备id
|
||||
* @param page 当前页
|
||||
* @param count 每页查询数量
|
||||
* @param alarmPriority 报警级别
|
||||
* @param alarmMethod 报警方式
|
||||
* @param alarmType 报警类型
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询报警")
|
||||
@Parameter(name = "page",description = "当前页",required = true)
|
||||
@Parameter(name = "count",description = "每页查询数量",required = true)
|
||||
@Parameter(name = "deviceId",description = "设备id")
|
||||
@Parameter(name = "alarmPriority",description = "查询内容")
|
||||
@Parameter(name = "alarmMethod",description = "查询内容")
|
||||
@Parameter(name = "alarmType",description = "每页查询数量")
|
||||
@Parameter(name = "startTime",description = "开始时间")
|
||||
@Parameter(name = "endTime",description = "结束时间")
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<PageInfo<DeviceAlarm>> getAll(
|
||||
@RequestParam int page,
|
||||
@RequestParam int count,
|
||||
@RequestParam(required = false) String deviceId,
|
||||
@RequestParam(required = false) String alarmPriority,
|
||||
@RequestParam(required = false) String alarmMethod,
|
||||
@RequestParam(required = false) String alarmType,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime
|
||||
) {
|
||||
if (StringUtils.isEmpty(alarmPriority)) {
|
||||
alarmPriority = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(alarmMethod)) {
|
||||
alarmMethod = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(alarmType)) {
|
||||
alarmType = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
startTime = null;
|
||||
}
|
||||
if (StringUtils.isEmpty(endTime)) {
|
||||
endTime = null;
|
||||
}
|
||||
|
||||
|
||||
if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){
|
||||
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
PageInfo<DeviceAlarm> allAlarm = deviceAlarmService.getAllAlarm(page, count, deviceId, alarmPriority, alarmMethod,
|
||||
alarmType, startTime, endTime);
|
||||
return new ResponseEntity<>(allAlarm, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,10 +14,9 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,7 +27,7 @@ import org.springframework.web.context.request.async.DeferredResult;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "国标设备配置")
|
||||
@Tag(name = "国标设备配置")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/device/config")
|
||||
@@ -55,16 +54,14 @@ public class DeviceConfig {
|
||||
* @param heartBeatCount 心跳计数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("基本配置设置命令")
|
||||
@GetMapping("/basicParam/{deviceId}")
|
||||
@ApiImplicitParams({
|
||||
@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),
|
||||
})
|
||||
@Operation(summary = "基本配置设置命令")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "name", description = "名称")
|
||||
@Parameter(name = "expiration", description = "到期时间")
|
||||
@Parameter(name = "heartBeatInterval", description = "心跳间隔")
|
||||
@Parameter(name = "heartBeatCount", description = "心跳计数")
|
||||
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,
|
||||
String channelId,
|
||||
@RequestParam(required = false) String name,
|
||||
@@ -109,12 +106,10 @@ public class DeviceConfig {
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("设备配置查询请求")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "configType", value ="配置类型" ,dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "设备配置查询请求")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "configType", description = "配置类型")
|
||||
@GetMapping("/query/{deviceId}/{configType}")
|
||||
public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId,
|
||||
@PathVariable String configType,
|
||||
|
||||
@@ -14,10 +14,9 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -29,7 +28,7 @@ import org.springframework.web.context.request.async.DeferredResult;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "国标设备控制")
|
||||
@Tag(name = "国标设备控制")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/device/control")
|
||||
@@ -51,10 +50,12 @@ public class DeviceControl {
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
*/
|
||||
@ApiOperation("远程启动控制命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
// //@ApiOperation("远程启动控制命令")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class),
|
||||
// })
|
||||
@Operation(summary = "远程启动控制命令")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/teleboot/{deviceId}")
|
||||
public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -80,13 +81,10 @@ public class DeviceControl {
|
||||
* @param recordCmdStr Record:手动录像,StopRecord:停止手动录像
|
||||
* @param channelId 通道编码(可选)
|
||||
*/
|
||||
@ApiOperation("录像控制命令")
|
||||
@ApiImplicitParams({
|
||||
@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 ,dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "录像控制")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "recordCmdStr", description = "命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", required = true)
|
||||
@GetMapping("/record/{deviceId}/{recordCmdStr}")
|
||||
public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId,
|
||||
@PathVariable String recordCmdStr, String channelId) {
|
||||
@@ -127,13 +125,10 @@ public class DeviceControl {
|
||||
* @param deviceId 设备ID
|
||||
* @param guardCmdStr SetGuard:布防,ResetGuard:撤防
|
||||
*/
|
||||
@ApiOperation("布防/撤防命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道编码" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true,
|
||||
dataTypeClass = String.class)
|
||||
})
|
||||
@Operation(summary = "布防/撤防命令")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "guardCmdStr", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true)
|
||||
@GetMapping("/guard/{deviceId}/{guardCmdStr}")
|
||||
public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, String channelId, @PathVariable String guardCmdStr) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -171,13 +166,11 @@ public class DeviceControl {
|
||||
* @param alarmMethod 报警方式(可选)
|
||||
* @param alarmType 报警类型(可选)
|
||||
*/
|
||||
@ApiOperation("报警复位")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道编码" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmMethod", value ="报警方式", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "alarmType", value ="报警类型", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "报警复位")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "alarmMethod", description = "报警方式")
|
||||
@Parameter(name = "alarmType", description = "报警类型")
|
||||
@GetMapping("/reset_alarm/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId, String channelId,
|
||||
@RequestParam(required = false) String alarmMethod,
|
||||
@@ -215,11 +208,9 @@ public class DeviceControl {
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
*/
|
||||
@ApiOperation("强制关键帧")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "强制关键帧")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号")
|
||||
@GetMapping("/i_frame/{deviceId}")
|
||||
public ResponseEntity<String> iFrame(@PathVariable String deviceId,
|
||||
@RequestParam(required = false) String channelId) {
|
||||
@@ -249,15 +240,12 @@ public class DeviceControl {
|
||||
* @param presetIndex 调用预置位编号(可选)
|
||||
* @param channelId 通道编码(可选)
|
||||
*/
|
||||
@ApiOperation("看守位控制")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value ="通道编码" ,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),
|
||||
})
|
||||
@Operation(summary = "看守位控制")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "enabled", description = "是否开启看守位 1:开启,0:关闭", required = true)
|
||||
@Parameter(name = "presetIndex", description = "调用预置位编号")
|
||||
@Parameter(name = "resetTime", description = "自动归位时间间隔")
|
||||
@GetMapping("/home_position/{deviceId}/{enabled}")
|
||||
public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId,
|
||||
@PathVariable String enabled,
|
||||
@@ -307,17 +295,14 @@ public class DeviceControl {
|
||||
* @param lengthy 拉框宽度像素值
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("拉框放大")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "拉框放大")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "length", description = "播放窗口长度像素值", required = true)
|
||||
@Parameter(name = "midpointx", description = "拉框中心的横轴坐标像素值", required = true)
|
||||
@Parameter(name = "midpointy", description = "拉框中心的纵轴坐标像素值", required = true)
|
||||
@Parameter(name = "lengthx", description = "拉框长度像素值", required = true)
|
||||
@Parameter(name = "lengthy", description = "lengthy", required = true)
|
||||
@GetMapping("drag_zoom/zoom_in")
|
||||
public ResponseEntity<String> dragZoomIn(@RequestParam String deviceId,
|
||||
@RequestParam(required = false) String channelId,
|
||||
@@ -356,17 +341,15 @@ public class DeviceControl {
|
||||
* @param lengthy 拉框宽度像素值
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("拉框缩小")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "拉框放大")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号")
|
||||
@Parameter(name = "length", description = "播放窗口长度像素值", required = true)
|
||||
@Parameter(name = "width", description = "拉框中心的横轴坐标像素值", required = true)
|
||||
@Parameter(name = "midpointx", description = "拉框中心的横轴坐标像素值", required = true)
|
||||
@Parameter(name = "midpointy", description = "拉框中心的纵轴坐标像素值", required = true)
|
||||
@Parameter(name = "lengthx", description = "拉框长度像素值", required = true)
|
||||
@Parameter(name = "lengthy", description = "拉框宽度像素值", required = true)
|
||||
@GetMapping("/drag_zoom/zoom_out")
|
||||
public ResponseEntity<String> dragZoomOut(@RequestParam String deviceId,
|
||||
@RequestParam(required = false) String channelId,
|
||||
|
||||
@@ -19,10 +19,9 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.compress.utils.IOUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.slf4j.Logger;
|
||||
@@ -41,7 +40,7 @@ import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
|
||||
@Api(tags = "国标设备查询", value = "国标设备查询")
|
||||
@Tag(name = "国标设备查询", description = "国标设备查询")
|
||||
@SuppressWarnings("rawtypes")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@@ -79,17 +78,11 @@ public class DeviceQuery {
|
||||
* @param deviceId 国标ID
|
||||
* @return 国标设备
|
||||
*/
|
||||
@ApiOperation("使用ID查询国标设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "查询国标设备")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/devices/{deviceId}")
|
||||
public ResponseEntity<Device> devices(@PathVariable String deviceId){
|
||||
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询视频设备API调用,deviceId:" + deviceId);
|
||||
// }
|
||||
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
return new ResponseEntity<>(device,HttpStatus.OK);
|
||||
}
|
||||
@@ -100,18 +93,12 @@ public class DeviceQuery {
|
||||
* @param count 每页查询数量
|
||||
* @return 分页国标列表
|
||||
*/
|
||||
@ApiOperation("分页查询国标设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "分页查询国标设备")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
@GetMapping("/devices")
|
||||
public PageInfo<Device> devices(int page, int count){
|
||||
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询所有视频设备API调用");
|
||||
// }
|
||||
|
||||
return storager.queryVideoDeviceList(page, count);
|
||||
}
|
||||
|
||||
@@ -124,28 +111,24 @@ public class DeviceQuery {
|
||||
* @param query 查询内容
|
||||
* @param online 是否在线 在线 true / 离线 false
|
||||
* @param channelType 设备 false/子目录 true
|
||||
* @param catalogUnderDevice 是否直属与设备的目录
|
||||
* @return 通道列表
|
||||
*/
|
||||
@ApiOperation("分页查询通道")
|
||||
@GetMapping("/devices/{deviceId}/channels")
|
||||
@ApiImplicitParams({
|
||||
@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),
|
||||
@ApiImplicitParam(name="catalogUnderDevice", value = "是否直属与设备的目录" ,dataTypeClass = Boolean.class),
|
||||
})
|
||||
@Operation(summary = "分页查询通道")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@Parameter(name = "channelType", description = "设备/子目录-> false/true")
|
||||
@Parameter(name = "catalogUnderDevice", description = "是否直属与设备的目录")
|
||||
public ResponseEntity<PageInfo> channels(@PathVariable String deviceId,
|
||||
int page, int count,
|
||||
@RequestParam(required = false) String query,
|
||||
@RequestParam(required = false) Boolean online,
|
||||
@RequestParam(required = false) Boolean channelType,
|
||||
@RequestParam(required = false) Boolean catalogUnderDevice) {
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询视频设备通道API调用");
|
||||
// }
|
||||
if (StringUtils.isEmpty(query)) {
|
||||
query = null;
|
||||
}
|
||||
@@ -159,10 +142,8 @@ public class DeviceQuery {
|
||||
* @param deviceId 设备id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("同步设备通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "同步设备通道")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@PostMapping("/devices/{deviceId}/sync")
|
||||
public WVPResult<SyncStatus> devicesSync(@PathVariable String deviceId){
|
||||
|
||||
@@ -192,10 +173,8 @@ public class DeviceQuery {
|
||||
* @param deviceId 设备id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("移除设备")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "移除设备")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@DeleteMapping("/devices/{deviceId}/delete")
|
||||
public ResponseEntity<String> delete(@PathVariable String deviceId){
|
||||
|
||||
@@ -239,16 +218,14 @@ public class DeviceQuery {
|
||||
* @param channelType 通道类型
|
||||
* @return 子通道列表
|
||||
*/
|
||||
@ApiOperation("分页查询子目录通道")
|
||||
@ApiImplicitParams({
|
||||
@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 = Boolean.class),
|
||||
@ApiImplicitParam(name="channelType", value = "通道类型, 子目录", dataTypeClass = Boolean.class),
|
||||
})
|
||||
@Operation(summary = "分页查询子目录通道")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@Parameter(name = "channelType", description = "设备/子目录-> false/true")
|
||||
@GetMapping("/sub_channels/{deviceId}/{channelId}/channels")
|
||||
public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId,
|
||||
@PathVariable String channelId,
|
||||
@@ -258,9 +235,6 @@ public class DeviceQuery {
|
||||
@RequestParam(required = false) Boolean online,
|
||||
@RequestParam(required = false) Boolean channelType){
|
||||
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询所有视频通道API调用");
|
||||
// }
|
||||
DeviceChannel deviceChannel = storager.queryChannel(deviceId,channelId);
|
||||
if (deviceChannel == null) {
|
||||
PageInfo<DeviceChannel> deviceChannelPageResult = new PageInfo<>();
|
||||
@@ -277,13 +251,11 @@ public class DeviceQuery {
|
||||
* @param channel 通道
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("更新通道信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="channel", value = "通道", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "更新通道信息")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channel", description = "通道信息", required = true)
|
||||
@PostMapping("/channel/update/{deviceId}")
|
||||
public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){
|
||||
public ResponseEntity updateChannel(@PathVariable String deviceId,DeviceChannel channel){
|
||||
deviceChannelService.updateChannel(deviceId, channel);
|
||||
return new ResponseEntity<>(null,HttpStatus.OK);
|
||||
}
|
||||
@@ -294,17 +266,14 @@ public class DeviceQuery {
|
||||
* @param streamMode 数据流传输模式
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("修改数据流传输模式")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" +
|
||||
"UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "修改数据流传输模式")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "streamMode", description = "数据流传输模式, 取值:" +
|
||||
"UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", required = true)
|
||||
@PostMapping("/transport/{deviceId}/{streamMode}")
|
||||
public ResponseEntity<PageInfo> updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){
|
||||
public ResponseEntity updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
device.setStreamMode(streamMode);
|
||||
// storager.updateDevice(device);
|
||||
deviceService.updateDevice(device);
|
||||
return new ResponseEntity<>(null,HttpStatus.OK);
|
||||
}
|
||||
@@ -314,10 +283,8 @@ public class DeviceQuery {
|
||||
* @param device 设备信息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("更新设备信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "device", value = "设备信息", required = true, dataTypeClass = Device.class)
|
||||
})
|
||||
@Operation(summary = "更新设备信息")
|
||||
@Parameter(name = "device", description = "设备", required = true)
|
||||
@PostMapping("/device/update/")
|
||||
public ResponseEntity<WVPResult<String>> updateDevice(Device device){
|
||||
|
||||
@@ -335,10 +302,8 @@ public class DeviceQuery {
|
||||
*
|
||||
* @param deviceId 设备id
|
||||
*/
|
||||
@ApiOperation("设备状态查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "设备状态查询")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/devices/{deviceId}/status")
|
||||
public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -383,16 +348,14 @@ public class DeviceQuery {
|
||||
* @param endTime 报警发生终止时间(可选)
|
||||
* @return true = 命令发送成功
|
||||
*/
|
||||
@ApiOperation("设备报警查询")
|
||||
@ApiImplicitParams({
|
||||
@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),
|
||||
})
|
||||
@Operation(summary = "设备状态查询")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "startPriority", description = "报警起始级别")
|
||||
@Parameter(name = "endPriority", description = "报警终止级别")
|
||||
@Parameter(name = "alarmMethod", description = "报警方式条件")
|
||||
@Parameter(name = "alarmType", description = "报警类型")
|
||||
@Parameter(name = "startTime", description = "报警发生起始时间")
|
||||
@Parameter(name = "endTime", description = "报警发生终止时间")
|
||||
@GetMapping("/alarm/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId,
|
||||
@RequestParam(required = false) String startPriority,
|
||||
@@ -430,7 +393,8 @@ public class DeviceQuery {
|
||||
|
||||
|
||||
@GetMapping("/{deviceId}/sync_status")
|
||||
@ApiOperation(value = "获取通道同步进度", notes = "获取通道同步进度")
|
||||
@Operation(summary = "获取通道同步进度")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
public WVPResult<SyncStatus> getSyncStatus(@PathVariable String deviceId) {
|
||||
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
||||
WVPResult<SyncStatus> wvpResult = new WVPResult<>();
|
||||
@@ -448,7 +412,8 @@ public class DeviceQuery {
|
||||
}
|
||||
|
||||
@GetMapping("/{deviceId}/subscribe_info")
|
||||
@ApiOperation(value = "获取设备的订阅状态", notes = "获取设备的订阅状态")
|
||||
@Operation(summary = "获取设备的订阅状态")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
public WVPResult<Map<String, String>> getSubscribeInfo(@PathVariable String deviceId) {
|
||||
Set<String> allKeys = dynamicTask.getAllKeys();
|
||||
Map<String, String> dialogStateMap = new HashMap<>();
|
||||
@@ -473,7 +438,9 @@ public class DeviceQuery {
|
||||
}
|
||||
|
||||
@GetMapping("/snap/{deviceId}/{channelId}")
|
||||
@ApiOperation(value = "请求截图", notes = "请求截图")
|
||||
@Operation(summary = "请求截图")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
public void getSnap(HttpServletResponse resp, @PathVariable String deviceId, @PathVariable String channelId) {
|
||||
|
||||
try {
|
||||
@@ -493,16 +460,17 @@ public class DeviceQuery {
|
||||
* @param count 每页条数
|
||||
* @return 国标设备
|
||||
*/
|
||||
@ApiOperation("查询国标树")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "parentId", value = "父ID", required = false, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "onlyCatalog", value = "只获取目录", required = false, dataTypeClass = Boolean.class),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="count", value = "每页条数", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "查询国标树")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "parentId", description = "父级国标编号")
|
||||
@Parameter(name = "onlyCatalog", description = "只获取目录")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页条数", required = true)
|
||||
@GetMapping("/tree/{deviceId}")
|
||||
public ResponseEntity<PageInfo> getTree(@PathVariable String deviceId, @RequestParam(required = false) String parentId, @RequestParam(required = false) Boolean onlyCatalog, int page, int count){
|
||||
public ResponseEntity<PageInfo> getTree(@PathVariable String deviceId,
|
||||
@RequestParam(required = false) String parentId,
|
||||
@RequestParam(required = false) Boolean onlyCatalog,
|
||||
int page, int count){
|
||||
|
||||
|
||||
if (page <= 0) {
|
||||
@@ -543,13 +511,11 @@ public class DeviceQuery {
|
||||
* @param count 每页条数
|
||||
* @return 国标设备
|
||||
*/
|
||||
@ApiOperation("查询国标树下的通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "parentId", value = "父ID", required = false, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="count", value = "每页条数", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "查询国标树下的通道")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "parentId", description = "父级国标编号")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页条数", required = true)
|
||||
@GetMapping("/tree/channel/{deviceId}")
|
||||
public ResponseEntity<PageInfo> getChannelInTreeNode(@PathVariable String deviceId, @RequestParam(required = false) String parentId, int page, int count){
|
||||
|
||||
|
||||
@@ -5,17 +5,16 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
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;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "视频流关联到级联平台")
|
||||
@Tag(name = "视频流关联到级联平台")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/gbStream")
|
||||
@@ -37,16 +36,13 @@ public class GbStreamController {
|
||||
* @param platformId 平台ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询国标通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true , dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页条数", required = true , dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "platformId", value = "平台ID", required = true , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "catalogId", value = "目录ID", required = false , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="query", value = "查询内容", required = false , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="mediaServerId", value = "流媒体ID", required = false , dataTypeClass = String.class),
|
||||
|
||||
})
|
||||
@Operation(summary = "查询国标通道")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页条数", required = true)
|
||||
@Parameter(name = "platformId", description = "平台ID", required = true)
|
||||
@Parameter(name = "catalogId", description = "目录ID")
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID")
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public PageInfo<GbStream> list(@RequestParam(required = true)Integer page,
|
||||
@@ -76,11 +72,7 @@ public class GbStreamController {
|
||||
* @param gbStreamParam
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("移除国标关联")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true,
|
||||
dataTypeClass = GbStreamParam.class),
|
||||
})
|
||||
@Operation(summary = "移除国标关联")
|
||||
@DeleteMapping(value = "/del")
|
||||
@ResponseBody
|
||||
public Object del(@RequestBody GbStreamParam gbStreamParam){
|
||||
@@ -97,10 +89,7 @@ public class GbStreamController {
|
||||
* @param gbStreamParam
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("保存国标关联")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true, dataTypeClass = GbStreamParam.class),
|
||||
})
|
||||
@Operation(summary = "保存国标关联")
|
||||
@PostMapping(value = "/add")
|
||||
@ResponseBody
|
||||
public Object add(@RequestBody GbStreamParam gbStreamParam){
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "国标关联参数")
|
||||
public class GbStreamParam {
|
||||
|
||||
@Schema(description = "平台ID")
|
||||
private String platformId;
|
||||
|
||||
@Schema(description = "目录ID")
|
||||
private String catalogId;
|
||||
|
||||
@Schema(description = "流国标信息列表")
|
||||
private List<GbStream> gbStreams;
|
||||
|
||||
public String getPlatformId() {
|
||||
|
||||
@@ -3,19 +3,14 @@ package com.genersoft.iot.vmp.vmanager.gb28181.media;
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
|
||||
import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.OnPublishHookParam;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.service.IMediaService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
@Api(tags = "媒体流相关")
|
||||
@Tag(name = "媒体流相关")
|
||||
@Controller
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = "/api/media")
|
||||
@@ -48,12 +43,12 @@ public class MediaController {
|
||||
* @param stream 流id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据应用名和流id获取播放地址")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "mediaServerId", value = "媒体服务器id", dataTypeClass = String.class, required = false),
|
||||
})
|
||||
@Operation(summary = "根据应用名和流id获取播放地址")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
@Parameter(name = "mediaServerId", description = "媒体服务器id")
|
||||
@Parameter(name = "callId", description = "推流时携带的自定义鉴权ID")
|
||||
@Parameter(name = "useSourceIpAsStreamIp", description = "是否使用请求IP作为返回的地址IP")
|
||||
@GetMapping(value = "/stream_info_by_app_and_stream")
|
||||
@ResponseBody
|
||||
public WVPResult<StreamInfo> getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app,
|
||||
|
||||
@@ -18,10 +18,9 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -36,7 +35,7 @@ import java.util.List;
|
||||
/**
|
||||
* 级联平台管理
|
||||
*/
|
||||
@Api(tags = "级联平台管理")
|
||||
@Tag(name = "级联平台管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/platform")
|
||||
@@ -73,7 +72,7 @@ public class PlatformController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取国标服务的配置")
|
||||
@Operation(summary = "获取国标服务的配置")
|
||||
@GetMapping("/server_config")
|
||||
public ResponseEntity<JSONObject> serverConfig() {
|
||||
JSONObject result = new JSONObject();
|
||||
@@ -89,7 +88,8 @@ public class PlatformController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取国标服务的配置")
|
||||
@Operation(summary = "获取级联服务器信息")
|
||||
@Parameter(name = "id", description = "平台国标编号", required = true)
|
||||
@GetMapping("/info/{id}")
|
||||
public ResponseEntity<WVPResult<ParentPlatform>> getPlatform(@PathVariable String id) {
|
||||
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(id);
|
||||
@@ -112,12 +112,10 @@ public class PlatformController {
|
||||
* @param count 每页条数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("分页查询级联平台")
|
||||
@GetMapping("/query/{count}/{page}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class),
|
||||
})
|
||||
@Operation(summary = "分页查询级联平台")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页条数", required = true)
|
||||
public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) {
|
||||
|
||||
PageInfo<ParentPlatform> parentPlatformPageInfo = storager.queryParentPlatformList(page, count);
|
||||
@@ -136,10 +134,7 @@ public class PlatformController {
|
||||
* @param parentPlatform
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("添加上级平台信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentPlatform", value = "上级平台信息", dataTypeClass = ParentPlatform.class),
|
||||
})
|
||||
@Operation(summary = "添加上级平台信息")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<String>> addPlatform(@RequestBody ParentPlatform parentPlatform) {
|
||||
@@ -211,10 +206,7 @@ public class PlatformController {
|
||||
* @param parentPlatform
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("保存上级平台信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentPlatform", value = "上级平台信息", dataTypeClass = ParentPlatform.class),
|
||||
})
|
||||
@Operation(summary = "保存上级平台信息")
|
||||
@PostMapping("/save")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<String>> savePlatform(@RequestBody ParentPlatform parentPlatform) {
|
||||
@@ -286,10 +278,8 @@ public class PlatformController {
|
||||
* @param serverGBId 上级平台国标ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除上级平台")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "删除上级平台")
|
||||
@Parameter(name = "serverGBId", description = "上级平台的国标编号")
|
||||
@DeleteMapping("/delete/{serverGBId}")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId) {
|
||||
@@ -339,17 +329,12 @@ public class PlatformController {
|
||||
* @param serverGBId 上级平台国标ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询上级平台是否存在")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "查询上级平台是否存在")
|
||||
@Parameter(name = "serverGBId", description = "上级平台的国标编号")
|
||||
@GetMapping("/exit/{serverGBId}")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId) {
|
||||
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询上级平台是否存在API调用:" + serverGBId);
|
||||
// }
|
||||
ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
|
||||
return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK);
|
||||
}
|
||||
@@ -365,16 +350,14 @@ public class PlatformController {
|
||||
* @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 = "catalogId", value = "目录ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "query", value = "查询内容", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "online", value = "是否在线", dataTypeClass = Boolean.class),
|
||||
@ApiImplicitParam(name = "channelType", value = "通道类型", dataTypeClass = Boolean.class),
|
||||
})
|
||||
@Operation(summary = "查询上级平台是否存在")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页条数", required = true)
|
||||
@Parameter(name = "platformId", description = "上级平台的国标编号")
|
||||
@Parameter(name = "catalogId", description = "目录ID")
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@Parameter(name = "channelType", description = "通道类型")
|
||||
@GetMapping("/channel_list")
|
||||
@ResponseBody
|
||||
public PageInfo<ChannelReduce> channelList(int page, int count,
|
||||
@@ -384,9 +367,6 @@ public class PlatformController {
|
||||
@RequestParam(required = false) Boolean online,
|
||||
@RequestParam(required = false) Boolean channelType) {
|
||||
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("查询所有所有通道API调用");
|
||||
// }
|
||||
if (StringUtils.isEmpty(platformId)) {
|
||||
platformId = null;
|
||||
}
|
||||
@@ -407,10 +387,7 @@ public class PlatformController {
|
||||
* @param param 通道关联参数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("向上级平台添加国标通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class),
|
||||
})
|
||||
@Operation(summary = "向上级平台添加国标通道")
|
||||
@PostMapping("/update_channel_for_gb")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param) {
|
||||
@@ -429,10 +406,7 @@ public class PlatformController {
|
||||
* @param param 通道关联参数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("从上级平台移除国标通道")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class),
|
||||
})
|
||||
@Operation(summary = "从上级平台移除国标通道")
|
||||
@DeleteMapping("/del_channel_for_gb")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param) {
|
||||
@@ -452,11 +426,9 @@ public class PlatformController {
|
||||
* @param parentId 目录父ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取目录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "platformId", value = "平台ID", dataTypeClass = String.class, required = true),
|
||||
@ApiImplicitParam(name = "parentId", value = "目录父ID", dataTypeClass = String.class, required = true),
|
||||
})
|
||||
@Operation(summary = "获取目录")
|
||||
@Parameter(name = "platformId", description = "上级平台的国标编号", required = true)
|
||||
@Parameter(name = "parentId", description = "父级目录的国标编号", required = true)
|
||||
@GetMapping("/catalog")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<List<PlatformCatalog>>> getCatalogByPlatform(String platformId, String parentId) {
|
||||
@@ -472,11 +444,6 @@ public class PlatformController {
|
||||
parentId = platform.getDeviceGBId();
|
||||
}
|
||||
List<PlatformCatalog> platformCatalogList = storager.getChildrenCatalogByPlatform(platformId, parentId);
|
||||
// if (platform.getTreeType().equals(TreeType.BUSINESS_GROUP)) {
|
||||
// platformCatalogList = storager.getChildrenCatalogByPlatform(platformId, parentId);
|
||||
// }else {
|
||||
//
|
||||
// }
|
||||
|
||||
WVPResult<List<PlatformCatalog>> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
@@ -491,10 +458,7 @@ public class PlatformController {
|
||||
* @param platformCatalog 目录
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("添加目录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "platformCatalog", value = "目录信息", dataTypeClass = PlatformCatalog.class, required = true),
|
||||
})
|
||||
@Operation(summary = "添加目录")
|
||||
@PostMapping("/catalog/add")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<List<PlatformCatalog>>> addCatalog(@RequestBody PlatformCatalog platformCatalog) {
|
||||
@@ -528,10 +492,7 @@ public class PlatformController {
|
||||
* @param platformCatalog 目录
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("编辑目录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "platformCatalog", value = "目录信息", dataTypeClass = PlatformCatalog.class, required = true),
|
||||
})
|
||||
@Operation(summary = "编辑目录")
|
||||
@PostMapping("/catalog/edit")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<List<PlatformCatalog>>> editCatalog(@RequestBody PlatformCatalog platformCatalog) {
|
||||
@@ -561,12 +522,12 @@ public class PlatformController {
|
||||
* 删除目录
|
||||
*
|
||||
* @param id 目录Id
|
||||
* @param platformId 平台Id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除目录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "目录Id", dataTypeClass = String.class, required = true),
|
||||
})
|
||||
@Operation(summary = "删除目录")
|
||||
@Parameter(name = "id", description = "目录Id", required = true)
|
||||
@Parameter(name = "platformId", description = "平台Id", required = true)
|
||||
@DeleteMapping("/catalog/del")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<String>> delCatalog(String id, String platformId) {
|
||||
@@ -609,10 +570,7 @@ public class PlatformController {
|
||||
* @param platformCatalog 关联的信息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除关联")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "platformCatalog", value = "关联的信息", dataTypeClass = PlatformCatalog.class, required = true),
|
||||
})
|
||||
@Operation(summary = "删除关联")
|
||||
@DeleteMapping("/catalog/relation/del")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<List<PlatformCatalog>>> delRelation(@RequestBody PlatformCatalog platformCatalog) {
|
||||
@@ -641,11 +599,9 @@ public class PlatformController {
|
||||
* @param catalogId 目录Id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("修改默认目录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "platformId", value = "平台Id", dataTypeClass = String.class, required = true),
|
||||
@ApiImplicitParam(name = "catalogId", value = "目录Id", dataTypeClass = String.class, required = true),
|
||||
})
|
||||
@Operation(summary = "修改默认目录")
|
||||
@Parameter(name = "catalogId", description = "目录Id", required = true)
|
||||
@Parameter(name = "platformId", description = "平台Id", required = true)
|
||||
@PostMapping("/catalog/default/update")
|
||||
@ResponseBody
|
||||
public ResponseEntity<WVPResult<String>> setDefaultCatalog(String platformId, String catalogId) {
|
||||
|
||||
@@ -1,55 +1,66 @@
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 精简的channel信息展示,主要是选择通道的时候展示列表使用
|
||||
*/
|
||||
@Schema(description = "精简的channel信息展示")
|
||||
public class ChannelReduce {
|
||||
|
||||
/**
|
||||
* deviceChannel的数据库自增ID
|
||||
*/
|
||||
@Schema(description = "deviceChannel的数据库自增ID")
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 通道id
|
||||
*/
|
||||
@Schema(description = "通道国标编号")
|
||||
private String channelId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@Schema(description = "设备国标编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 通道名
|
||||
*/
|
||||
@Schema(description = "通道名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
@Schema(description = "生产厂商")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* wan地址
|
||||
*/
|
||||
@Schema(description = "wan地址")
|
||||
private String hostAddress;
|
||||
|
||||
/**
|
||||
* 子节点数
|
||||
*/
|
||||
@Schema(description = "子节点数")
|
||||
private int subCount;
|
||||
|
||||
/**
|
||||
* 平台Id
|
||||
*/
|
||||
@Schema(description = "平台上级国标编号")
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 目录Id
|
||||
*/
|
||||
@Schema(description = "目录国标编号")
|
||||
private String catalogId;
|
||||
|
||||
public int getId() {
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通道关联参数
|
||||
* @author lin
|
||||
*/
|
||||
@Schema(description = "通道关联参数")
|
||||
public class UpdateChannelParam {
|
||||
|
||||
@Schema(description = "上级平台的国标编号")
|
||||
private String platformId;
|
||||
|
||||
@Schema(description = "目录的国标编号")
|
||||
private String catalogId;
|
||||
|
||||
@Schema(description = "")
|
||||
private List<ChannelReduce> channelReduces;
|
||||
|
||||
public String getPlatformId() {
|
||||
|
||||
@@ -15,10 +15,10 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -39,7 +39,7 @@ import org.springframework.web.context.request.async.DeferredResult;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "国标设备点播")
|
||||
@Tag(name = "国标设备点播")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/play")
|
||||
@@ -74,11 +74,9 @@ public class PlayController {
|
||||
@Autowired
|
||||
private IMediaServerService mediaServerService;
|
||||
|
||||
@ApiOperation("开始点播")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "开始点播")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@GetMapping("/start/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId,
|
||||
@PathVariable String channelId) {
|
||||
@@ -91,11 +89,10 @@ public class PlayController {
|
||||
return playResult.getResult();
|
||||
}
|
||||
|
||||
@ApiOperation("停止点播")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "停止点播")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@GetMapping("/stop/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String deviceId, @PathVariable String channelId) {
|
||||
|
||||
@@ -164,10 +161,8 @@ public class PlayController {
|
||||
* @param streamId 流ID
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "将不是h264的视频通过ffmpeg 转码为h264 + aac")
|
||||
@Parameter(name = "streamId", description = "视频流ID", required = true)
|
||||
@PostMapping("/convert/{streamId}")
|
||||
public ResponseEntity<String> playConvert(@PathVariable String streamId) {
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
|
||||
@@ -211,10 +206,9 @@ public class PlayController {
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("结束转码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "结束转码")
|
||||
@Parameter(name = "key", description = "视频流key", required = true)
|
||||
@Parameter(name = "mediaServerId", description = "流媒体服务ID", required = true)
|
||||
@PostMapping("/convertStop/{key}")
|
||||
public ResponseEntity<String> playConvertStop(@PathVariable String key, String mediaServerId) {
|
||||
JSONObject result = new JSONObject();
|
||||
@@ -250,10 +244,8 @@ public class PlayController {
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("语音广播命令")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "语音广播命令")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@GetMapping("/broadcast/{deviceId}")
|
||||
@PostMapping("/broadcast/{deviceId}")
|
||||
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) {
|
||||
@@ -313,7 +305,7 @@ public class PlayController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有的ssrc")
|
||||
@Operation(summary = "获取所有的ssrc")
|
||||
@GetMapping("/ssrc")
|
||||
public WVPResult<JSONObject> getSSRC() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@@ -2,14 +2,12 @@ package com.genersoft.iot.vmp.vmanager.gb28181.playback;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||
//import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
|
||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,7 +26,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import org.springframework.web.context.request.async.DeferredResult;
|
||||
|
||||
@Api(tags = "视频回放")
|
||||
@Tag(name = "视频回放")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/playback")
|
||||
@@ -45,25 +43,17 @@ public class PlaybackController {
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
// @Autowired
|
||||
// private ZLMRESTfulUtils zlmresTfulUtils;
|
||||
|
||||
@Autowired
|
||||
private IPlayService playService;
|
||||
|
||||
@Autowired
|
||||
private DeferredResultHolder resultHolder;
|
||||
|
||||
@Autowired
|
||||
private IMediaServerService mediaServerService;
|
||||
|
||||
@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),
|
||||
})
|
||||
@Operation(summary = "开始视频回放")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "startTime", description = "开始时间", required = true)
|
||||
@Parameter(name = "endTime", description = "结束时间", required = true)
|
||||
@GetMapping("/start/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
|
||||
String startTime,String endTime) {
|
||||
@@ -79,12 +69,11 @@ public class PlaybackController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("停止视频回放")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "停止视频回放")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@GetMapping("/stop/{deviceId}/{channelId}/{stream}")
|
||||
public ResponseEntity<String> playStop(
|
||||
@PathVariable String deviceId,
|
||||
@@ -111,10 +100,9 @@ public class PlaybackController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("回放暂停")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "回放流ID", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "回放暂停")
|
||||
@Parameter(name = "streamId", description = "回放流ID", required = true)
|
||||
@GetMapping("/pause/{streamId}")
|
||||
public ResponseEntity<String> playPause(@PathVariable String streamId) {
|
||||
logger.info("playPause: "+streamId);
|
||||
@@ -131,10 +119,9 @@ public class PlaybackController {
|
||||
return new ResponseEntity<String>(json.toString(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("回放恢复")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "回放流ID", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "回放恢复")
|
||||
@Parameter(name = "streamId", description = "回放流ID", required = true)
|
||||
@GetMapping("/resume/{streamId}")
|
||||
public ResponseEntity<String> playResume(@PathVariable String streamId) {
|
||||
logger.info("playResume: "+streamId);
|
||||
@@ -151,11 +138,10 @@ public class PlaybackController {
|
||||
return new ResponseEntity<String>(json.toString(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("回放拖动播放")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "回放流ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "seekTime", value = "拖动偏移量,单位s", dataTypeClass = Long.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "回放拖动播放")
|
||||
@Parameter(name = "streamId", description = "回放流ID", required = true)
|
||||
@Parameter(name = "seekTime", description = "拖动偏移量,单位s", required = true)
|
||||
@GetMapping("/seek/{streamId}/{seekTime}")
|
||||
public ResponseEntity<String> playSeek(@PathVariable String streamId, @PathVariable long seekTime) {
|
||||
logger.info("playSeek: "+streamId+", "+seekTime);
|
||||
@@ -172,11 +158,9 @@ public class PlaybackController {
|
||||
return new ResponseEntity<String>(json.toString(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("回放倍速播放")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "streamId", value = "回放流ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "speed", value = "倍速0.25 0.5 1、2、4", dataTypeClass = Double.class),
|
||||
})
|
||||
@Operation(summary = "回放倍速播放")
|
||||
@Parameter(name = "streamId", description = "回放流ID", required = true)
|
||||
@Parameter(name = "speed", description = "倍速0.25 0.5 1、2、4", required = true)
|
||||
@GetMapping("/speed/{streamId}/{speed}")
|
||||
public ResponseEntity<String> playSpeed(@PathVariable String streamId, @PathVariable Double speed) {
|
||||
logger.info("playSpeed: "+streamId+", "+speed);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -21,7 +21,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "云台控制")
|
||||
@Tag(name = "云台控制")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/ptz")
|
||||
@@ -48,15 +48,14 @@ public class PtzController {
|
||||
* @param zoomSpeed 缩放速度
|
||||
* @return String 控制结果
|
||||
*/
|
||||
@ApiOperation("云台控制")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "command", value = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "horizonSpeed", value = "水平速度", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "verticalSpeed", value = "垂直速度", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "zoomSpeed", value = "缩放速度", dataTypeClass = Integer.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "云台控制")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "command", description = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true)
|
||||
@Parameter(name = "horizonSpeed", description = "水平速度", required = true)
|
||||
@Parameter(name = "verticalSpeed", description = "垂直速度", required = true)
|
||||
@Parameter(name = "zoomSpeed", description = "缩放速度", required = true)
|
||||
@PostMapping("/control/{deviceId}/{channelId}")
|
||||
public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId, String command, int horizonSpeed, int verticalSpeed, int zoomSpeed){
|
||||
|
||||
@@ -106,15 +105,14 @@ public class PtzController {
|
||||
return new ResponseEntity<String>("success",HttpStatus.OK);
|
||||
}
|
||||
|
||||
@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),
|
||||
})
|
||||
|
||||
@Operation(summary = "通用前端控制命令")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "cmdCode", description = "指令码", required = true)
|
||||
@Parameter(name = "parameter1", description = "数据一", required = true)
|
||||
@Parameter(name = "parameter2", description = "数据二", required = true)
|
||||
@Parameter(name = "combindCode2", description = "组合码二", required = true)
|
||||
@PostMapping("/front_end_command/{deviceId}/{channelId}")
|
||||
public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){
|
||||
|
||||
@@ -127,11 +125,10 @@ public class PtzController {
|
||||
return new ResponseEntity<String>("success",HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("预置位查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "预置位查询")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@GetMapping("/preset/query/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IPlayService;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -32,7 +32,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import java.time.LocalDate;
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "国标录像")
|
||||
@Tag(name = "国标录像")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/gb_record")
|
||||
@@ -52,16 +52,11 @@ public class GBRecordController {
|
||||
@Autowired
|
||||
private IPlayService playService;
|
||||
|
||||
@Autowired
|
||||
private IMediaServerService mediaServerService;
|
||||
|
||||
@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),
|
||||
})
|
||||
@Operation(summary = "录像查询")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "startTime", description = "开始时间", required = true)
|
||||
@Parameter(name = "endTime", description = "结束时间", required = true)
|
||||
@GetMapping("/query/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<WVPResult<RecordInfo>>> recordinfo(@PathVariable String deviceId, @PathVariable String channelId, String startTime, String endTime){
|
||||
|
||||
@@ -116,14 +111,13 @@ public class GBRecordController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@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),
|
||||
@ApiImplicitParam(name = "downloadSpeed", value = "下载倍速", dataTypeClass = String.class),
|
||||
})
|
||||
|
||||
@Operation(summary = "开始历史媒体下载")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "startTime", description = "开始时间", required = true)
|
||||
@Parameter(name = "endTime", description = "结束时间", required = true)
|
||||
@Parameter(name = "downloadSpeed", description = "下载倍速", required = true)
|
||||
@GetMapping("/download/start/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<String>> download(@PathVariable String deviceId, @PathVariable String channelId,
|
||||
String startTime, String endTime, String downloadSpeed) {
|
||||
@@ -184,12 +178,10 @@ public class GBRecordController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("停止历史媒体下载")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "停止历史媒体下载")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@GetMapping("/download/stop/{deviceId}/{channelId}/{stream}")
|
||||
public ResponseEntity<String> playStop(@PathVariable String deviceId, @PathVariable String channelId, @PathVariable String stream) {
|
||||
|
||||
@@ -210,12 +202,10 @@ public class GBRecordController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取历史媒体下载进度")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "获取历史媒体下载进度")
|
||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@GetMapping("/download/progress/{deviceId}/{channelId}/{stream}")
|
||||
public ResponseEntity<StreamInfo> getProgress(@PathVariable String deviceId, @PathVariable String channelId, @PathVariable String stream) {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
@Api(tags = "日志管理")
|
||||
@Tag(name = "日志管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/log")
|
||||
@@ -45,16 +45,14 @@ public class LogController {
|
||||
* @param endTime 结束时间
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("分页查询报警")
|
||||
@GetMapping("/all")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="page", value = "当前页", required = true ,dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="count", value = "每页查询数量", required = true ,dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="type", value = "类型" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="startTime", value = "查询内容" ,dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="endTime", value = "查询内容" ,dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "分页查询报警")
|
||||
@Parameter(name = "query", description = "查询内容", required = true)
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
@Parameter(name = "type", description = "类型", required = true)
|
||||
@Parameter(name = "startTime", description = "开始时间", required = true)
|
||||
@Parameter(name = "endTime", description = "结束时间", required = true)
|
||||
public ResponseEntity<PageInfo<LogDto>> getAll(
|
||||
@RequestParam int page,
|
||||
@RequestParam int count,
|
||||
@@ -88,9 +86,8 @@ public class LogController {
|
||||
* 清空日志
|
||||
*
|
||||
*/
|
||||
@ApiOperation("清空日志")
|
||||
@Operation(summary = "停止视频回放")
|
||||
@DeleteMapping("/clear")
|
||||
@ApiImplicitParams({})
|
||||
public ResponseEntity<WVPResult<String>> clear() {
|
||||
|
||||
int count = logService.clear();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//@Api(tags = "云端录像")
|
||||
//@Tag(name = "云端录像")
|
||||
//@CrossOrigin
|
||||
//@RestController
|
||||
//@RequestMapping("/api/record")
|
||||
@@ -22,7 +22,7 @@
|
||||
// @Autowired
|
||||
// private IRecordInfoServer recordInfoServer;
|
||||
//
|
||||
// @ApiOperation("录像列表查询")
|
||||
// //@ApiOperation("录像列表查询")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
// @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
|
||||
@@ -37,7 +37,7 @@
|
||||
// return recordList;
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取录像详情")
|
||||
// //@ApiOperation("获取录像详情")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name="recordInfo", value = "录像记录", required = true, dataTypeClass = RecordInfo.class)
|
||||
// })
|
||||
|
||||
@@ -15,10 +15,10 @@ import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.utils.SpringBeanFactory;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import gov.nist.javax.sip.SipStackImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Api(tags = "服务控制")
|
||||
@Tag(name = "服务控制")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/server")
|
||||
@@ -61,10 +61,10 @@ public class ServerController {
|
||||
private int serverPort;
|
||||
|
||||
|
||||
@ApiOperation("流媒体服务列表")
|
||||
@GetMapping(value = "/media_server/list")
|
||||
@ResponseBody
|
||||
public WVPResult<List<MediaServerItem>> getMediaServerList(boolean detail){
|
||||
@Operation(summary = "流媒体服务列表")
|
||||
public WVPResult<List<MediaServerItem>> getMediaServerList() {
|
||||
WVPResult<List<MediaServerItem>> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -72,10 +72,10 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("在线流媒体服务列表")
|
||||
@GetMapping(value = "/media_server/online/list")
|
||||
@ResponseBody
|
||||
public WVPResult<List<MediaServerItem>> getOnlineMediaServerList(){
|
||||
@Operation(summary = "在线流媒体服务列表")
|
||||
public WVPResult<List<MediaServerItem>> getOnlineMediaServerList() {
|
||||
WVPResult<List<MediaServerItem>> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -83,10 +83,11 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("获取流媒体服务")
|
||||
@GetMapping(value = "/media_server/one/{id}")
|
||||
@ResponseBody
|
||||
public WVPResult<MediaServerItem> getMediaServer(@PathVariable String id){
|
||||
@Operation(summary = "停止视频回放")
|
||||
@Parameter(name = "id", description = "流媒体服务ID", required = true)
|
||||
public WVPResult<MediaServerItem> getMediaServer(@PathVariable String id) {
|
||||
WVPResult<MediaServerItem> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -94,57 +95,49 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("测试流媒体服务")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="ip", value = "流媒体服务IP", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="port", value = "流媒体服务HTT端口", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="secret", value = "流媒体服务secret", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "测试流媒体服务")
|
||||
@Parameter(name = "ip", description = "流媒体服务IP", required = true)
|
||||
@Parameter(name = "port", description = "流媒体服务HTT端口", required = true)
|
||||
@Parameter(name = "secret", description = "流媒体服务secret", required = true)
|
||||
@GetMapping(value = "/media_server/check")
|
||||
@ResponseBody
|
||||
public WVPResult<MediaServerItem> checkMediaServer(@RequestParam String ip, @RequestParam int port, @RequestParam String secret){
|
||||
public WVPResult<MediaServerItem> checkMediaServer(@RequestParam String ip, @RequestParam int port, @RequestParam String secret) {
|
||||
return mediaServerService.checkMediaServer(ip, port, secret);
|
||||
}
|
||||
|
||||
@ApiOperation("测试流媒体录像管理服务")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="ip", value = "流媒体服务IP", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="port", value = "流媒体服务HTT端口", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name="secret", value = "流媒体服务secret", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "测试流媒体录像管理服务")
|
||||
@Parameter(name = "ip", description = "流媒体服务IP", required = true)
|
||||
@Parameter(name = "port", description = "流媒体服务HTT端口", required = true)
|
||||
@GetMapping(value = "/media_server/record/check")
|
||||
@ResponseBody
|
||||
public WVPResult<String> checkMediaRecordServer(@RequestParam String ip, @RequestParam int port){
|
||||
public WVPResult<String> checkMediaRecordServer(@RequestParam String ip, @RequestParam int port) {
|
||||
boolean checkResult = mediaServerService.checkMediaRecordServer(ip, port);
|
||||
WVPResult<String> result = new WVPResult<>();
|
||||
if (checkResult) {
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
|
||||
}else {
|
||||
} else {
|
||||
result.setCode(-1);
|
||||
result.setMsg("连接失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("保存流媒体服务")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="mediaServerItem", value = "流媒体信息", dataTypeClass = MediaServerItem.class)
|
||||
})
|
||||
@Operation(summary = "保存流媒体服务")
|
||||
@Parameter(name = "mediaServerItem", description = "流媒体信息", required = true)
|
||||
@PostMapping(value = "/media_server/save")
|
||||
@ResponseBody
|
||||
public WVPResult<String> saveMediaServer(@RequestBody MediaServerItem mediaServerItem){
|
||||
public WVPResult<String> saveMediaServer(@RequestBody MediaServerItem mediaServerItem) {
|
||||
MediaServerItem mediaServerItemInDatabase = mediaServerService.getOne(mediaServerItem.getId());
|
||||
|
||||
if (mediaServerItemInDatabase != null) {
|
||||
if (StringUtils.isEmpty(mediaServerItemInDatabase.getSendRtpPortRange())
|
||||
&& StringUtils.isEmpty(mediaServerItem.getSendRtpPortRange())){
|
||||
if (StringUtils.isEmpty(mediaServerItemInDatabase.getSendRtpPortRange()) && StringUtils.isEmpty(mediaServerItem.getSendRtpPortRange())) {
|
||||
mediaServerItem.setSendRtpPortRange("30000,30500");
|
||||
}
|
||||
mediaServerService.update(mediaServerItem);
|
||||
}else {
|
||||
if (StringUtils.isEmpty(mediaServerItem.getSendRtpPortRange())){
|
||||
mediaServerService.update(mediaServerItem);
|
||||
} else {
|
||||
if (StringUtils.isEmpty(mediaServerItem.getSendRtpPortRange())) {
|
||||
mediaServerItem.setSendRtpPortRange("30000,30500");
|
||||
}
|
||||
return mediaServerService.add(mediaServerItem);
|
||||
@@ -156,17 +149,15 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("移除流媒体服务")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="id", value = "流媒体ID", dataTypeClass = String.class)
|
||||
})
|
||||
@Operation(summary = "移除流媒体服务")
|
||||
@Parameter(name = "id", description = "流媒体ID", required = true)
|
||||
@DeleteMapping(value = "/media_server/delete")
|
||||
@ResponseBody
|
||||
public WVPResult<String> deleteMediaServer(@RequestParam String id){
|
||||
public WVPResult<String> deleteMediaServer(@RequestParam String id) {
|
||||
if (mediaServerService.getOne(id) != null) {
|
||||
mediaServerService.delete(id);
|
||||
mediaServerService.deleteDb(id);
|
||||
}else {
|
||||
} else {
|
||||
WVPResult<String> result = new WVPResult<>();
|
||||
result.setCode(-1);
|
||||
result.setMsg("未找到此节点");
|
||||
@@ -179,18 +170,17 @@ public class ServerController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("重启服务")
|
||||
@Operation(summary = "重启服务")
|
||||
@GetMapping(value = "/restart")
|
||||
@ResponseBody
|
||||
public Object restart(){
|
||||
public Object restart() {
|
||||
Thread restartThread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
SipProvider up = (SipProvider) SpringBeanFactory.getBean("udpSipProvider");
|
||||
SipStackImpl stack = (SipStackImpl)up.getSipStack();
|
||||
SipStackImpl stack = (SipStackImpl) up.getSipStack();
|
||||
stack.stop();
|
||||
Iterator listener = stack.getListeningPoints();
|
||||
while (listener.hasNext()) {
|
||||
@@ -213,10 +203,10 @@ public class ServerController {
|
||||
return "success";
|
||||
}
|
||||
|
||||
@ApiOperation("版本信息")
|
||||
@Operation(summary = "获取版本信息")
|
||||
@GetMapping(value = "/version")
|
||||
@ResponseBody
|
||||
public WVPResult<VersionPo> getVersion(){
|
||||
public WVPResult<VersionPo> getVersion() {
|
||||
WVPResult<VersionPo> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -224,13 +214,11 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("配置信息")
|
||||
@GetMapping(value = "/config")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="type", value = "配置类型(sip, base)", dataTypeClass = String.class),
|
||||
})
|
||||
@Operation(summary = "获取配置信息")
|
||||
@Parameter(name = "type", description = "配置类型(sip, base)", required = true)
|
||||
@ResponseBody
|
||||
public WVPResult<JSONObject> getVersion(String type){
|
||||
public WVPResult<JSONObject> getVersion(String type) {
|
||||
WVPResult<JSONObject> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -240,8 +228,8 @@ public class ServerController {
|
||||
if (StringUtils.isEmpty(type)) {
|
||||
jsonObject.put("sip", JSON.toJSON(sipConfig));
|
||||
jsonObject.put("base", JSON.toJSON(userSetting));
|
||||
}else {
|
||||
switch (type){
|
||||
} else {
|
||||
switch (type) {
|
||||
case "sip":
|
||||
jsonObject.put("sip", sipConfig);
|
||||
break;
|
||||
@@ -256,10 +244,10 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("获取当前所有hook")
|
||||
@GetMapping(value = "/hooks")
|
||||
@ResponseBody
|
||||
public WVPResult<List<IHookSubscribe>> getHooks(){
|
||||
@Operation(summary = "获取当前所有hook")
|
||||
public WVPResult<List<IHookSubscribe>> getHooks() {
|
||||
WVPResult<List<IHookSubscribe>> result = new WVPResult<>();
|
||||
result.setCode(0);
|
||||
result.setMsg("success");
|
||||
@@ -268,7 +256,7 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
// @ApiOperation("当前进行中的动态任务")
|
||||
// //@ApiOperation("当前进行中的动态任务")
|
||||
// @GetMapping(value = "/dynamicTask")
|
||||
// @ResponseBody
|
||||
// public WVPResult<JSONObject> getDynamicTask(){
|
||||
|
||||
@@ -10,10 +10,10 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* 拉流代理接口
|
||||
*/
|
||||
@Api(tags = "拉流代理")
|
||||
@Tag(name = "拉流代理", description = "")
|
||||
@Controller
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = "/api/proxy")
|
||||
@@ -44,13 +44,11 @@ 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),
|
||||
})
|
||||
@Operation(summary = "分页查询流代理")
|
||||
@Parameter(name = "page", description = "当前页")
|
||||
@Parameter(name = "count", description = "每页查询数量")
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page,
|
||||
@@ -61,9 +59,8 @@ public class StreamProxyController {
|
||||
return streamProxyService.getAll(page, count);
|
||||
}
|
||||
|
||||
@ApiOperation("保存代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class),
|
||||
@Operation(summary = "保存代理", parameters = {
|
||||
@Parameter(name = "param", description = "代理参数", required = true),
|
||||
})
|
||||
@PostMapping(value = "/save")
|
||||
@ResponseBody
|
||||
@@ -82,12 +79,10 @@ public class StreamProxyController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("获取ffmpeg.cmd模板")
|
||||
@GetMapping(value = "/ffmpeg_cmd/list")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "mediaServerId", value = "流媒体ID", dataTypeClass = String.class),
|
||||
})
|
||||
@ResponseBody
|
||||
@Operation(summary = "获取ffmpeg.cmd模板")
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID", required = true)
|
||||
public WVPResult getFFmpegCMDs(@RequestParam String mediaServerId){
|
||||
logger.debug("获取节点[ {} ]ffmpeg.cmd模板", mediaServerId );
|
||||
|
||||
@@ -100,13 +95,11 @@ public class StreamProxyController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("移除代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@DeleteMapping(value = "/del")
|
||||
@ResponseBody
|
||||
@Operation(summary = "移除代理")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public WVPResult del(@RequestParam String app, @RequestParam String stream){
|
||||
logger.info("移除代理: " + app + "/" + stream);
|
||||
WVPResult<Object> result = new WVPResult<>();
|
||||
@@ -121,13 +114,11 @@ public class StreamProxyController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("启用代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping(value = "/start")
|
||||
@ResponseBody
|
||||
@Operation(summary = "启用代理")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public Object start(String app, String stream){
|
||||
logger.info("启用代理: " + app + "/" + stream);
|
||||
boolean result = streamProxyService.start(app, stream);
|
||||
@@ -137,13 +128,11 @@ public class StreamProxyController {
|
||||
return result?"success":"fail";
|
||||
}
|
||||
|
||||
@ApiOperation("停用代理")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping(value = "/stop")
|
||||
@ResponseBody
|
||||
@Operation(summary = "停用代理")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public Object stop(String app, String stream){
|
||||
logger.info("停用代理: " + app + "/" + stream);
|
||||
boolean result = streamProxyService.stop(app, stream);
|
||||
|
||||
@@ -20,10 +20,10 @@ import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.poi.sl.usermodel.Sheet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -44,7 +44,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Api(tags = "推流信息管理")
|
||||
@Tag(name = "推流信息管理")
|
||||
@Controller
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = "/api/push")
|
||||
@@ -67,16 +67,14 @@ public class StreamPushController {
|
||||
@Autowired
|
||||
private UserSetting userSetting;
|
||||
|
||||
@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="pushing", value = "是否正在推流", dataTypeClass = Boolean.class),
|
||||
@ApiImplicitParam(name="mediaServerId", value = "流媒体ID", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
@Operation(summary = "推流列表查询")
|
||||
@Parameter(name = "page", description = "当前页")
|
||||
@Parameter(name = "count", description = "每页查询数量")
|
||||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "pushing", description = "是否正在推流")
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID")
|
||||
public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String query,
|
||||
@@ -93,12 +91,9 @@ public class StreamPushController {
|
||||
return pushList;
|
||||
}
|
||||
|
||||
@ApiOperation("将推流添加到国标")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class),
|
||||
})
|
||||
@PostMapping(value = "/save_to_gb")
|
||||
@ResponseBody
|
||||
@Operation(summary = "将推流添加到国标")
|
||||
public Object saveToGB(@RequestBody GbStream stream){
|
||||
if (streamPushService.saveToGB(stream)){
|
||||
return "success";
|
||||
@@ -108,12 +103,9 @@ public class StreamPushController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("将推流移出到国标")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class),
|
||||
})
|
||||
@DeleteMapping(value = "/remove_form_gb")
|
||||
@ResponseBody
|
||||
@Operation(summary = "将推流移出到国标")
|
||||
public Object removeFormGB(@RequestBody GbStream stream){
|
||||
if (streamPushService.removeFromGB(stream)){
|
||||
return "success";
|
||||
@@ -123,13 +115,11 @@ public class StreamPushController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("中止一个推流")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "streamId", value = "流ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping(value = "/stop")
|
||||
@ResponseBody
|
||||
@Operation(summary = "中止一个推流")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public Object stop(String app, String streamId){
|
||||
if (streamPushService.stop(app, streamId)){
|
||||
return "success";
|
||||
@@ -138,13 +128,9 @@ public class StreamPushController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("中止多个推流")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "streamId", value = "流ID", required = true, dataTypeClass = String.class),
|
||||
})
|
||||
@DeleteMapping(value = "/batchStop")
|
||||
@ResponseBody
|
||||
@Operation(summary = "中止多个推流")
|
||||
public Object batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){
|
||||
if (batchGBStreamParam.getGbStreams().size() == 0) {
|
||||
return "fail";
|
||||
@@ -256,14 +242,12 @@ public class StreamPushController {
|
||||
* @param stream 流id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取推流播放地址")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "mediaServerId", value = "媒体服务器id", dataTypeClass = String.class, required = false),
|
||||
})
|
||||
@GetMapping(value = "/getPlayUrl")
|
||||
@ResponseBody
|
||||
@Operation(summary = "获取推流播放地址")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
@Parameter(name = "mediaServerId", description = "媒体服务器id")
|
||||
public WVPResult<StreamInfo> getPlayUrl(@RequestParam String app,@RequestParam String stream,
|
||||
@RequestParam(required = false) String mediaServerId){
|
||||
boolean authority = false;
|
||||
@@ -297,12 +281,9 @@ public class StreamPushController {
|
||||
* @param stream 推流信息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取推流播放地址")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "stream", value = "推流信息", dataTypeClass = StreamPushItem.class),
|
||||
})
|
||||
@PostMapping(value = "/add")
|
||||
@ResponseBody
|
||||
@Operation(summary = "停止视频回放")
|
||||
public WVPResult<StreamInfo> add(@RequestBody StreamPushItem stream){
|
||||
if (StringUtils.isEmpty(stream.getGbId())) {
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import com.genersoft.iot.vmp.service.IRoleService;
|
||||
import com.genersoft.iot.vmp.storager.dao.dto.Role;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "角色管理")
|
||||
@Tag(name = "角色管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/role")
|
||||
@@ -25,12 +25,10 @@ public class RoleController {
|
||||
@Autowired
|
||||
private IRoleService roleService;
|
||||
|
||||
@ApiOperation("添加角色")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", required = true, value = "角色名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "authority", required = true, value = "权限(自行定义内容,目前未使用)", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "添加角色")
|
||||
@Parameter(name = "name", description = "角色名", required = true)
|
||||
@Parameter(name = "authority", description = "权限(自行定义内容,目前未使用)", required = true)
|
||||
public ResponseEntity<WVPResult<Integer>> add(@RequestParam String name,
|
||||
@RequestParam(required = false) String authority){
|
||||
WVPResult<Integer> result = new WVPResult<>();
|
||||
@@ -57,11 +55,9 @@ public class RoleController {
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("删除角色")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", required = true, value = "用户Id", dataTypeClass = Integer.class),
|
||||
})
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除角色")
|
||||
@Parameter(name = "id", description = "用户Id", required = true)
|
||||
public ResponseEntity<WVPResult<String>> delete(@RequestParam Integer id){
|
||||
// 获取当前登录用户id
|
||||
int currenRoleId = SecurityUtils.getUserInfo().getRole().getId();
|
||||
@@ -79,9 +75,8 @@ public class RoleController {
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询角色")
|
||||
@ApiImplicitParams({})
|
||||
@GetMapping("/all")
|
||||
@Operation(summary = "查询角色")
|
||||
public ResponseEntity<WVPResult<List<Role>>> all(){
|
||||
// 获取当前登录用户id
|
||||
List<Role> allRoles = roleService.getAll();
|
||||
|
||||
@@ -9,10 +9,10 @@ import com.genersoft.iot.vmp.storager.dao.dto.User;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.security.sasl.AuthenticationException;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "用户管理")
|
||||
@Tag(name = "用户管理")
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/user")
|
||||
@@ -39,12 +39,10 @@ public class UserController {
|
||||
@Autowired
|
||||
private IRoleService roleService;
|
||||
|
||||
@ApiOperation("登录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "username", required = true, value = "用户名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", required = true, value = "密码(32位md5加密)", dataTypeClass = String.class),
|
||||
})
|
||||
@GetMapping("/login")
|
||||
@Operation(summary = "登录")
|
||||
@Parameter(name = "username", description = "用户名", required = true)
|
||||
@Parameter(name = "password", description = "密码(32位md5加密)", required = true)
|
||||
public WVPResult<LoginUser> login(@RequestParam String username, @RequestParam String password){
|
||||
LoginUser user = null;
|
||||
WVPResult<LoginUser> result = new WVPResult<>();
|
||||
@@ -66,13 +64,11 @@ public class UserController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("修改密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "username", required = true, value = "用户名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "oldpassword", required = true, value = "旧密码(已md5加密的密码)", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", required = true, value = "新密码(未md5加密的密码)", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/changePassword")
|
||||
@Operation(summary = "修改密码")
|
||||
@Parameter(name = "username", description = "用户名", required = true)
|
||||
@Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true)
|
||||
@Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true)
|
||||
public String changePassword(@RequestParam String oldPassword, @RequestParam String password){
|
||||
// 获取当前登录用户id
|
||||
LoginUser userInfo = SecurityUtils.getUserInfo();
|
||||
@@ -97,13 +93,11 @@ public class UserController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("添加用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "username", required = true, value = "用户名", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", required = true, value = "密码(未md5加密的密码)", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "roleId", required = true, value = "角色ID", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "停止视频回放")
|
||||
@Parameter(name = "username", description = "用户名", required = true)
|
||||
@Parameter(name = "password", description = "密码(未md5加密的密码)", required = true)
|
||||
@Parameter(name = "roleId", description = "角色ID", required = true)
|
||||
public ResponseEntity<WVPResult<Integer>> add(@RequestParam String username,
|
||||
@RequestParam String password,
|
||||
@RequestParam Integer roleId){
|
||||
@@ -146,11 +140,9 @@ public class UserController {
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", required = true, value = "用户Id", dataTypeClass = Integer.class),
|
||||
})
|
||||
@DeleteMapping("/delete")
|
||||
@DeleteMapping("/删除用户")
|
||||
@Operation(summary = "停止视频回放")
|
||||
@Parameter(name = "id", description = "用户Id", required = true)
|
||||
public ResponseEntity<WVPResult<String>> delete(@RequestParam Integer id){
|
||||
// 获取当前登录用户id
|
||||
int currenRoleId = SecurityUtils.getUserInfo().getRole().getId();
|
||||
@@ -168,9 +160,8 @@ public class UserController {
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
@ApiImplicitParams({})
|
||||
@GetMapping("/all")
|
||||
@Operation(summary = "查询用户")
|
||||
public ResponseEntity<WVPResult<List<User>>> all(){
|
||||
// 获取当前登录用户id
|
||||
List<User> allUsers = userService.getAllUsers();
|
||||
@@ -188,22 +179,18 @@ public class UserController {
|
||||
* @param count 每页查询数量
|
||||
* @return 分页用户列表
|
||||
*/
|
||||
@ApiOperation("分页查询用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
|
||||
})
|
||||
@GetMapping("/users")
|
||||
@Operation(summary = "分页查询用户")
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
public PageInfo<User> users(int page, int count) {
|
||||
return userService.getUsers(page, count);
|
||||
}
|
||||
|
||||
@ApiOperation("修改pushkey")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "pushKey", required = true, value = "新的pushKey", dataTypeClass = String.class),
|
||||
})
|
||||
@RequestMapping("/changePushKey")
|
||||
@Operation(summary = "修改pushkey")
|
||||
@Parameter(name = "userId", description = "用户Id", required = true)
|
||||
@Parameter(name = "pushKey", description = "新的pushKey", required = true)
|
||||
public ResponseEntity<WVPResult<String>> changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) {
|
||||
// 获取当前登录用户id
|
||||
int currenRoleId = SecurityUtils.getUserInfo().getRole().getId();
|
||||
@@ -221,13 +208,11 @@ public class UserController {
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("管理员修改普通用户密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "adminId", required = true, value = "管理员id", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "userId", required = true, value = "用户id", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", required = true, value = "新密码(未md5加密的密码)", dataTypeClass = String.class),
|
||||
})
|
||||
@PostMapping("/changePasswordForAdmin")
|
||||
@Operation(summary = "管理员修改普通用户密码")
|
||||
@Parameter(name = "adminId", description = "管理员id", required = true)
|
||||
@Parameter(name = "userId", description = "用户id", required = true)
|
||||
@Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true)
|
||||
public String changePasswordForAdmin(@RequestParam int userId, @RequestParam String password) {
|
||||
// 获取当前登录用户id
|
||||
LoginUser userInfo = SecurityUtils.getUserInfo();
|
||||
|
||||
Reference in New Issue
Block a user