From ef07cf3b94f8e8c2cdac77b5a3c3244b0aa2b333 Mon Sep 17 00:00:00 2001 From: shangxingyu Date: Sat, 3 Feb 2024 12:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Swagger=E6=8E=A5=E5=8F=A3acce?= =?UTF-8?q?ss-token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channel/CommonChannelPlatformController.java | 6 ++++-- .../iot/vmp/vmanager/group/GroupController.java | 12 +++++++----- .../vmp/vmanager/region/RegionController.java | 16 +++++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelPlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelPlatformController.java index 097b1152f..a9ece055a 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelPlatformController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelPlatformController.java @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.channel; import com.genersoft.iot.vmp.common.CommonGbChannel; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.service.ICommonGbChannelService; @@ -17,6 +18,7 @@ import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.commons.lang3.ObjectUtils; import org.slf4j.Logger; @@ -56,7 +58,7 @@ public class CommonChannelPlatformController { /** * 向上级平台添加国标通道 */ - @Operation(summary = "向上级平台添加国标通道") + @Operation(summary = "向上级平台添加国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) @PostMapping("/add") @ResponseBody public void addChannelForGB(@RequestBody UpdateChannelParam param) { @@ -85,7 +87,7 @@ public class CommonChannelPlatformController { * @param param 通道关联参数 * @return */ - @Operation(summary = "从上级平台移除国标通道") + @Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) @DeleteMapping("/delete") @ResponseBody public void delChannelForGB(@RequestBody UpdateChannelParam param) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/group/GroupController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/group/GroupController.java index da171fbb6..67c6bf661 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/group/GroupController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/group/GroupController.java @@ -1,12 +1,14 @@ package com.genersoft.iot.vmp.vmanager.group; import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.service.IGroupService; import com.genersoft.iot.vmp.service.bean.Group; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.github.pagehelper.PageInfo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.commons.lang3.ObjectUtils; import org.slf4j.Logger; @@ -26,7 +28,7 @@ public class GroupController { @Autowired private IGroupService groupService; - @Operation(summary = "添加区域") + @Operation(summary = "添加区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "group", description = "Group", required = true) @ResponseBody @PostMapping("/add") @@ -34,7 +36,7 @@ public class GroupController { groupService.add(group); } - @Operation(summary = "查询区域") + @Operation(summary = "查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "query", description = "查询内容", required = true) @Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "count", description = "每页查询数量", required = true) @@ -48,7 +50,7 @@ public class GroupController { return groupService.queryGroup(query, page, count); } - @Operation(summary = "更新区域") + @Operation(summary = "更新区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "group", description = "Group", required = true) @ResponseBody @PostMapping("/update") @@ -56,7 +58,7 @@ public class GroupController { groupService.update(group); } - @Operation(summary = "删除区域") + @Operation(summary = "删除区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "groupDeviceId", description = "待删除的节点编号", required = true) @ResponseBody @GetMapping("/delete") @@ -68,7 +70,7 @@ public class GroupController { } } - @Operation(summary = "查询区域的子节点") + @Operation(summary = "查询区域的子节点", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "groupParentId", description = "待查询的节点", required = true) @Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "count", description = "每页查询数量", required = true) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java index c3d3105fd..909891f7c 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java @@ -1,6 +1,7 @@ package com.genersoft.iot.vmp.vmanager.region; import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType; import com.genersoft.iot.vmp.service.IRegionService; import com.genersoft.iot.vmp.service.bean.Region; @@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.github.pagehelper.PageInfo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,7 +29,7 @@ public class RegionController { @Autowired private IRegionService regionService; - @Operation(summary = "添加区域") + @Operation(summary = "添加区域",security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "region", description = "Region", required = true) @ResponseBody @PostMapping("/add") @@ -35,7 +37,7 @@ public class RegionController { regionService.add(region); } - @Operation(summary = "查询区域") + @Operation(summary = "查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "query", description = "要搜索的内容", required = true) @Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "count", description = "每页查询数量", required = true) @@ -49,7 +51,7 @@ public class RegionController { return regionService.query(query, page, count); } - @Operation(summary = "更新区域") + @Operation(summary = "更新区域" , security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "region", description = "Region", required = true) @ResponseBody @PostMapping("/update") @@ -57,7 +59,7 @@ public class RegionController { regionService.update(region); } - @Operation(summary = "删除区域") + @Operation(summary = "删除区域" , security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "regionDeviceId", description = "区域编码", required = true) @ResponseBody @GetMapping("/delete") @@ -69,7 +71,7 @@ public class RegionController { } } - @Operation(summary = "分页区域子节点") + @Operation(summary = "分页区域子节点", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "regionParentId", description = "行政区划父节点编号", required = true) @Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "count", description = "每页查询数量", required = true) @@ -86,7 +88,7 @@ public class RegionController { return regionService.queryChildRegionList(regionParentId, page, count); } - @Operation(summary = "根据区域Id查询区域") + @Operation(summary = "根据区域Id查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "regionDeviceId", description = "行政区划节点编号", required = true) @ResponseBody @GetMapping("/one") @@ -99,7 +101,7 @@ public class RegionController { return regionService.queryRegionByDeviceId(regionDeviceId); } - @Operation(summary = "获取所属的行政区划下的行政区划") + @Operation(summary = "获取所属的行政区划下的行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "parent", description = "所属的行政区划", required = false) @ResponseBody @GetMapping("/base/child/list")