Commit f8d2b933b1156dfa076c90c10edc6b1649738b04
1 parent
7c07ae94
为每个接口添加调试接口需要的描述
Showing
21 changed files
with
157 additions
and
117 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java
| @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.cloudRecord; | @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.cloudRecord; | ||
| 3 | import com.genersoft.iot.vmp.conf.DynamicTask; | 3 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 4 | import com.genersoft.iot.vmp.conf.UserSetting; | 4 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 6 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 6 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; | 7 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| 7 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | 8 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 8 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 9 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.PageInfo; | @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.PageInfo; | ||
| 13 | import com.genersoft.iot.vmp.vmanager.bean.RecordFile; | 14 | import com.genersoft.iot.vmp.vmanager.bean.RecordFile; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 15 | import io.swagger.v3.oas.annotations.Operation; |
| 15 | import io.swagger.v3.oas.annotations.Parameter; | 16 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 16 | import io.swagger.v3.oas.annotations.tags.Tag; | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 17 | import org.apache.commons.lang3.ObjectUtils; | 19 | import org.apache.commons.lang3.ObjectUtils; |
| 18 | import org.slf4j.Logger; | 20 | import org.slf4j.Logger; |
| @@ -57,7 +59,7 @@ public class CloudRecordController { | @@ -57,7 +59,7 @@ public class CloudRecordController { | ||
| 57 | 59 | ||
| 58 | @ResponseBody | 60 | @ResponseBody |
| 59 | @GetMapping("/date/list") | 61 | @GetMapping("/date/list") |
| 60 | - @Operation(summary = "查询存在云端录像的日期") | 62 | + @Operation(summary = "查询存在云端录像的日期", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 61 | @Parameter(name = "app", description = "应用名", required = true) | 63 | @Parameter(name = "app", description = "应用名", required = true) |
| 62 | @Parameter(name = "stream", description = "流ID", required = true) | 64 | @Parameter(name = "stream", description = "流ID", required = true) |
| 63 | @Parameter(name = "year", description = "年,置空则查询当年", required = false) | 65 | @Parameter(name = "year", description = "年,置空则查询当年", required = false) |
| @@ -100,7 +102,7 @@ public class CloudRecordController { | @@ -100,7 +102,7 @@ public class CloudRecordController { | ||
| 100 | 102 | ||
| 101 | @ResponseBody | 103 | @ResponseBody |
| 102 | @GetMapping("/list") | 104 | @GetMapping("/list") |
| 103 | - @Operation(summary = "分页查询云端录像") | 105 | + @Operation(summary = "分页查询云端录像", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 104 | @Parameter(name = "app", description = "应用名", required = true) | 106 | @Parameter(name = "app", description = "应用名", required = true) |
| 105 | @Parameter(name = "stream", description = "流ID", required = true) | 107 | @Parameter(name = "stream", description = "流ID", required = true) |
| 106 | @Parameter(name = "page", description = "当前页", required = false) | 108 | @Parameter(name = "page", description = "当前页", required = false) |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
| 1 | package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition; | 1 | package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 4 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 5 | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; | 6 | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 13 | import com.github.pagehelper.util.StringUtil; | 14 | import com.github.pagehelper.util.StringUtil; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 15 | import io.swagger.v3.oas.annotations.Operation; |
| 15 | import io.swagger.v3.oas.annotations.Parameter; | 16 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 16 | import io.swagger.v3.oas.annotations.tags.Tag; | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 17 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
| 18 | import org.slf4j.LoggerFactory; | 20 | import org.slf4j.LoggerFactory; |
| @@ -59,7 +61,7 @@ public class MobilePositionController { | @@ -59,7 +61,7 @@ public class MobilePositionController { | ||
| 59 | * @param end 结束时间 | 61 | * @param end 结束时间 |
| 60 | * @return | 62 | * @return |
| 61 | */ | 63 | */ |
| 62 | - @Operation(summary = "查询历史轨迹") | 64 | + @Operation(summary = "查询历史轨迹", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 63 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 65 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 64 | @Parameter(name = "channelId", description = "通道国标编号") | 66 | @Parameter(name = "channelId", description = "通道国标编号") |
| 65 | @Parameter(name = "start", description = "开始时间") | 67 | @Parameter(name = "start", description = "开始时间") |
| @@ -84,7 +86,7 @@ public class MobilePositionController { | @@ -84,7 +86,7 @@ public class MobilePositionController { | ||
| 84 | * @param deviceId 设备ID | 86 | * @param deviceId 设备ID |
| 85 | * @return | 87 | * @return |
| 86 | */ | 88 | */ |
| 87 | - @Operation(summary = "查询设备最新位置") | 89 | + @Operation(summary = "查询设备最新位置", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 88 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 90 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 89 | @GetMapping("/latest/{deviceId}") | 91 | @GetMapping("/latest/{deviceId}") |
| 90 | public MobilePosition latestPosition(@PathVariable String deviceId) { | 92 | public MobilePosition latestPosition(@PathVariable String deviceId) { |
| @@ -96,7 +98,7 @@ public class MobilePositionController { | @@ -96,7 +98,7 @@ public class MobilePositionController { | ||
| 96 | * @param deviceId 设备ID | 98 | * @param deviceId 设备ID |
| 97 | * @return | 99 | * @return |
| 98 | */ | 100 | */ |
| 99 | - @Operation(summary = "获取移动位置信息") | 101 | + @Operation(summary = "获取移动位置信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 100 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 102 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 101 | @GetMapping("/realtime/{deviceId}") | 103 | @GetMapping("/realtime/{deviceId}") |
| 102 | public DeferredResult<MobilePosition> realTimePosition(@PathVariable String deviceId) { | 104 | public DeferredResult<MobilePosition> realTimePosition(@PathVariable String deviceId) { |
| @@ -136,7 +138,7 @@ public class MobilePositionController { | @@ -136,7 +138,7 @@ public class MobilePositionController { | ||
| 136 | * @param interval 上报时间间隔 | 138 | * @param interval 上报时间间隔 |
| 137 | * @return true = 命令发送成功 | 139 | * @return true = 命令发送成功 |
| 138 | */ | 140 | */ |
| 139 | - @Operation(summary = "订阅位置信息") | 141 | + @Operation(summary = "订阅位置信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 140 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 142 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 141 | @Parameter(name = "expires", description = "订阅超时时间", required = true) | 143 | @Parameter(name = "expires", description = "订阅超时时间", required = true) |
| 142 | @Parameter(name = "interval", description = "上报时间间隔", required = true) | 144 | @Parameter(name = "interval", description = "上报时间间隔", required = true) |
| @@ -162,7 +164,7 @@ public class MobilePositionController { | @@ -162,7 +164,7 @@ public class MobilePositionController { | ||
| 162 | * @param deviceId 设备ID | 164 | * @param deviceId 设备ID |
| 163 | * @return true = 命令发送成功 | 165 | * @return true = 命令发送成功 |
| 164 | */ | 166 | */ |
| 165 | - @Operation(summary = "数据位置信息格式处理") | 167 | + @Operation(summary = "数据位置信息格式处理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 166 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 168 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 167 | @GetMapping("/transform/{deviceId}") | 169 | @GetMapping("/transform/{deviceId}") |
| 168 | public void positionTransform(@PathVariable String deviceId) { | 170 | public void positionTransform(@PathVariable String deviceId) { |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/alarm/AlarmController.java
| 1 | package com.genersoft.iot.vmp.vmanager.gb28181.alarm; | 1 | package com.genersoft.iot.vmp.vmanager.gb28181.alarm; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 4 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 5 | import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; | 6 | import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; |
| 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 7 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -13,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 13 | import com.github.pagehelper.PageInfo; | 14 | import com.github.pagehelper.PageInfo; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 15 | import io.swagger.v3.oas.annotations.Operation; |
| 15 | import io.swagger.v3.oas.annotations.Parameter; | 16 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 16 | import io.swagger.v3.oas.annotations.tags.Tag; | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 17 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
| 18 | import org.slf4j.LoggerFactory; | 20 | import org.slf4j.LoggerFactory; |
| @@ -56,7 +58,7 @@ public class AlarmController { | @@ -56,7 +58,7 @@ public class AlarmController { | ||
| 56 | * @return | 58 | * @return |
| 57 | */ | 59 | */ |
| 58 | @DeleteMapping("/delete") | 60 | @DeleteMapping("/delete") |
| 59 | - @Operation(summary = "删除报警") | 61 | + @Operation(summary = "删除报警", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 60 | @Parameter(name = "id", description = "ID") | 62 | @Parameter(name = "id", description = "ID") |
| 61 | @Parameter(name = "deviceIds", description = "多个设备id,逗号分隔") | 63 | @Parameter(name = "deviceIds", description = "多个设备id,逗号分隔") |
| 62 | @Parameter(name = "time", description = "结束时间") | 64 | @Parameter(name = "time", description = "结束时间") |
| @@ -93,7 +95,7 @@ public class AlarmController { | @@ -93,7 +95,7 @@ public class AlarmController { | ||
| 93 | * @return | 95 | * @return |
| 94 | */ | 96 | */ |
| 95 | @GetMapping("/test/notify/alarm") | 97 | @GetMapping("/test/notify/alarm") |
| 96 | - @Operation(summary = "测试向上级/设备发送模拟报警通知") | 98 | + @Operation(summary = "测试向上级/设备发送模拟报警通知", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 97 | @Parameter(name = "deviceId", description = "设备国标编号") | 99 | @Parameter(name = "deviceId", description = "设备国标编号") |
| 98 | public void delete(@RequestParam String deviceId) { | 100 | public void delete(@RequestParam String deviceId) { |
| 99 | Device device = storage.queryVideoDevice(deviceId); | 101 | Device device = storage.queryVideoDevice(deviceId); |
| @@ -141,7 +143,7 @@ public class AlarmController { | @@ -141,7 +143,7 @@ public class AlarmController { | ||
| 141 | * @param endTime 结束时间 | 143 | * @param endTime 结束时间 |
| 142 | * @return | 144 | * @return |
| 143 | */ | 145 | */ |
| 144 | - @Operation(summary = "分页查询报警") | 146 | + @Operation(summary = "分页查询报警", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 145 | @Parameter(name = "page",description = "当前页",required = true) | 147 | @Parameter(name = "page",description = "当前页",required = true) |
| 146 | @Parameter(name = "count",description = "每页查询数量",required = true) | 148 | @Parameter(name = "count",description = "每页查询数量",required = true) |
| 147 | @Parameter(name = "deviceId",description = "设备id") | 149 | @Parameter(name = "deviceId",description = "设备id") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java
| @@ -9,6 +9,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | @@ -9,6 +9,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | ||
| 9 | 9 | ||
| 10 | import com.alibaba.fastjson2.JSONObject; | 10 | import com.alibaba.fastjson2.JSONObject; |
| 11 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 11 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 12 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 12 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 13 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 13 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 14 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 14 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 15 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 17 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 18 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 18 | import io.swagger.v3.oas.annotations.Operation; | 19 | import io.swagger.v3.oas.annotations.Operation; |
| 19 | import io.swagger.v3.oas.annotations.Parameter; | 20 | import io.swagger.v3.oas.annotations.Parameter; |
| 21 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 20 | import io.swagger.v3.oas.annotations.tags.Tag; | 22 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 21 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
| 22 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
| @@ -57,7 +59,7 @@ public class DeviceConfig { | @@ -57,7 +59,7 @@ public class DeviceConfig { | ||
| 57 | * @return | 59 | * @return |
| 58 | */ | 60 | */ |
| 59 | @GetMapping("/basicParam/{deviceId}") | 61 | @GetMapping("/basicParam/{deviceId}") |
| 60 | - @Operation(summary = "基本配置设置命令") | 62 | + @Operation(summary = "基本配置设置命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 61 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 63 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 62 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 64 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 63 | @Parameter(name = "name", description = "名称") | 65 | @Parameter(name = "name", description = "名称") |
| @@ -113,7 +115,7 @@ public class DeviceConfig { | @@ -113,7 +115,7 @@ public class DeviceConfig { | ||
| 113 | * @param channelId 通道ID | 115 | * @param channelId 通道ID |
| 114 | * @return | 116 | * @return |
| 115 | */ | 117 | */ |
| 116 | - @Operation(summary = "设备配置查询请求") | 118 | + @Operation(summary = "设备配置查询请求", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 117 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 119 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 118 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 120 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 119 | @Parameter(name = "configType", description = "配置类型") | 121 | @Parameter(name = "configType", description = "配置类型") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
| @@ -9,6 +9,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | @@ -9,6 +9,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | ||
| 9 | 9 | ||
| 10 | import com.alibaba.fastjson2.JSONObject; | 10 | import com.alibaba.fastjson2.JSONObject; |
| 11 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 11 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 12 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 12 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 13 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 13 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 14 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 14 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 15 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | @@ -17,6 +18,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 17 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 18 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 18 | import io.swagger.v3.oas.annotations.Operation; | 19 | import io.swagger.v3.oas.annotations.Operation; |
| 19 | import io.swagger.v3.oas.annotations.Parameter; | 20 | import io.swagger.v3.oas.annotations.Parameter; |
| 21 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 20 | import io.swagger.v3.oas.annotations.tags.Tag; | 22 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 21 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
| 22 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
| @@ -53,7 +55,7 @@ public class DeviceControl { | @@ -53,7 +55,7 @@ public class DeviceControl { | ||
| 53 | * | 55 | * |
| 54 | * @param deviceId 设备ID | 56 | * @param deviceId 设备ID |
| 55 | */ | 57 | */ |
| 56 | - @Operation(summary = "远程启动控制命令") | 58 | + @Operation(summary = "远程启动控制命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 57 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 59 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 58 | @GetMapping("/teleboot/{deviceId}") | 60 | @GetMapping("/teleboot/{deviceId}") |
| 59 | public void teleBootApi(@PathVariable String deviceId) { | 61 | public void teleBootApi(@PathVariable String deviceId) { |
| @@ -76,7 +78,7 @@ public class DeviceControl { | @@ -76,7 +78,7 @@ public class DeviceControl { | ||
| 76 | * @param recordCmdStr Record:手动录像,StopRecord:停止手动录像 | 78 | * @param recordCmdStr Record:手动录像,StopRecord:停止手动录像 |
| 77 | * @param channelId 通道编码(可选) | 79 | * @param channelId 通道编码(可选) |
| 78 | */ | 80 | */ |
| 79 | - @Operation(summary = "录像控制") | 81 | + @Operation(summary = "录像控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 80 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 82 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 81 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 83 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 82 | @Parameter(name = "recordCmdStr", description = "命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", required = true) | 84 | @Parameter(name = "recordCmdStr", description = "命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", required = true) |
| @@ -125,7 +127,7 @@ public class DeviceControl { | @@ -125,7 +127,7 @@ public class DeviceControl { | ||
| 125 | * @param deviceId 设备ID | 127 | * @param deviceId 设备ID |
| 126 | * @param guardCmdStr SetGuard:布防,ResetGuard:撤防 | 128 | * @param guardCmdStr SetGuard:布防,ResetGuard:撤防 |
| 127 | */ | 129 | */ |
| 128 | - @Operation(summary = "布防/撤防命令") | 130 | + @Operation(summary = "布防/撤防命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 129 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 131 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 130 | @Parameter(name = "guardCmdStr", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true) | 132 | @Parameter(name = "guardCmdStr", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true) |
| 131 | @GetMapping("/guard/{deviceId}/{guardCmdStr}") | 133 | @GetMapping("/guard/{deviceId}/{guardCmdStr}") |
| @@ -170,7 +172,7 @@ public class DeviceControl { | @@ -170,7 +172,7 @@ public class DeviceControl { | ||
| 170 | * @param alarmMethod 报警方式(可选) | 172 | * @param alarmMethod 报警方式(可选) |
| 171 | * @param alarmType 报警类型(可选) | 173 | * @param alarmType 报警类型(可选) |
| 172 | */ | 174 | */ |
| 173 | - @Operation(summary = "报警复位") | 175 | + @Operation(summary = "报警复位", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 174 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 176 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 175 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 177 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 176 | @Parameter(name = "alarmMethod", description = "报警方式") | 178 | @Parameter(name = "alarmMethod", description = "报警方式") |
| @@ -217,7 +219,7 @@ public class DeviceControl { | @@ -217,7 +219,7 @@ public class DeviceControl { | ||
| 217 | * @param deviceId 设备ID | 219 | * @param deviceId 设备ID |
| 218 | * @param channelId 通道ID | 220 | * @param channelId 通道ID |
| 219 | */ | 221 | */ |
| 220 | - @Operation(summary = "强制关键帧") | 222 | + @Operation(summary = "强制关键帧", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 221 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 223 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 222 | @Parameter(name = "channelId", description = "通道国标编号") | 224 | @Parameter(name = "channelId", description = "通道国标编号") |
| 223 | @GetMapping("/i_frame/{deviceId}") | 225 | @GetMapping("/i_frame/{deviceId}") |
| @@ -249,7 +251,7 @@ public class DeviceControl { | @@ -249,7 +251,7 @@ public class DeviceControl { | ||
| 249 | * @param presetIndex 调用预置位编号(可选) | 251 | * @param presetIndex 调用预置位编号(可选) |
| 250 | * @param channelId 通道编码(可选) | 252 | * @param channelId 通道编码(可选) |
| 251 | */ | 253 | */ |
| 252 | - @Operation(summary = "看守位控制") | 254 | + @Operation(summary = "看守位控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 253 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 255 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 254 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 256 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 255 | @Parameter(name = "enabled", description = "是否开启看守位 1:开启,0:关闭", required = true) | 257 | @Parameter(name = "enabled", description = "是否开启看守位 1:开启,0:关闭", required = true) |
| @@ -309,7 +311,7 @@ public class DeviceControl { | @@ -309,7 +311,7 @@ public class DeviceControl { | ||
| 309 | * @param lengthy 拉框宽度像素值 | 311 | * @param lengthy 拉框宽度像素值 |
| 310 | * @return | 312 | * @return |
| 311 | */ | 313 | */ |
| 312 | - @Operation(summary = "拉框放大") | 314 | + @Operation(summary = "拉框放大", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 313 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 315 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 314 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 316 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 315 | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) | 317 | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) |
| @@ -359,7 +361,7 @@ public class DeviceControl { | @@ -359,7 +361,7 @@ public class DeviceControl { | ||
| 359 | * @param lengthy 拉框宽度像素值 | 361 | * @param lengthy 拉框宽度像素值 |
| 360 | * @return | 362 | * @return |
| 361 | */ | 363 | */ |
| 362 | - @Operation(summary = "拉框放大") | 364 | + @Operation(summary = "拉框缩小", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 363 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 365 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 364 | @Parameter(name = "channelId", description = "通道国标编号") | 366 | @Parameter(name = "channelId", description = "通道国标编号") |
| 365 | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) | 367 | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
| @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.device; | ||
| 3 | import com.alibaba.fastjson2.JSONObject; | 3 | import com.alibaba.fastjson2.JSONObject; |
| 4 | import com.genersoft.iot.vmp.conf.DynamicTask; | 4 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 6 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 7 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 7 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 8 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 8 | import com.genersoft.iot.vmp.gb28181.bean.SyncStatus; | 9 | import com.genersoft.iot.vmp.gb28181.bean.SyncStatus; |
| @@ -23,6 +24,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | @@ -23,6 +24,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | ||
| 23 | import com.github.pagehelper.PageInfo; | 24 | import com.github.pagehelper.PageInfo; |
| 24 | import io.swagger.v3.oas.annotations.Operation; | 25 | import io.swagger.v3.oas.annotations.Operation; |
| 25 | import io.swagger.v3.oas.annotations.Parameter; | 26 | import io.swagger.v3.oas.annotations.Parameter; |
| 27 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 26 | import io.swagger.v3.oas.annotations.tags.Tag; | 28 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 27 | import org.apache.commons.compress.utils.IOUtils; | 29 | import org.apache.commons.compress.utils.IOUtils; |
| 28 | import org.apache.ibatis.annotations.Options; | 30 | import org.apache.ibatis.annotations.Options; |
| @@ -85,7 +87,7 @@ public class DeviceQuery { | @@ -85,7 +87,7 @@ public class DeviceQuery { | ||
| 85 | * @param deviceId 国标ID | 87 | * @param deviceId 国标ID |
| 86 | * @return 国标设备 | 88 | * @return 国标设备 |
| 87 | */ | 89 | */ |
| 88 | - @Operation(summary = "查询国标设备") | 90 | + @Operation(summary = "查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 89 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 91 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 90 | @GetMapping("/devices/{deviceId}") | 92 | @GetMapping("/devices/{deviceId}") |
| 91 | public Device devices(@PathVariable String deviceId){ | 93 | public Device devices(@PathVariable String deviceId){ |
| @@ -99,7 +101,7 @@ public class DeviceQuery { | @@ -99,7 +101,7 @@ public class DeviceQuery { | ||
| 99 | * @param count 每页查询数量 | 101 | * @param count 每页查询数量 |
| 100 | * @return 分页国标列表 | 102 | * @return 分页国标列表 |
| 101 | */ | 103 | */ |
| 102 | - @Operation(summary = "分页查询国标设备") | 104 | + @Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 103 | @Parameter(name = "page", description = "当前页", required = true) | 105 | @Parameter(name = "page", description = "当前页", required = true) |
| 104 | @Parameter(name = "count", description = "每页查询数量", required = true) | 106 | @Parameter(name = "count", description = "每页查询数量", required = true) |
| 105 | @GetMapping("/devices") | 107 | @GetMapping("/devices") |
| @@ -123,7 +125,7 @@ public class DeviceQuery { | @@ -123,7 +125,7 @@ public class DeviceQuery { | ||
| 123 | * @return 通道列表 | 125 | * @return 通道列表 |
| 124 | */ | 126 | */ |
| 125 | @GetMapping("/devices/{deviceId}/channels") | 127 | @GetMapping("/devices/{deviceId}/channels") |
| 126 | - @Operation(summary = "分页查询通道") | 128 | + @Operation(summary = "分页查询通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 127 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 129 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 128 | @Parameter(name = "page", description = "当前页", required = true) | 130 | @Parameter(name = "page", description = "当前页", required = true) |
| 129 | @Parameter(name = "count", description = "每页查询数量", required = true) | 131 | @Parameter(name = "count", description = "每页查询数量", required = true) |
| @@ -149,7 +151,7 @@ public class DeviceQuery { | @@ -149,7 +151,7 @@ public class DeviceQuery { | ||
| 149 | * @param deviceId 设备id | 151 | * @param deviceId 设备id |
| 150 | * @return | 152 | * @return |
| 151 | */ | 153 | */ |
| 152 | - @Operation(summary = "同步设备通道") | 154 | + @Operation(summary = "同步设备通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 153 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 155 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 154 | @GetMapping("/devices/{deviceId}/sync") | 156 | @GetMapping("/devices/{deviceId}/sync") |
| 155 | public WVPResult<SyncStatus> devicesSync(@PathVariable String deviceId){ | 157 | public WVPResult<SyncStatus> devicesSync(@PathVariable String deviceId){ |
| @@ -177,7 +179,7 @@ public class DeviceQuery { | @@ -177,7 +179,7 @@ public class DeviceQuery { | ||
| 177 | * @param deviceId 设备id | 179 | * @param deviceId 设备id |
| 178 | * @return | 180 | * @return |
| 179 | */ | 181 | */ |
| 180 | - @Operation(summary = "移除设备") | 182 | + @Operation(summary = "移除设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 181 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 183 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 182 | @DeleteMapping("/devices/{deviceId}/delete") | 184 | @DeleteMapping("/devices/{deviceId}/delete") |
| 183 | public String delete(@PathVariable String deviceId){ | 185 | public String delete(@PathVariable String deviceId){ |
| @@ -222,7 +224,7 @@ public class DeviceQuery { | @@ -222,7 +224,7 @@ public class DeviceQuery { | ||
| 222 | * @param channelType 通道类型 | 224 | * @param channelType 通道类型 |
| 223 | * @return 子通道列表 | 225 | * @return 子通道列表 |
| 224 | */ | 226 | */ |
| 225 | - @Operation(summary = "分页查询子目录通道") | 227 | + @Operation(summary = "分页查询子目录通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 226 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 228 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 227 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 229 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 228 | @Parameter(name = "page", description = "当前页", required = true) | 230 | @Parameter(name = "page", description = "当前页", required = true) |
| @@ -254,7 +256,7 @@ public class DeviceQuery { | @@ -254,7 +256,7 @@ public class DeviceQuery { | ||
| 254 | * @param channel 通道 | 256 | * @param channel 通道 |
| 255 | * @return | 257 | * @return |
| 256 | */ | 258 | */ |
| 257 | - @Operation(summary = "更新通道信息") | 259 | + @Operation(summary = "更新通道信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 258 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 260 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 259 | @Parameter(name = "channel", description = "通道信息", required = true) | 261 | @Parameter(name = "channel", description = "通道信息", required = true) |
| 260 | @PostMapping("/channel/update/{deviceId}") | 262 | @PostMapping("/channel/update/{deviceId}") |
| @@ -268,7 +270,7 @@ public class DeviceQuery { | @@ -268,7 +270,7 @@ public class DeviceQuery { | ||
| 268 | * @param streamMode 数据流传输模式 | 270 | * @param streamMode 数据流传输模式 |
| 269 | * @return | 271 | * @return |
| 270 | */ | 272 | */ |
| 271 | - @Operation(summary = "修改数据流传输模式") | 273 | + @Operation(summary = "修改数据流传输模式", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 272 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 274 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 273 | @Parameter(name = "streamMode", description = "数据流传输模式, 取值:" + | 275 | @Parameter(name = "streamMode", description = "数据流传输模式, 取值:" + |
| 274 | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", required = true) | 276 | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", required = true) |
| @@ -284,7 +286,7 @@ public class DeviceQuery { | @@ -284,7 +286,7 @@ public class DeviceQuery { | ||
| 284 | * @param device 设备信息 | 286 | * @param device 设备信息 |
| 285 | * @return | 287 | * @return |
| 286 | */ | 288 | */ |
| 287 | - @Operation(summary = "添加设备信息") | 289 | + @Operation(summary = "添加设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 288 | @Parameter(name = "device", description = "设备", required = true) | 290 | @Parameter(name = "device", description = "设备", required = true) |
| 289 | @PostMapping("/device/add/") | 291 | @PostMapping("/device/add/") |
| 290 | public void addDevice(Device device){ | 292 | public void addDevice(Device device){ |
| @@ -306,7 +308,7 @@ public class DeviceQuery { | @@ -306,7 +308,7 @@ public class DeviceQuery { | ||
| 306 | * @param device 设备信息 | 308 | * @param device 设备信息 |
| 307 | * @return | 309 | * @return |
| 308 | */ | 310 | */ |
| 309 | - @Operation(summary = "更新设备信息") | 311 | + @Operation(summary = "更新设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 310 | @Parameter(name = "device", description = "设备", required = true) | 312 | @Parameter(name = "device", description = "设备", required = true) |
| 311 | @PostMapping("/device/update/") | 313 | @PostMapping("/device/update/") |
| 312 | public void updateDevice(Device device){ | 314 | public void updateDevice(Device device){ |
| @@ -321,7 +323,7 @@ public class DeviceQuery { | @@ -321,7 +323,7 @@ public class DeviceQuery { | ||
| 321 | * | 323 | * |
| 322 | * @param deviceId 设备id | 324 | * @param deviceId 设备id |
| 323 | */ | 325 | */ |
| 324 | - @Operation(summary = "设备状态查询") | 326 | + @Operation(summary = "设备状态查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 325 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 327 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 326 | @GetMapping("/devices/{deviceId}/status") | 328 | @GetMapping("/devices/{deviceId}/status") |
| 327 | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { | 329 | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { |
| @@ -372,7 +374,7 @@ public class DeviceQuery { | @@ -372,7 +374,7 @@ public class DeviceQuery { | ||
| 372 | * @param endTime 报警发生终止时间(可选) | 374 | * @param endTime 报警发生终止时间(可选) |
| 373 | * @return true = 命令发送成功 | 375 | * @return true = 命令发送成功 |
| 374 | */ | 376 | */ |
| 375 | - @Operation(summary = "设备状态查询") | 377 | + @Operation(summary = "设备报警查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 376 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 378 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 377 | @Parameter(name = "startPriority", description = "报警起始级别") | 379 | @Parameter(name = "startPriority", description = "报警起始级别") |
| 378 | @Parameter(name = "endPriority", description = "报警终止级别") | 380 | @Parameter(name = "endPriority", description = "报警终止级别") |
| @@ -422,7 +424,7 @@ public class DeviceQuery { | @@ -422,7 +424,7 @@ public class DeviceQuery { | ||
| 422 | 424 | ||
| 423 | 425 | ||
| 424 | @GetMapping("/{deviceId}/sync_status") | 426 | @GetMapping("/{deviceId}/sync_status") |
| 425 | - @Operation(summary = "获取通道同步进度") | 427 | + @Operation(summary = "获取通道同步进度", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 426 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 428 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 427 | public WVPResult<SyncStatus> getSyncStatus(@PathVariable String deviceId) { | 429 | public WVPResult<SyncStatus> getSyncStatus(@PathVariable String deviceId) { |
| 428 | SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId); | 430 | SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId); |
| @@ -442,7 +444,7 @@ public class DeviceQuery { | @@ -442,7 +444,7 @@ public class DeviceQuery { | ||
| 442 | } | 444 | } |
| 443 | 445 | ||
| 444 | @GetMapping("/{deviceId}/subscribe_info") | 446 | @GetMapping("/{deviceId}/subscribe_info") |
| 445 | - @Operation(summary = "获取设备的订阅状态") | 447 | + @Operation(summary = "获取设备的订阅状态", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 446 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 448 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 447 | public WVPResult<Map<String, Integer>> getSubscribeInfo(@PathVariable String deviceId) { | 449 | public WVPResult<Map<String, Integer>> getSubscribeInfo(@PathVariable String deviceId) { |
| 448 | Set<String> allKeys = dynamicTask.getAllKeys(); | 450 | Set<String> allKeys = dynamicTask.getAllKeys(); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
| 1 | package com.genersoft.iot.vmp.vmanager.gb28181.gbStream; | 1 | package com.genersoft.iot.vmp.vmanager.gb28181.gbStream; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 4 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 5 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 5 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 6 | import com.genersoft.iot.vmp.service.IGbStreamService; | 7 | import com.genersoft.iot.vmp.service.IGbStreamService; |
| @@ -11,6 +12,7 @@ import com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean.GbStreamParam; | @@ -11,6 +12,7 @@ import com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean.GbStreamParam; | ||
| 11 | import com.github.pagehelper.PageInfo; | 12 | import com.github.pagehelper.PageInfo; |
| 12 | import io.swagger.v3.oas.annotations.Operation; | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | import io.swagger.v3.oas.annotations.Parameter; | 14 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 14 | import io.swagger.v3.oas.annotations.tags.Tag; | 16 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | import org.slf4j.Logger; | 17 | import org.slf4j.Logger; |
| 16 | import org.slf4j.LoggerFactory; | 18 | import org.slf4j.LoggerFactory; |
| @@ -43,7 +45,7 @@ public class GbStreamController { | @@ -43,7 +45,7 @@ public class GbStreamController { | ||
| 43 | * @param platformId 平台ID | 45 | * @param platformId 平台ID |
| 44 | * @return | 46 | * @return |
| 45 | */ | 47 | */ |
| 46 | - @Operation(summary = "查询国标通道") | 48 | + @Operation(summary = "查询国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 47 | @Parameter(name = "page", description = "当前页", required = true) | 49 | @Parameter(name = "page", description = "当前页", required = true) |
| 48 | @Parameter(name = "count", description = "每页条数", required = true) | 50 | @Parameter(name = "count", description = "每页条数", required = true) |
| 49 | @Parameter(name = "platformId", description = "平台ID", required = true) | 51 | @Parameter(name = "platformId", description = "平台ID", required = true) |
| @@ -79,7 +81,7 @@ public class GbStreamController { | @@ -79,7 +81,7 @@ public class GbStreamController { | ||
| 79 | * @param gbStreamParam | 81 | * @param gbStreamParam |
| 80 | * @return | 82 | * @return |
| 81 | */ | 83 | */ |
| 82 | - @Operation(summary = "移除国标关联") | 84 | + @Operation(summary = "移除国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 83 | @DeleteMapping(value = "/del") | 85 | @DeleteMapping(value = "/del") |
| 84 | @ResponseBody | 86 | @ResponseBody |
| 85 | public void del(@RequestBody GbStreamParam gbStreamParam){ | 87 | public void del(@RequestBody GbStreamParam gbStreamParam){ |
| @@ -99,7 +101,7 @@ public class GbStreamController { | @@ -99,7 +101,7 @@ public class GbStreamController { | ||
| 99 | * @param gbStreamParam | 101 | * @param gbStreamParam |
| 100 | * @return | 102 | * @return |
| 101 | */ | 103 | */ |
| 102 | - @Operation(summary = "保存国标关联") | 104 | + @Operation(summary = "保存国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 103 | @PostMapping(value = "/add") | 105 | @PostMapping(value = "/add") |
| 104 | @ResponseBody | 106 | @ResponseBody |
| 105 | public void add(@RequestBody GbStreamParam gbStreamParam){ | 107 | public void add(@RequestBody GbStreamParam gbStreamParam){ |
| @@ -118,7 +120,7 @@ public class GbStreamController { | @@ -118,7 +120,7 @@ public class GbStreamController { | ||
| 118 | * @param gbId | 120 | * @param gbId |
| 119 | * @return | 121 | * @return |
| 120 | */ | 122 | */ |
| 121 | - @Operation(summary = "保存国标关联") | 123 | + @Operation(summary = "保存国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 122 | @GetMapping(value = "/addWithGbid") | 124 | @GetMapping(value = "/addWithGbid") |
| 123 | @ResponseBody | 125 | @ResponseBody |
| 124 | public void add(String gbId, String platformGbId, @RequestParam(required = false) String catalogGbId){ | 126 | public void add(String gbId, String platformGbId, @RequestParam(required = false) String catalogGbId){ |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.media; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.media; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 5 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 5 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; | 6 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| 6 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; | 7 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; | 8 | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; |
| @@ -12,6 +13,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -12,6 +13,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 12 | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | 13 | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| 13 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | import io.swagger.v3.oas.annotations.Parameter; | 15 | import io.swagger.v3.oas.annotations.Parameter; |
| 16 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 15 | import io.swagger.v3.oas.annotations.tags.Tag; | 17 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 16 | import org.slf4j.Logger; | 18 | import org.slf4j.Logger; |
| 17 | import org.slf4j.LoggerFactory; | 19 | import org.slf4j.LoggerFactory; |
| @@ -45,7 +47,7 @@ public class MediaController { | @@ -45,7 +47,7 @@ public class MediaController { | ||
| 45 | * @param stream 流id | 47 | * @param stream 流id |
| 46 | * @return | 48 | * @return |
| 47 | */ | 49 | */ |
| 48 | - @Operation(summary = "根据应用名和流id获取播放地址") | 50 | + @Operation(summary = "根据应用名和流id获取播放地址", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 49 | @Parameter(name = "app", description = "应用名", required = true) | 51 | @Parameter(name = "app", description = "应用名", required = true) |
| 50 | @Parameter(name = "stream", description = "流id", required = true) | 52 | @Parameter(name = "stream", description = "流id", required = true) |
| 51 | @Parameter(name = "mediaServerId", description = "媒体服务器id") | 53 | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | ||
| 6 | import com.genersoft.iot.vmp.conf.DynamicTask; | 6 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 7 | import com.genersoft.iot.vmp.conf.UserSetting; | 7 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 8 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 8 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 9 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 9 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 10 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 10 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; | 11 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; |
| 11 | import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; | 12 | import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; |
| @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam; | @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam; | ||
| 21 | import com.github.pagehelper.PageInfo; | 22 | import com.github.pagehelper.PageInfo; |
| 22 | import io.swagger.v3.oas.annotations.Operation; | 23 | import io.swagger.v3.oas.annotations.Operation; |
| 23 | import io.swagger.v3.oas.annotations.Parameter; | 24 | import io.swagger.v3.oas.annotations.Parameter; |
| 25 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 24 | import io.swagger.v3.oas.annotations.tags.Tag; | 26 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 25 | import org.slf4j.Logger; | 27 | import org.slf4j.Logger; |
| 26 | import org.slf4j.LoggerFactory; | 28 | import org.slf4j.LoggerFactory; |
| @@ -83,7 +85,7 @@ public class PlatformController { | @@ -83,7 +85,7 @@ public class PlatformController { | ||
| 83 | * | 85 | * |
| 84 | * @return | 86 | * @return |
| 85 | */ | 87 | */ |
| 86 | - @Operation(summary = "获取国标服务的配置") | 88 | + @Operation(summary = "获取国标服务的配置", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 87 | @GetMapping("/server_config") | 89 | @GetMapping("/server_config") |
| 88 | public JSONObject serverConfig() { | 90 | public JSONObject serverConfig() { |
| 89 | JSONObject result = new JSONObject(); | 91 | JSONObject result = new JSONObject(); |
| @@ -99,7 +101,7 @@ public class PlatformController { | @@ -99,7 +101,7 @@ public class PlatformController { | ||
| 99 | * | 101 | * |
| 100 | * @return | 102 | * @return |
| 101 | */ | 103 | */ |
| 102 | - @Operation(summary = "获取级联服务器信息") | 104 | + @Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 103 | @Parameter(name = "id", description = "平台国标编号", required = true) | 105 | @Parameter(name = "id", description = "平台国标编号", required = true) |
| 104 | @GetMapping("/info/{id}") | 106 | @GetMapping("/info/{id}") |
| 105 | public ParentPlatform getPlatform(@PathVariable String id) { | 107 | public ParentPlatform getPlatform(@PathVariable String id) { |
| @@ -119,7 +121,7 @@ public class PlatformController { | @@ -119,7 +121,7 @@ public class PlatformController { | ||
| 119 | * @return | 121 | * @return |
| 120 | */ | 122 | */ |
| 121 | @GetMapping("/query/{count}/{page}") | 123 | @GetMapping("/query/{count}/{page}") |
| 122 | - @Operation(summary = "分页查询级联平台") | 124 | + @Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 123 | @Parameter(name = "page", description = "当前页", required = true) | 125 | @Parameter(name = "page", description = "当前页", required = true) |
| 124 | @Parameter(name = "count", description = "每页条数", required = true) | 126 | @Parameter(name = "count", description = "每页条数", required = true) |
| 125 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) { | 127 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) { |
| @@ -140,7 +142,7 @@ public class PlatformController { | @@ -140,7 +142,7 @@ public class PlatformController { | ||
| 140 | * @param parentPlatform | 142 | * @param parentPlatform |
| 141 | * @return | 143 | * @return |
| 142 | */ | 144 | */ |
| 143 | - @Operation(summary = "添加上级平台信息") | 145 | + @Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 144 | @PostMapping("/add") | 146 | @PostMapping("/add") |
| 145 | @ResponseBody | 147 | @ResponseBody |
| 146 | public void addPlatform(@RequestBody ParentPlatform parentPlatform) { | 148 | public void addPlatform(@RequestBody ParentPlatform parentPlatform) { |
| @@ -185,7 +187,7 @@ public class PlatformController { | @@ -185,7 +187,7 @@ public class PlatformController { | ||
| 185 | * @param parentPlatform | 187 | * @param parentPlatform |
| 186 | * @return | 188 | * @return |
| 187 | */ | 189 | */ |
| 188 | - @Operation(summary = "保存上级平台信息") | 190 | + @Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 189 | @PostMapping("/save") | 191 | @PostMapping("/save") |
| 190 | @ResponseBody | 192 | @ResponseBody |
| 191 | public void savePlatform(@RequestBody ParentPlatform parentPlatform) { | 193 | public void savePlatform(@RequestBody ParentPlatform parentPlatform) { |
| @@ -216,7 +218,7 @@ public class PlatformController { | @@ -216,7 +218,7 @@ public class PlatformController { | ||
| 216 | * @param serverGBId 上级平台国标ID | 218 | * @param serverGBId 上级平台国标ID |
| 217 | * @return | 219 | * @return |
| 218 | */ | 220 | */ |
| 219 | - @Operation(summary = "删除上级平台") | 221 | + @Operation(summary = "删除上级平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 220 | @Parameter(name = "serverGBId", description = "上级平台的国标编号") | 222 | @Parameter(name = "serverGBId", description = "上级平台的国标编号") |
| 221 | @DeleteMapping("/delete/{serverGBId}") | 223 | @DeleteMapping("/delete/{serverGBId}") |
| 222 | @ResponseBody | 224 | @ResponseBody |
| @@ -273,7 +275,7 @@ public class PlatformController { | @@ -273,7 +275,7 @@ public class PlatformController { | ||
| 273 | * @param serverGBId 上级平台国标ID | 275 | * @param serverGBId 上级平台国标ID |
| 274 | * @return | 276 | * @return |
| 275 | */ | 277 | */ |
| 276 | - @Operation(summary = "查询上级平台是否存在") | 278 | + @Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 277 | @Parameter(name = "serverGBId", description = "上级平台的国标编号") | 279 | @Parameter(name = "serverGBId", description = "上级平台的国标编号") |
| 278 | @GetMapping("/exit/{serverGBId}") | 280 | @GetMapping("/exit/{serverGBId}") |
| 279 | @ResponseBody | 281 | @ResponseBody |
| @@ -294,7 +296,7 @@ public class PlatformController { | @@ -294,7 +296,7 @@ public class PlatformController { | ||
| 294 | * @param channelType 通道类型 | 296 | * @param channelType 通道类型 |
| 295 | * @return | 297 | * @return |
| 296 | */ | 298 | */ |
| 297 | - @Operation(summary = "查询上级平台是否存在") | 299 | + @Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 298 | @Parameter(name = "page", description = "当前页", required = true) | 300 | @Parameter(name = "page", description = "当前页", required = true) |
| 299 | @Parameter(name = "count", description = "每页条数", required = true) | 301 | @Parameter(name = "count", description = "每页条数", required = true) |
| 300 | @Parameter(name = "platformId", description = "上级平台的国标编号") | 302 | @Parameter(name = "platformId", description = "上级平台的国标编号") |
| @@ -331,7 +333,7 @@ public class PlatformController { | @@ -331,7 +333,7 @@ public class PlatformController { | ||
| 331 | * @param param 通道关联参数 | 333 | * @param param 通道关联参数 |
| 332 | * @return | 334 | * @return |
| 333 | */ | 335 | */ |
| 334 | - @Operation(summary = "向上级平台添加国标通道") | 336 | + @Operation(summary = "向上级平台添加国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 335 | @PostMapping("/update_channel_for_gb") | 337 | @PostMapping("/update_channel_for_gb") |
| 336 | @ResponseBody | 338 | @ResponseBody |
| 337 | public void updateChannelForGB(@RequestBody UpdateChannelParam param) { | 339 | public void updateChannelForGB(@RequestBody UpdateChannelParam param) { |
| @@ -360,7 +362,7 @@ public class PlatformController { | @@ -360,7 +362,7 @@ public class PlatformController { | ||
| 360 | * @param param 通道关联参数 | 362 | * @param param 通道关联参数 |
| 361 | * @return | 363 | * @return |
| 362 | */ | 364 | */ |
| 363 | - @Operation(summary = "从上级平台移除国标通道") | 365 | + @Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 364 | @DeleteMapping("/del_channel_for_gb") | 366 | @DeleteMapping("/del_channel_for_gb") |
| 365 | @ResponseBody | 367 | @ResponseBody |
| 366 | public void delChannelForGB(@RequestBody UpdateChannelParam param) { | 368 | public void delChannelForGB(@RequestBody UpdateChannelParam param) { |
| @@ -389,7 +391,7 @@ public class PlatformController { | @@ -389,7 +391,7 @@ public class PlatformController { | ||
| 389 | * @param parentId 目录父ID | 391 | * @param parentId 目录父ID |
| 390 | * @return | 392 | * @return |
| 391 | */ | 393 | */ |
| 392 | - @Operation(summary = "获取目录") | 394 | + @Operation(summary = "获取目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 393 | @Parameter(name = "platformId", description = "上级平台的国标编号", required = true) | 395 | @Parameter(name = "platformId", description = "上级平台的国标编号", required = true) |
| 394 | @Parameter(name = "parentId", description = "父级目录的国标编号", required = true) | 396 | @Parameter(name = "parentId", description = "父级目录的国标编号", required = true) |
| 395 | @GetMapping("/catalog") | 397 | @GetMapping("/catalog") |
| @@ -420,7 +422,7 @@ public class PlatformController { | @@ -420,7 +422,7 @@ public class PlatformController { | ||
| 420 | * @param platformCatalog 目录 | 422 | * @param platformCatalog 目录 |
| 421 | * @return | 423 | * @return |
| 422 | */ | 424 | */ |
| 423 | - @Operation(summary = "添加目录") | 425 | + @Operation(summary = "添加目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 424 | @PostMapping("/catalog/add") | 426 | @PostMapping("/catalog/add") |
| 425 | @ResponseBody | 427 | @ResponseBody |
| 426 | public void addCatalog(@RequestBody PlatformCatalog platformCatalog) { | 428 | public void addCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| @@ -445,7 +447,7 @@ public class PlatformController { | @@ -445,7 +447,7 @@ public class PlatformController { | ||
| 445 | * @param platformCatalog 目录 | 447 | * @param platformCatalog 目录 |
| 446 | * @return | 448 | * @return |
| 447 | */ | 449 | */ |
| 448 | - @Operation(summary = "编辑目录") | 450 | + @Operation(summary = "编辑目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 449 | @PostMapping("/catalog/edit") | 451 | @PostMapping("/catalog/edit") |
| 450 | @ResponseBody | 452 | @ResponseBody |
| 451 | public void editCatalog(@RequestBody PlatformCatalog platformCatalog) { | 453 | public void editCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| @@ -471,7 +473,7 @@ public class PlatformController { | @@ -471,7 +473,7 @@ public class PlatformController { | ||
| 471 | * @param platformId 平台Id | 473 | * @param platformId 平台Id |
| 472 | * @return | 474 | * @return |
| 473 | */ | 475 | */ |
| 474 | - @Operation(summary = "删除目录") | 476 | + @Operation(summary = "删除目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 475 | @Parameter(name = "id", description = "目录Id", required = true) | 477 | @Parameter(name = "id", description = "目录Id", required = true) |
| 476 | @Parameter(name = "platformId", description = "平台Id", required = true) | 478 | @Parameter(name = "platformId", description = "平台Id", required = true) |
| 477 | @DeleteMapping("/catalog/del") | 479 | @DeleteMapping("/catalog/del") |
| @@ -506,7 +508,7 @@ public class PlatformController { | @@ -506,7 +508,7 @@ public class PlatformController { | ||
| 506 | * @param platformCatalog 关联的信息 | 508 | * @param platformCatalog 关联的信息 |
| 507 | * @return | 509 | * @return |
| 508 | */ | 510 | */ |
| 509 | - @Operation(summary = "删除关联") | 511 | + @Operation(summary = "删除关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 510 | @DeleteMapping("/catalog/relation/del") | 512 | @DeleteMapping("/catalog/relation/del") |
| 511 | @ResponseBody | 513 | @ResponseBody |
| 512 | public void delRelation(@RequestBody PlatformCatalog platformCatalog) { | 514 | public void delRelation(@RequestBody PlatformCatalog platformCatalog) { |
| @@ -529,7 +531,7 @@ public class PlatformController { | @@ -529,7 +531,7 @@ public class PlatformController { | ||
| 529 | * @param catalogId 目录Id | 531 | * @param catalogId 目录Id |
| 530 | * @return | 532 | * @return |
| 531 | */ | 533 | */ |
| 532 | - @Operation(summary = "修改默认目录") | 534 | + @Operation(summary = "修改默认目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 533 | @Parameter(name = "catalogId", description = "目录Id", required = true) | 535 | @Parameter(name = "catalogId", description = "目录Id", required = true) |
| 534 | @Parameter(name = "platformId", description = "平台Id", required = true) | 536 | @Parameter(name = "platformId", description = "平台Id", required = true) |
| 535 | @PostMapping("/catalog/default/update") | 537 | @PostMapping("/catalog/default/update") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| @@ -9,6 +9,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | @@ -9,6 +9,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 9 | import com.genersoft.iot.vmp.conf.UserSetting; | 9 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 10 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 10 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 11 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | 11 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 12 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 12 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 13 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 13 | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; | 14 | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; |
| 14 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 15 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| @@ -30,6 +31,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | @@ -30,6 +31,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 30 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 31 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 31 | import io.swagger.v3.oas.annotations.Operation; | 32 | import io.swagger.v3.oas.annotations.Operation; |
| 32 | import io.swagger.v3.oas.annotations.Parameter; | 33 | import io.swagger.v3.oas.annotations.Parameter; |
| 34 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 33 | import io.swagger.v3.oas.annotations.tags.Tag; | 35 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 34 | import org.slf4j.Logger; | 36 | import org.slf4j.Logger; |
| 35 | import org.slf4j.LoggerFactory; | 37 | import org.slf4j.LoggerFactory; |
| @@ -87,7 +89,7 @@ public class PlayController { | @@ -87,7 +89,7 @@ public class PlayController { | ||
| 87 | @Autowired | 89 | @Autowired |
| 88 | private UserSetting userSetting; | 90 | private UserSetting userSetting; |
| 89 | 91 | ||
| 90 | - @Operation(summary = "开始点播") | 92 | + @Operation(summary = "开始点播", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 91 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 93 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 92 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 94 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 93 | @GetMapping("/start/{deviceId}/{channelId}") | 95 | @GetMapping("/start/{deviceId}/{channelId}") |
| @@ -152,7 +154,7 @@ public class PlayController { | @@ -152,7 +154,7 @@ public class PlayController { | ||
| 152 | return result; | 154 | return result; |
| 153 | } | 155 | } |
| 154 | 156 | ||
| 155 | - @Operation(summary = "停止点播") | 157 | + @Operation(summary = "停止点播", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 156 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 158 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 157 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 159 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 158 | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) | 160 | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) |
| @@ -197,7 +199,7 @@ public class PlayController { | @@ -197,7 +199,7 @@ public class PlayController { | ||
| 197 | * 将不是h264的视频通过ffmpeg 转码为h264 + aac | 199 | * 将不是h264的视频通过ffmpeg 转码为h264 + aac |
| 198 | * @param streamId 流ID | 200 | * @param streamId 流ID |
| 199 | */ | 201 | */ |
| 200 | - @Operation(summary = "将不是h264的视频通过ffmpeg 转码为h264 + aac") | 202 | + @Operation(summary = "将不是h264的视频通过ffmpeg 转码为h264 + aac", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 201 | @Parameter(name = "streamId", description = "视频流ID", required = true) | 203 | @Parameter(name = "streamId", description = "视频流ID", required = true) |
| 202 | @PostMapping("/convert/{streamId}") | 204 | @PostMapping("/convert/{streamId}") |
| 203 | public JSONObject playConvert(@PathVariable String streamId) { | 205 | public JSONObject playConvert(@PathVariable String streamId) { |
| @@ -239,7 +241,7 @@ public class PlayController { | @@ -239,7 +241,7 @@ public class PlayController { | ||
| 239 | /** | 241 | /** |
| 240 | * 结束转码 | 242 | * 结束转码 |
| 241 | */ | 243 | */ |
| 242 | - @Operation(summary = "结束转码") | 244 | + @Operation(summary = "结束转码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 243 | @Parameter(name = "key", description = "视频流key", required = true) | 245 | @Parameter(name = "key", description = "视频流key", required = true) |
| 244 | @Parameter(name = "mediaServerId", description = "流媒体服务ID", required = true) | 246 | @Parameter(name = "mediaServerId", description = "流媒体服务ID", required = true) |
| 245 | @PostMapping("/convertStop/{key}") | 247 | @PostMapping("/convertStop/{key}") |
| @@ -264,7 +266,7 @@ public class PlayController { | @@ -264,7 +266,7 @@ public class PlayController { | ||
| 264 | } | 266 | } |
| 265 | } | 267 | } |
| 266 | 268 | ||
| 267 | - @Operation(summary = "语音广播命令") | 269 | + @Operation(summary = "语音广播命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 268 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 270 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 269 | @GetMapping("/broadcast/{deviceId}") | 271 | @GetMapping("/broadcast/{deviceId}") |
| 270 | @PostMapping("/broadcast/{deviceId}") | 272 | @PostMapping("/broadcast/{deviceId}") |
| @@ -330,7 +332,7 @@ public class PlayController { | @@ -330,7 +332,7 @@ public class PlayController { | ||
| 330 | return result; | 332 | return result; |
| 331 | } | 333 | } |
| 332 | 334 | ||
| 333 | - @Operation(summary = "获取所有的ssrc") | 335 | + @Operation(summary = "获取所有的ssrc", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 334 | @GetMapping("/ssrc") | 336 | @GetMapping("/ssrc") |
| 335 | public JSONObject getSSRC() { | 337 | public JSONObject getSSRC() { |
| 336 | if (logger.isDebugEnabled()) { | 338 | if (logger.isDebugEnabled()) { |
| @@ -353,7 +355,7 @@ public class PlayController { | @@ -353,7 +355,7 @@ public class PlayController { | ||
| 353 | return jsonObject; | 355 | return jsonObject; |
| 354 | } | 356 | } |
| 355 | 357 | ||
| 356 | - @Operation(summary = "获取截图") | 358 | + @Operation(summary = "获取截图", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 357 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 359 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 358 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 360 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 359 | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) | 361 | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
| @@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; | @@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 8 | import com.genersoft.iot.vmp.conf.exception.ServiceException; | 8 | import com.genersoft.iot.vmp.conf.exception.ServiceException; |
| 9 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | 9 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 10 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 10 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 11 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 12 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 12 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 13 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| @@ -20,6 +21,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | @@ -20,6 +21,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 20 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 21 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 21 | import io.swagger.v3.oas.annotations.Operation; | 22 | import io.swagger.v3.oas.annotations.Operation; |
| 22 | import io.swagger.v3.oas.annotations.Parameter; | 23 | import io.swagger.v3.oas.annotations.Parameter; |
| 24 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 23 | import io.swagger.v3.oas.annotations.tags.Tag; | 25 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 24 | import org.slf4j.Logger; | 26 | import org.slf4j.Logger; |
| 25 | import org.slf4j.LoggerFactory; | 27 | import org.slf4j.LoggerFactory; |
| @@ -68,7 +70,7 @@ public class PlaybackController { | @@ -68,7 +70,7 @@ public class PlaybackController { | ||
| 68 | @Autowired | 70 | @Autowired |
| 69 | private UserSetting userSetting; | 71 | private UserSetting userSetting; |
| 70 | 72 | ||
| 71 | - @Operation(summary = "开始视频回放") | 73 | + @Operation(summary = "开始视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 72 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 74 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 73 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 75 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 74 | @Parameter(name = "startTime", description = "开始时间", required = true) | 76 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| @@ -125,7 +127,7 @@ public class PlaybackController { | @@ -125,7 +127,7 @@ public class PlaybackController { | ||
| 125 | } | 127 | } |
| 126 | 128 | ||
| 127 | 129 | ||
| 128 | - @Operation(summary = "停止视频回放") | 130 | + @Operation(summary = "停止视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 129 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 131 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 130 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 132 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 131 | @Parameter(name = "stream", description = "流ID", required = true) | 133 | @Parameter(name = "stream", description = "流ID", required = true) |
| @@ -149,7 +151,7 @@ public class PlaybackController { | @@ -149,7 +151,7 @@ public class PlaybackController { | ||
| 149 | } | 151 | } |
| 150 | 152 | ||
| 151 | 153 | ||
| 152 | - @Operation(summary = "回放暂停") | 154 | + @Operation(summary = "回放暂停", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 153 | @Parameter(name = "streamId", description = "回放流ID", required = true) | 155 | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| 154 | @GetMapping("/pause/{streamId}") | 156 | @GetMapping("/pause/{streamId}") |
| 155 | public void playPause(@PathVariable String streamId) { | 157 | public void playPause(@PathVariable String streamId) { |
| @@ -165,7 +167,7 @@ public class PlaybackController { | @@ -165,7 +167,7 @@ public class PlaybackController { | ||
| 165 | } | 167 | } |
| 166 | 168 | ||
| 167 | 169 | ||
| 168 | - @Operation(summary = "回放恢复") | 170 | + @Operation(summary = "回放恢复", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 169 | @Parameter(name = "streamId", description = "回放流ID", required = true) | 171 | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| 170 | @GetMapping("/resume/{streamId}") | 172 | @GetMapping("/resume/{streamId}") |
| 171 | public void playResume(@PathVariable String streamId) { | 173 | public void playResume(@PathVariable String streamId) { |
| @@ -180,7 +182,7 @@ public class PlaybackController { | @@ -180,7 +182,7 @@ public class PlaybackController { | ||
| 180 | } | 182 | } |
| 181 | 183 | ||
| 182 | 184 | ||
| 183 | - @Operation(summary = "回放拖动播放") | 185 | + @Operation(summary = "回放拖动播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 184 | @Parameter(name = "streamId", description = "回放流ID", required = true) | 186 | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| 185 | @Parameter(name = "seekTime", description = "拖动偏移量,单位s", required = true) | 187 | @Parameter(name = "seekTime", description = "拖动偏移量,单位s", required = true) |
| 186 | @GetMapping("/seek/{streamId}/{seekTime}") | 188 | @GetMapping("/seek/{streamId}/{seekTime}") |
| @@ -200,7 +202,7 @@ public class PlaybackController { | @@ -200,7 +202,7 @@ public class PlaybackController { | ||
| 200 | } | 202 | } |
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | - @Operation(summary = "回放倍速播放") | 205 | + @Operation(summary = "回放倍速播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 204 | @Parameter(name = "streamId", description = "回放流ID", required = true) | 206 | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| 205 | @Parameter(name = "speed", description = "倍速0.25 0.5 1、2、4", required = true) | 207 | @Parameter(name = "speed", description = "倍速0.25 0.5 1、2、4", required = true) |
| 206 | @GetMapping("/speed/{streamId}/{speed}") | 208 | @GetMapping("/speed/{streamId}/{speed}") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 5 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 6 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 8 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| @@ -10,6 +11,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | @@ -10,6 +11,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 10 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 11 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 11 | import io.swagger.v3.oas.annotations.Operation; | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | import io.swagger.v3.oas.annotations.Parameter; | 13 | import io.swagger.v3.oas.annotations.Parameter; |
| 14 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 13 | import io.swagger.v3.oas.annotations.tags.Tag; | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 14 | import org.slf4j.Logger; | 16 | import org.slf4j.Logger; |
| 15 | import org.slf4j.LoggerFactory; | 17 | import org.slf4j.LoggerFactory; |
| @@ -50,7 +52,7 @@ public class PtzController { | @@ -50,7 +52,7 @@ public class PtzController { | ||
| 50 | * @param zoomSpeed 缩放速度 | 52 | * @param zoomSpeed 缩放速度 |
| 51 | */ | 53 | */ |
| 52 | 54 | ||
| 53 | - @Operation(summary = "云台控制") | 55 | + @Operation(summary = "云台控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 54 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 56 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 55 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 57 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 56 | @Parameter(name = "command", description = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true) | 58 | @Parameter(name = "command", description = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true) |
| @@ -113,7 +115,7 @@ public class PtzController { | @@ -113,7 +115,7 @@ public class PtzController { | ||
| 113 | } | 115 | } |
| 114 | 116 | ||
| 115 | 117 | ||
| 116 | - @Operation(summary = "通用前端控制命令") | 118 | + @Operation(summary = "通用前端控制命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 117 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 119 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 118 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 120 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 119 | @Parameter(name = "cmdCode", description = "指令码", required = true) | 121 | @Parameter(name = "cmdCode", description = "指令码", required = true) |
| @@ -137,7 +139,7 @@ public class PtzController { | @@ -137,7 +139,7 @@ public class PtzController { | ||
| 137 | } | 139 | } |
| 138 | 140 | ||
| 139 | 141 | ||
| 140 | - @Operation(summary = "预置位查询") | 142 | + @Operation(summary = "预置位查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 141 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 143 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 142 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 144 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 143 | @GetMapping("/preset/query/{deviceId}/{channelId}") | 145 | @GetMapping("/preset/query/{deviceId}/{channelId}") |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/GBRecordController.java
| @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 4 | import com.genersoft.iot.vmp.conf.UserSetting; | 4 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 6 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | 6 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 7 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 7 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 8 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 8 | import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; | 9 | import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; |
| 9 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 10 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 19 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 20 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 20 | import io.swagger.v3.oas.annotations.Operation; | 21 | import io.swagger.v3.oas.annotations.Operation; |
| 21 | import io.swagger.v3.oas.annotations.Parameter; | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 23 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 22 | import io.swagger.v3.oas.annotations.tags.Tag; | 24 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 23 | import org.slf4j.Logger; | 25 | import org.slf4j.Logger; |
| 24 | import org.slf4j.LoggerFactory; | 26 | import org.slf4j.LoggerFactory; |
| @@ -61,7 +63,7 @@ public class GBRecordController { | @@ -61,7 +63,7 @@ public class GBRecordController { | ||
| 61 | @Autowired | 63 | @Autowired |
| 62 | private UserSetting userSetting; | 64 | private UserSetting userSetting; |
| 63 | 65 | ||
| 64 | - @Operation(summary = "录像查询") | 66 | + @Operation(summary = "录像查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 65 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 67 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 66 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 68 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 67 | @Parameter(name = "startTime", description = "开始时间", required = true) | 69 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| @@ -115,7 +117,7 @@ public class GBRecordController { | @@ -115,7 +117,7 @@ public class GBRecordController { | ||
| 115 | } | 117 | } |
| 116 | 118 | ||
| 117 | 119 | ||
| 118 | - @Operation(summary = "开始历史媒体下载") | 120 | + @Operation(summary = "开始历史媒体下载", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 119 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 121 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 120 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 122 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 121 | @Parameter(name = "startTime", description = "开始时间", required = true) | 123 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| @@ -164,7 +166,7 @@ public class GBRecordController { | @@ -164,7 +166,7 @@ public class GBRecordController { | ||
| 164 | return result; | 166 | return result; |
| 165 | } | 167 | } |
| 166 | 168 | ||
| 167 | - @Operation(summary = "停止历史媒体下载") | 169 | + @Operation(summary = "停止历史媒体下载", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 168 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 170 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 169 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 171 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 170 | @Parameter(name = "stream", description = "流ID", required = true) | 172 | @Parameter(name = "stream", description = "流ID", required = true) |
| @@ -192,7 +194,7 @@ public class GBRecordController { | @@ -192,7 +194,7 @@ public class GBRecordController { | ||
| 192 | } | 194 | } |
| 193 | } | 195 | } |
| 194 | 196 | ||
| 195 | - @Operation(summary = "获取历史媒体下载进度") | 197 | + @Operation(summary = "获取历史媒体下载进度", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 196 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 198 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 197 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 199 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 198 | @Parameter(name = "stream", description = "流ID", required = true) | 200 | @Parameter(name = "stream", description = "流ID", required = true) |
src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.log; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.vmanager.log; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.UserSetting; | 3 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 5 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 5 | import com.genersoft.iot.vmp.service.ILogService; | 6 | import com.genersoft.iot.vmp.service.ILogService; |
| 6 | import com.genersoft.iot.vmp.storager.dao.dto.LogDto; | 7 | import com.genersoft.iot.vmp.storager.dao.dto.LogDto; |
| 7 | import com.genersoft.iot.vmp.utils.DateUtil; | 8 | import com.genersoft.iot.vmp.utils.DateUtil; |
| @@ -9,6 +10,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -9,6 +10,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 9 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 10 | import io.swagger.v3.oas.annotations.Operation; | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 11 | import io.swagger.v3.oas.annotations.Parameter; | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 13 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 12 | import io.swagger.v3.oas.annotations.tags.Tag; | 14 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 14 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| @@ -42,7 +44,7 @@ public class LogController { | @@ -42,7 +44,7 @@ public class LogController { | ||
| 42 | * @return | 44 | * @return |
| 43 | */ | 45 | */ |
| 44 | @GetMapping("/all") | 46 | @GetMapping("/all") |
| 45 | - @Operation(summary = "分页查询日志") | 47 | + @Operation(summary = "分页查询日志", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 46 | @Parameter(name = "query", description = "查询内容", required = true) | 48 | @Parameter(name = "query", description = "查询内容", required = true) |
| 47 | @Parameter(name = "page", description = "当前页", required = true) | 49 | @Parameter(name = "page", description = "当前页", required = true) |
| 48 | @Parameter(name = "count", description = "每页查询数量", required = true) | 50 | @Parameter(name = "count", description = "每页查询数量", required = true) |
| @@ -84,7 +86,7 @@ public class LogController { | @@ -84,7 +86,7 @@ public class LogController { | ||
| 84 | * 清空日志 | 86 | * 清空日志 |
| 85 | * | 87 | * |
| 86 | */ | 88 | */ |
| 87 | - @Operation(summary = "清空日志") | 89 | + @Operation(summary = "清空日志", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 88 | @DeleteMapping("/clear") | 90 | @DeleteMapping("/clear") |
| 89 | public void clear() { | 91 | public void clear() { |
| 90 | logService.clear(); | 92 | logService.clear(); |
src/main/java/com/genersoft/iot/vmp/vmanager/ps/PsController.java
| @@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | @@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | ||
| 5 | import com.genersoft.iot.vmp.conf.DynamicTask; | 5 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 6 | import com.genersoft.iot.vmp.conf.UserSetting; | 6 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 8 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 8 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; | 9 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| 9 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 10 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 11 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 19 | import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo; | 20 | import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo; |
| 20 | import io.swagger.v3.oas.annotations.Operation; | 21 | import io.swagger.v3.oas.annotations.Operation; |
| 21 | import io.swagger.v3.oas.annotations.Parameter; | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 23 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 22 | import io.swagger.v3.oas.annotations.tags.Tag; | 24 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 23 | import okhttp3.OkHttpClient; | 25 | import okhttp3.OkHttpClient; |
| 24 | import okhttp3.Request; | 26 | import okhttp3.Request; |
| @@ -69,7 +71,7 @@ public class PsController { | @@ -69,7 +71,7 @@ public class PsController { | ||
| 69 | 71 | ||
| 70 | @GetMapping(value = "/receive/open") | 72 | @GetMapping(value = "/receive/open") |
| 71 | @ResponseBody | 73 | @ResponseBody |
| 72 | - @Operation(summary = "开启收流和获取发流信息") | 74 | + @Operation(summary = "开启收流和获取发流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 73 | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) | 75 | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) |
| 74 | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) | 76 | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) |
| 75 | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) | 77 | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) |
| @@ -152,7 +154,7 @@ public class PsController { | @@ -152,7 +154,7 @@ public class PsController { | ||
| 152 | 154 | ||
| 153 | @GetMapping(value = "/receive/close") | 155 | @GetMapping(value = "/receive/close") |
| 154 | @ResponseBody | 156 | @ResponseBody |
| 155 | - @Operation(summary = "关闭收流") | 157 | + @Operation(summary = "关闭收流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 156 | @Parameter(name = "stream", description = "流的ID", required = true) | 158 | @Parameter(name = "stream", description = "流的ID", required = true) |
| 157 | public void closeRtpServer(String stream) { | 159 | public void closeRtpServer(String stream) { |
| 158 | logger.info("[第三方PS服务对接->关闭收流] stream->{}", stream); | 160 | logger.info("[第三方PS服务对接->关闭收流] stream->{}", stream); |
| @@ -170,7 +172,7 @@ public class PsController { | @@ -170,7 +172,7 @@ public class PsController { | ||
| 170 | 172 | ||
| 171 | @GetMapping(value = "/send/start") | 173 | @GetMapping(value = "/send/start") |
| 172 | @ResponseBody | 174 | @ResponseBody |
| 173 | - @Operation(summary = "发送流") | 175 | + @Operation(summary = "发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 174 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) | 176 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) |
| 175 | @Parameter(name = "dstIp", description = "目标收流IP", required = true) | 177 | @Parameter(name = "dstIp", description = "目标收流IP", required = true) |
| 176 | @Parameter(name = "dstPort", description = "目标收流端口", required = true) | 178 | @Parameter(name = "dstPort", description = "目标收流端口", required = true) |
src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
| @@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | @@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; | ||
| 5 | import com.genersoft.iot.vmp.conf.DynamicTask; | 5 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 6 | import com.genersoft.iot.vmp.conf.UserSetting; | 6 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 7 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 8 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 8 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; | 9 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| 9 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 10 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 11 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -19,6 +20,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 19 | import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo; | 20 | import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo; |
| 20 | import io.swagger.v3.oas.annotations.Operation; | 21 | import io.swagger.v3.oas.annotations.Operation; |
| 21 | import io.swagger.v3.oas.annotations.Parameter; | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 23 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 22 | import io.swagger.v3.oas.annotations.tags.Tag; | 24 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 23 | import okhttp3.OkHttpClient; | 25 | import okhttp3.OkHttpClient; |
| 24 | import okhttp3.Request; | 26 | import okhttp3.Request; |
| @@ -69,7 +71,7 @@ public class RtpController { | @@ -69,7 +71,7 @@ public class RtpController { | ||
| 69 | 71 | ||
| 70 | @GetMapping(value = "/receive/open") | 72 | @GetMapping(value = "/receive/open") |
| 71 | @ResponseBody | 73 | @ResponseBody |
| 72 | - @Operation(summary = "开启收流和获取发流信息") | 74 | + @Operation(summary = "开启收流和获取发流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 73 | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) | 75 | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) |
| 74 | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) | 76 | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) |
| 75 | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) | 77 | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) |
| @@ -156,7 +158,7 @@ public class RtpController { | @@ -156,7 +158,7 @@ public class RtpController { | ||
| 156 | 158 | ||
| 157 | @GetMapping(value = "/receive/close") | 159 | @GetMapping(value = "/receive/close") |
| 158 | @ResponseBody | 160 | @ResponseBody |
| 159 | - @Operation(summary = "关闭收流") | 161 | + @Operation(summary = "关闭收流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 160 | @Parameter(name = "stream", description = "流的ID", required = true) | 162 | @Parameter(name = "stream", description = "流的ID", required = true) |
| 161 | public void closeRtpServer(String stream) { | 163 | public void closeRtpServer(String stream) { |
| 162 | logger.info("[第三方服务对接->关闭收流] stream->{}", stream); | 164 | logger.info("[第三方服务对接->关闭收流] stream->{}", stream); |
| @@ -175,7 +177,7 @@ public class RtpController { | @@ -175,7 +177,7 @@ public class RtpController { | ||
| 175 | 177 | ||
| 176 | @GetMapping(value = "/send/start") | 178 | @GetMapping(value = "/send/start") |
| 177 | @ResponseBody | 179 | @ResponseBody |
| 178 | - @Operation(summary = "发送流") | 180 | + @Operation(summary = "发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 179 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) | 181 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) |
| 180 | @Parameter(name = "dstIpForAudio", description = "目标音频收流IP", required = false) | 182 | @Parameter(name = "dstIpForAudio", description = "目标音频收流IP", required = false) |
| 181 | @Parameter(name = "dstIpForVideo", description = "目标视频收流IP", required = false) | 183 | @Parameter(name = "dstIpForVideo", description = "目标视频收流IP", required = false) |
| @@ -351,7 +353,7 @@ public class RtpController { | @@ -351,7 +353,7 @@ public class RtpController { | ||
| 351 | 353 | ||
| 352 | @GetMapping(value = "/send/stop") | 354 | @GetMapping(value = "/send/stop") |
| 353 | @ResponseBody | 355 | @ResponseBody |
| 354 | - @Operation(summary = "关闭发送流") | 356 | + @Operation(summary = "关闭发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 355 | @Parameter(name = "callId", description = "整个过程的唯一标识,不传则使用随机端口发流", required = true) | 357 | @Parameter(name = "callId", description = "整个过程的唯一标识,不传则使用随机端口发流", required = true) |
| 356 | public void closeSendRTP(String callId) { | 358 | public void closeSendRTP(String callId) { |
| 357 | logger.info("[第三方服务对接->关闭发送流] callId->{}", callId); | 359 | logger.info("[第三方服务对接->关闭发送流] callId->{}", callId); |
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
| @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | ||
| 8 | import com.genersoft.iot.vmp.conf.UserSetting; | 8 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 9 | import com.genersoft.iot.vmp.conf.VersionInfo; | 9 | import com.genersoft.iot.vmp.conf.VersionInfo; |
| 10 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 10 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 11 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 11 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; | 12 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| 12 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 13 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 13 | import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe; | 14 | import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe; |
| @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; | @@ -21,6 +22,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; | ||
| 21 | import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; | 22 | import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; |
| 22 | import io.swagger.v3.oas.annotations.Operation; | 23 | import io.swagger.v3.oas.annotations.Operation; |
| 23 | import io.swagger.v3.oas.annotations.Parameter; | 24 | import io.swagger.v3.oas.annotations.Parameter; |
| 25 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 24 | import io.swagger.v3.oas.annotations.tags.Tag; | 26 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 25 | import org.springframework.beans.factory.annotation.Autowired; | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| 26 | import org.springframework.beans.factory.annotation.Value; | 28 | import org.springframework.beans.factory.annotation.Value; |
| @@ -79,27 +81,27 @@ public class ServerController { | @@ -79,27 +81,27 @@ public class ServerController { | ||
| 79 | 81 | ||
| 80 | @GetMapping(value = "/media_server/list") | 82 | @GetMapping(value = "/media_server/list") |
| 81 | @ResponseBody | 83 | @ResponseBody |
| 82 | - @Operation(summary = "流媒体服务列表") | 84 | + @Operation(summary = "流媒体服务列表", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 83 | public List<MediaServerItem> getMediaServerList() { | 85 | public List<MediaServerItem> getMediaServerList() { |
| 84 | return mediaServerService.getAll(); | 86 | return mediaServerService.getAll(); |
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | @GetMapping(value = "/media_server/online/list") | 89 | @GetMapping(value = "/media_server/online/list") |
| 88 | @ResponseBody | 90 | @ResponseBody |
| 89 | - @Operation(summary = "在线流媒体服务列表") | 91 | + @Operation(summary = "在线流媒体服务列表", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 90 | public List<MediaServerItem> getOnlineMediaServerList() { | 92 | public List<MediaServerItem> getOnlineMediaServerList() { |
| 91 | return mediaServerService.getAllOnline(); | 93 | return mediaServerService.getAllOnline(); |
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | @GetMapping(value = "/media_server/one/{id}") | 96 | @GetMapping(value = "/media_server/one/{id}") |
| 95 | @ResponseBody | 97 | @ResponseBody |
| 96 | - @Operation(summary = "停止视频回放") | 98 | + @Operation(summary = "停止视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 97 | @Parameter(name = "id", description = "流媒体服务ID", required = true) | 99 | @Parameter(name = "id", description = "流媒体服务ID", required = true) |
| 98 | public MediaServerItem getMediaServer(@PathVariable String id) { | 100 | public MediaServerItem getMediaServer(@PathVariable String id) { |
| 99 | return mediaServerService.getOne(id); | 101 | return mediaServerService.getOne(id); |
| 100 | } | 102 | } |
| 101 | 103 | ||
| 102 | - @Operation(summary = "测试流媒体服务") | 104 | + @Operation(summary = "测试流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 103 | @Parameter(name = "ip", description = "流媒体服务IP", required = true) | 105 | @Parameter(name = "ip", description = "流媒体服务IP", required = true) |
| 104 | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) | 106 | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) |
| 105 | @Parameter(name = "secret", description = "流媒体服务secret", required = true) | 107 | @Parameter(name = "secret", description = "流媒体服务secret", required = true) |
| @@ -109,7 +111,7 @@ public class ServerController { | @@ -109,7 +111,7 @@ public class ServerController { | ||
| 109 | return mediaServerService.checkMediaServer(ip, port, secret); | 111 | return mediaServerService.checkMediaServer(ip, port, secret); |
| 110 | } | 112 | } |
| 111 | 113 | ||
| 112 | - @Operation(summary = "测试流媒体录像管理服务") | 114 | + @Operation(summary = "测试流媒体录像管理服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 113 | @Parameter(name = "ip", description = "流媒体服务IP", required = true) | 115 | @Parameter(name = "ip", description = "流媒体服务IP", required = true) |
| 114 | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) | 116 | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) |
| 115 | @GetMapping(value = "/media_server/record/check") | 117 | @GetMapping(value = "/media_server/record/check") |
| @@ -121,7 +123,7 @@ public class ServerController { | @@ -121,7 +123,7 @@ public class ServerController { | ||
| 121 | } | 123 | } |
| 122 | } | 124 | } |
| 123 | 125 | ||
| 124 | - @Operation(summary = "保存流媒体服务") | 126 | + @Operation(summary = "保存流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 125 | @Parameter(name = "mediaServerItem", description = "流媒体信息", required = true) | 127 | @Parameter(name = "mediaServerItem", description = "流媒体信息", required = true) |
| 126 | @PostMapping(value = "/media_server/save") | 128 | @PostMapping(value = "/media_server/save") |
| 127 | @ResponseBody | 129 | @ResponseBody |
| @@ -135,7 +137,7 @@ public class ServerController { | @@ -135,7 +137,7 @@ public class ServerController { | ||
| 135 | } | 137 | } |
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | - @Operation(summary = "移除流媒体服务") | 140 | + @Operation(summary = "移除流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 139 | @Parameter(name = "id", description = "流媒体ID", required = true) | 141 | @Parameter(name = "id", description = "流媒体ID", required = true) |
| 140 | @DeleteMapping(value = "/media_server/delete") | 142 | @DeleteMapping(value = "/media_server/delete") |
| 141 | @ResponseBody | 143 | @ResponseBody |
| @@ -148,7 +150,7 @@ public class ServerController { | @@ -148,7 +150,7 @@ public class ServerController { | ||
| 148 | } | 150 | } |
| 149 | 151 | ||
| 150 | 152 | ||
| 151 | - @Operation(summary = "重启服务") | 153 | + @Operation(summary = "重启服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 152 | @GetMapping(value = "/restart") | 154 | @GetMapping(value = "/restart") |
| 153 | @ResponseBody | 155 | @ResponseBody |
| 154 | public void restart() { | 156 | public void restart() { |
| @@ -173,7 +175,7 @@ public class ServerController { | @@ -173,7 +175,7 @@ public class ServerController { | ||
| 173 | // }); | 175 | // }); |
| 174 | }; | 176 | }; |
| 175 | 177 | ||
| 176 | - @Operation(summary = "获取系统信息信息") | 178 | + @Operation(summary = "获取系统信息信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 177 | @GetMapping(value = "/system/configInfo") | 179 | @GetMapping(value = "/system/configInfo") |
| 178 | @ResponseBody | 180 | @ResponseBody |
| 179 | public SystemConfigInfo getConfigInfo() { | 181 | public SystemConfigInfo getConfigInfo() { |
| @@ -185,7 +187,7 @@ public class ServerController { | @@ -185,7 +187,7 @@ public class ServerController { | ||
| 185 | return systemConfigInfo; | 187 | return systemConfigInfo; |
| 186 | } | 188 | } |
| 187 | 189 | ||
| 188 | - @Operation(summary = "获取版本信息") | 190 | + @Operation(summary = "获取版本信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 189 | @GetMapping(value = "/version") | 191 | @GetMapping(value = "/version") |
| 190 | @ResponseBody | 192 | @ResponseBody |
| 191 | public VersionPo VersionPogetVersion() { | 193 | public VersionPo VersionPogetVersion() { |
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject; | @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject; | ||
| 4 | import com.genersoft.iot.vmp.common.StreamInfo; | 4 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 5 | import com.genersoft.iot.vmp.conf.UserSetting; | 5 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 6 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 6 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 7 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 8 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 9 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 10 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | @@ -16,6 +17,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | ||
| 16 | import com.github.pagehelper.PageInfo; | 17 | import com.github.pagehelper.PageInfo; |
| 17 | import io.swagger.v3.oas.annotations.Operation; | 18 | import io.swagger.v3.oas.annotations.Operation; |
| 18 | import io.swagger.v3.oas.annotations.Parameter; | 19 | import io.swagger.v3.oas.annotations.Parameter; |
| 20 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 19 | import io.swagger.v3.oas.annotations.tags.Tag; | 21 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 20 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| 21 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
| @@ -52,7 +54,7 @@ public class StreamProxyController { | @@ -52,7 +54,7 @@ public class StreamProxyController { | ||
| 52 | private UserSetting userSetting; | 54 | private UserSetting userSetting; |
| 53 | 55 | ||
| 54 | 56 | ||
| 55 | - @Operation(summary = "分页查询流代理") | 57 | + @Operation(summary = "分页查询流代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 56 | @Parameter(name = "page", description = "当前页") | 58 | @Parameter(name = "page", description = "当前页") |
| 57 | @Parameter(name = "count", description = "每页查询数量") | 59 | @Parameter(name = "count", description = "每页查询数量") |
| 58 | @Parameter(name = "query", description = "查询内容") | 60 | @Parameter(name = "query", description = "查询内容") |
| @@ -67,7 +69,7 @@ public class StreamProxyController { | @@ -67,7 +69,7 @@ public class StreamProxyController { | ||
| 67 | return streamProxyService.getAll(page, count); | 69 | return streamProxyService.getAll(page, count); |
| 68 | } | 70 | } |
| 69 | 71 | ||
| 70 | - @Operation(summary = "查询流代理") | 72 | + @Operation(summary = "查询流代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 71 | @Parameter(name = "app", description = "应用名") | 73 | @Parameter(name = "app", description = "应用名") |
| 72 | @Parameter(name = "stream", description = "流Id") | 74 | @Parameter(name = "stream", description = "流Id") |
| 73 | @GetMapping(value = "/one") | 75 | @GetMapping(value = "/one") |
| @@ -77,7 +79,7 @@ public class StreamProxyController { | @@ -77,7 +79,7 @@ public class StreamProxyController { | ||
| 77 | return streamProxyService.getStreamProxyByAppAndStream(app, stream); | 79 | return streamProxyService.getStreamProxyByAppAndStream(app, stream); |
| 78 | } | 80 | } |
| 79 | 81 | ||
| 80 | - @Operation(summary = "保存代理", parameters = { | 82 | + @Operation(summary = "保存代理", security = @SecurityRequirement(name = JwtUtils.HEADER), parameters = { |
| 81 | @Parameter(name = "param", description = "代理参数", required = true), | 83 | @Parameter(name = "param", description = "代理参数", required = true), |
| 82 | }) | 84 | }) |
| 83 | @PostMapping(value = "/save") | 85 | @PostMapping(value = "/save") |
| @@ -131,7 +133,7 @@ public class StreamProxyController { | @@ -131,7 +133,7 @@ public class StreamProxyController { | ||
| 131 | 133 | ||
| 132 | @GetMapping(value = "/ffmpeg_cmd/list") | 134 | @GetMapping(value = "/ffmpeg_cmd/list") |
| 133 | @ResponseBody | 135 | @ResponseBody |
| 134 | - @Operation(summary = "获取ffmpeg.cmd模板") | 136 | + @Operation(summary = "获取ffmpeg.cmd模板", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 135 | @Parameter(name = "mediaServerId", description = "流媒体ID", required = true) | 137 | @Parameter(name = "mediaServerId", description = "流媒体ID", required = true) |
| 136 | public JSONObject getFFmpegCMDs(@RequestParam String mediaServerId){ | 138 | public JSONObject getFFmpegCMDs(@RequestParam String mediaServerId){ |
| 137 | logger.debug("获取节点[ {} ]ffmpeg.cmd模板", mediaServerId ); | 139 | logger.debug("获取节点[ {} ]ffmpeg.cmd模板", mediaServerId ); |
| @@ -145,7 +147,7 @@ public class StreamProxyController { | @@ -145,7 +147,7 @@ public class StreamProxyController { | ||
| 145 | 147 | ||
| 146 | @DeleteMapping(value = "/del") | 148 | @DeleteMapping(value = "/del") |
| 147 | @ResponseBody | 149 | @ResponseBody |
| 148 | - @Operation(summary = "移除代理") | 150 | + @Operation(summary = "移除代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 149 | @Parameter(name = "app", description = "应用名", required = true) | 151 | @Parameter(name = "app", description = "应用名", required = true) |
| 150 | @Parameter(name = "stream", description = "流id", required = true) | 152 | @Parameter(name = "stream", description = "流id", required = true) |
| 151 | public void del(@RequestParam String app, @RequestParam String stream){ | 153 | public void del(@RequestParam String app, @RequestParam String stream){ |
| @@ -159,7 +161,7 @@ public class StreamProxyController { | @@ -159,7 +161,7 @@ public class StreamProxyController { | ||
| 159 | 161 | ||
| 160 | @GetMapping(value = "/start") | 162 | @GetMapping(value = "/start") |
| 161 | @ResponseBody | 163 | @ResponseBody |
| 162 | - @Operation(summary = "启用代理") | 164 | + @Operation(summary = "启用代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 163 | @Parameter(name = "app", description = "应用名", required = true) | 165 | @Parameter(name = "app", description = "应用名", required = true) |
| 164 | @Parameter(name = "stream", description = "流id", required = true) | 166 | @Parameter(name = "stream", description = "流id", required = true) |
| 165 | public void start(String app, String stream){ | 167 | public void start(String app, String stream){ |
| @@ -172,7 +174,7 @@ public class StreamProxyController { | @@ -172,7 +174,7 @@ public class StreamProxyController { | ||
| 172 | 174 | ||
| 173 | @GetMapping(value = "/stop") | 175 | @GetMapping(value = "/stop") |
| 174 | @ResponseBody | 176 | @ResponseBody |
| 175 | - @Operation(summary = "停用代理") | 177 | + @Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 176 | @Parameter(name = "app", description = "应用名", required = true) | 178 | @Parameter(name = "app", description = "应用名", required = true) |
| 177 | @Parameter(name = "stream", description = "流id", required = true) | 179 | @Parameter(name = "stream", description = "流id", required = true) |
| 178 | public void stop(String app, String stream){ | 180 | public void stop(String app, String stream){ |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| @@ -6,6 +6,7 @@ import com.alibaba.excel.read.metadata.ReadSheet; | @@ -6,6 +6,7 @@ import com.alibaba.excel.read.metadata.ReadSheet; | ||
| 6 | import com.genersoft.iot.vmp.common.StreamInfo; | 6 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 7 | import com.genersoft.iot.vmp.conf.UserSetting; | 7 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 8 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 8 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 9 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 9 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; | 10 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| 10 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; | 11 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| 11 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 12 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| @@ -20,6 +21,7 @@ import com.genersoft.iot.vmp.vmanager.bean.*; | @@ -20,6 +21,7 @@ import com.genersoft.iot.vmp.vmanager.bean.*; | ||
| 20 | import com.github.pagehelper.PageInfo; | 21 | import com.github.pagehelper.PageInfo; |
| 21 | import io.swagger.v3.oas.annotations.Operation; | 22 | import io.swagger.v3.oas.annotations.Operation; |
| 22 | import io.swagger.v3.oas.annotations.Parameter; | 23 | import io.swagger.v3.oas.annotations.Parameter; |
| 24 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 23 | import io.swagger.v3.oas.annotations.tags.Tag; | 25 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 24 | import org.slf4j.Logger; | 26 | import org.slf4j.Logger; |
| 25 | import org.slf4j.LoggerFactory; | 27 | import org.slf4j.LoggerFactory; |
| @@ -64,7 +66,7 @@ public class StreamPushController { | @@ -64,7 +66,7 @@ public class StreamPushController { | ||
| 64 | 66 | ||
| 65 | @GetMapping(value = "/list") | 67 | @GetMapping(value = "/list") |
| 66 | @ResponseBody | 68 | @ResponseBody |
| 67 | - @Operation(summary = "推流列表查询") | 69 | + @Operation(summary = "推流列表查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 68 | @Parameter(name = "page", description = "当前页") | 70 | @Parameter(name = "page", description = "当前页") |
| 69 | @Parameter(name = "count", description = "每页查询数量") | 71 | @Parameter(name = "count", description = "每页查询数量") |
| 70 | @Parameter(name = "query", description = "查询内容") | 72 | @Parameter(name = "query", description = "查询内容") |
| @@ -88,7 +90,7 @@ public class StreamPushController { | @@ -88,7 +90,7 @@ public class StreamPushController { | ||
| 88 | 90 | ||
| 89 | @PostMapping(value = "/save_to_gb") | 91 | @PostMapping(value = "/save_to_gb") |
| 90 | @ResponseBody | 92 | @ResponseBody |
| 91 | - @Operation(summary = "将推流添加到国标") | 93 | + @Operation(summary = "将推流添加到国标", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 92 | public void saveToGB(@RequestBody GbStream stream){ | 94 | public void saveToGB(@RequestBody GbStream stream){ |
| 93 | if (!streamPushService.saveToGB(stream)){ | 95 | if (!streamPushService.saveToGB(stream)){ |
| 94 | throw new ControllerException(ErrorCode.ERROR100); | 96 | throw new ControllerException(ErrorCode.ERROR100); |
| @@ -98,7 +100,7 @@ public class StreamPushController { | @@ -98,7 +100,7 @@ public class StreamPushController { | ||
| 98 | 100 | ||
| 99 | @DeleteMapping(value = "/remove_form_gb") | 101 | @DeleteMapping(value = "/remove_form_gb") |
| 100 | @ResponseBody | 102 | @ResponseBody |
| 101 | - @Operation(summary = "将推流移出到国标") | 103 | + @Operation(summary = "将推流移出到国标", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 102 | public void removeFormGB(@RequestBody GbStream stream){ | 104 | public void removeFormGB(@RequestBody GbStream stream){ |
| 103 | if (!streamPushService.removeFromGB(stream)){ | 105 | if (!streamPushService.removeFromGB(stream)){ |
| 104 | throw new ControllerException(ErrorCode.ERROR100); | 106 | throw new ControllerException(ErrorCode.ERROR100); |
| @@ -108,7 +110,7 @@ public class StreamPushController { | @@ -108,7 +110,7 @@ public class StreamPushController { | ||
| 108 | 110 | ||
| 109 | @PostMapping(value = "/stop") | 111 | @PostMapping(value = "/stop") |
| 110 | @ResponseBody | 112 | @ResponseBody |
| 111 | - @Operation(summary = "中止一个推流") | 113 | + @Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 112 | @Parameter(name = "app", description = "应用名", required = true) | 114 | @Parameter(name = "app", description = "应用名", required = true) |
| 113 | @Parameter(name = "stream", description = "流id", required = true) | 115 | @Parameter(name = "stream", description = "流id", required = true) |
| 114 | public void stop(String app, String streamId){ | 116 | public void stop(String app, String streamId){ |
| @@ -119,7 +121,7 @@ public class StreamPushController { | @@ -119,7 +121,7 @@ public class StreamPushController { | ||
| 119 | 121 | ||
| 120 | @DeleteMapping(value = "/batchStop") | 122 | @DeleteMapping(value = "/batchStop") |
| 121 | @ResponseBody | 123 | @ResponseBody |
| 122 | - @Operation(summary = "中止多个推流") | 124 | + @Operation(summary = "中止多个推流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 123 | public void batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ | 125 | public void batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ |
| 124 | if (batchGBStreamParam.getGbStreams().size() == 0) { | 126 | if (batchGBStreamParam.getGbStreams().size() == 0) { |
| 125 | throw new ControllerException(ErrorCode.ERROR100); | 127 | throw new ControllerException(ErrorCode.ERROR100); |
| @@ -231,7 +233,7 @@ public class StreamPushController { | @@ -231,7 +233,7 @@ public class StreamPushController { | ||
| 231 | */ | 233 | */ |
| 232 | @GetMapping(value = "/getPlayUrl") | 234 | @GetMapping(value = "/getPlayUrl") |
| 233 | @ResponseBody | 235 | @ResponseBody |
| 234 | - @Operation(summary = "获取推流播放地址") | 236 | + @Operation(summary = "获取推流播放地址", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 235 | @Parameter(name = "app", description = "应用名", required = true) | 237 | @Parameter(name = "app", description = "应用名", required = true) |
| 236 | @Parameter(name = "stream", description = "流id", required = true) | 238 | @Parameter(name = "stream", description = "流id", required = true) |
| 237 | @Parameter(name = "mediaServerId", description = "媒体服务器id") | 239 | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
| @@ -261,7 +263,7 @@ public class StreamPushController { | @@ -261,7 +263,7 @@ public class StreamPushController { | ||
| 261 | */ | 263 | */ |
| 262 | @PostMapping(value = "/add") | 264 | @PostMapping(value = "/add") |
| 263 | @ResponseBody | 265 | @ResponseBody |
| 264 | - @Operation(summary = "添加推流信息") | 266 | + @Operation(summary = "添加推流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 265 | public void add(@RequestBody StreamPushItem stream){ | 267 | public void add(@RequestBody StreamPushItem stream){ |
| 266 | if (ObjectUtils.isEmpty(stream.getGbId())) { | 268 | if (ObjectUtils.isEmpty(stream.getGbId())) { |
| 267 | throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空"); | 269 | throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空"); |
src/main/java/com/genersoft/iot/vmp/vmanager/user/RoleController.java
| 1 | package com.genersoft.iot.vmp.vmanager.user; | 1 | package com.genersoft.iot.vmp.vmanager.user; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 3 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 4 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 4 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; | 5 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| 5 | import com.genersoft.iot.vmp.service.IRoleService; | 6 | import com.genersoft.iot.vmp.service.IRoleService; |
| 6 | import com.genersoft.iot.vmp.storager.dao.dto.Role; | 7 | import com.genersoft.iot.vmp.storager.dao.dto.Role; |
| @@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.utils.DateUtil; | @@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.utils.DateUtil; | ||
| 8 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 9 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 9 | import io.swagger.v3.oas.annotations.Operation; | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | import io.swagger.v3.oas.annotations.Parameter; | 11 | import io.swagger.v3.oas.annotations.Parameter; |
| 12 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 11 | import io.swagger.v3.oas.annotations.tags.Tag; | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| @@ -24,7 +26,7 @@ public class RoleController { | @@ -24,7 +26,7 @@ public class RoleController { | ||
| 24 | private IRoleService roleService; | 26 | private IRoleService roleService; |
| 25 | 27 | ||
| 26 | @PostMapping("/add") | 28 | @PostMapping("/add") |
| 27 | - @Operation(summary = "添加角色") | 29 | + @Operation(summary = "添加角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 28 | @Parameter(name = "name", description = "角色名", required = true) | 30 | @Parameter(name = "name", description = "角色名", required = true) |
| 29 | @Parameter(name = "authority", description = "权限(自行定义内容,目前未使用)", required = true) | 31 | @Parameter(name = "authority", description = "权限(自行定义内容,目前未使用)", required = true) |
| 30 | public void add(@RequestParam String name, | 32 | public void add(@RequestParam String name, |
| @@ -49,7 +51,7 @@ public class RoleController { | @@ -49,7 +51,7 @@ public class RoleController { | ||
| 49 | } | 51 | } |
| 50 | 52 | ||
| 51 | @DeleteMapping("/delete") | 53 | @DeleteMapping("/delete") |
| 52 | - @Operation(summary = "删除角色") | 54 | + @Operation(summary = "删除角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 53 | @Parameter(name = "id", description = "用户Id", required = true) | 55 | @Parameter(name = "id", description = "用户Id", required = true) |
| 54 | public void delete(@RequestParam Integer id){ | 56 | public void delete(@RequestParam Integer id){ |
| 55 | // 获取当前登录用户id | 57 | // 获取当前登录用户id |
| @@ -66,7 +68,7 @@ public class RoleController { | @@ -66,7 +68,7 @@ public class RoleController { | ||
| 66 | } | 68 | } |
| 67 | 69 | ||
| 68 | @GetMapping("/all") | 70 | @GetMapping("/all") |
| 69 | - @Operation(summary = "查询角色") | 71 | + @Operation(summary = "查询角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 70 | public List<Role> all(){ | 72 | public List<Role> all(){ |
| 71 | // 获取当前登录用户id | 73 | // 获取当前登录用户id |
| 72 | List<Role> allRoles = roleService.getAll(); | 74 | List<Role> allRoles = roleService.getAll(); |
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
| @@ -67,7 +67,7 @@ public class UserController { | @@ -67,7 +67,7 @@ public class UserController { | ||
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | @PostMapping("/changePassword") | 69 | @PostMapping("/changePassword") |
| 70 | - @Operation(summary = "修改密码") | 70 | + @Operation(summary = "修改密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 71 | @Parameter(name = "username", description = "用户名", required = true) | 71 | @Parameter(name = "username", description = "用户名", required = true) |
| 72 | @Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true) | 72 | @Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true) |
| 73 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) | 73 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |
| @@ -132,7 +132,7 @@ public class UserController { | @@ -132,7 +132,7 @@ public class UserController { | ||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | @DeleteMapping("/delete") | 134 | @DeleteMapping("/delete") |
| 135 | - @Operation(summary = "删除用户") | 135 | + @Operation(summary = "删除用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 136 | @Parameter(name = "id", description = "用户Id", required = true) | 136 | @Parameter(name = "id", description = "用户Id", required = true) |
| 137 | public void delete(@RequestParam Integer id){ | 137 | public void delete(@RequestParam Integer id){ |
| 138 | // 获取当前登录用户id | 138 | // 获取当前登录用户id |
| @@ -148,7 +148,7 @@ public class UserController { | @@ -148,7 +148,7 @@ public class UserController { | ||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | @GetMapping("/all") | 150 | @GetMapping("/all") |
| 151 | - @Operation(summary = "查询用户") | 151 | + @Operation(summary = "查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 152 | public List<User> all(){ | 152 | public List<User> all(){ |
| 153 | // 获取当前登录用户id | 153 | // 获取当前登录用户id |
| 154 | return userService.getAllUsers(); | 154 | return userService.getAllUsers(); |
| @@ -162,7 +162,7 @@ public class UserController { | @@ -162,7 +162,7 @@ public class UserController { | ||
| 162 | * @return 分页用户列表 | 162 | * @return 分页用户列表 |
| 163 | */ | 163 | */ |
| 164 | @GetMapping("/users") | 164 | @GetMapping("/users") |
| 165 | - @Operation(summary = "分页查询用户") | 165 | + @Operation(summary = "分页查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 166 | @Parameter(name = "page", description = "当前页", required = true) | 166 | @Parameter(name = "page", description = "当前页", required = true) |
| 167 | @Parameter(name = "count", description = "每页查询数量", required = true) | 167 | @Parameter(name = "count", description = "每页查询数量", required = true) |
| 168 | public PageInfo<User> users(int page, int count) { | 168 | public PageInfo<User> users(int page, int count) { |
| @@ -170,7 +170,7 @@ public class UserController { | @@ -170,7 +170,7 @@ public class UserController { | ||
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | @RequestMapping("/changePushKey") | 172 | @RequestMapping("/changePushKey") |
| 173 | - @Operation(summary = "修改pushkey") | 173 | + @Operation(summary = "修改pushkey", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 174 | @Parameter(name = "userId", description = "用户Id", required = true) | 174 | @Parameter(name = "userId", description = "用户Id", required = true) |
| 175 | @Parameter(name = "pushKey", description = "新的pushKey", required = true) | 175 | @Parameter(name = "pushKey", description = "新的pushKey", required = true) |
| 176 | public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) { | 176 | public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) { |
| @@ -188,7 +188,7 @@ public class UserController { | @@ -188,7 +188,7 @@ public class UserController { | ||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | @PostMapping("/changePasswordForAdmin") | 190 | @PostMapping("/changePasswordForAdmin") |
| 191 | - @Operation(summary = "管理员修改普通用户密码") | 191 | + @Operation(summary = "管理员修改普通用户密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 192 | @Parameter(name = "adminId", description = "管理员id", required = true) | 192 | @Parameter(name = "adminId", description = "管理员id", required = true) |
| 193 | @Parameter(name = "userId", description = "用户id", required = true) | 193 | @Parameter(name = "userId", description = "用户id", required = true) |
| 194 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) | 194 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |