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