Commit 07b182da98ac54fffa8f36b8db27d6212e1e0bf7
Merge branch 'wvp-28181-2.0' into feature/record
# Conflicts: # src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java # src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java
Showing
28 changed files
with
506 additions
and
245 deletions
pom.xml
| @@ -163,21 +163,16 @@ | @@ -163,21 +163,16 @@ | ||
| 163 | </dependency> | 163 | </dependency> |
| 164 | 164 | ||
| 165 | <!--在线文档 --> | 165 | <!--在线文档 --> |
| 166 | + <!--在线文档 --> | ||
| 166 | <dependency> | 167 | <dependency> |
| 167 | <groupId>org.springdoc</groupId> | 168 | <groupId>org.springdoc</groupId> |
| 168 | <artifactId>springdoc-openapi-ui</artifactId> | 169 | <artifactId>springdoc-openapi-ui</artifactId> |
| 169 | - <version>1.7.0</version> | ||
| 170 | - <exclusions> | ||
| 171 | - <exclusion> | ||
| 172 | - <groupId>org.yaml</groupId> | ||
| 173 | - <artifactId>snakeyaml</artifactId> | ||
| 174 | - </exclusion> | ||
| 175 | - </exclusions> | 170 | + <version>1.6.10</version> |
| 176 | </dependency> | 171 | </dependency> |
| 177 | <dependency> | 172 | <dependency> |
| 178 | - <groupId>org.yaml</groupId> | ||
| 179 | - <artifactId>snakeyaml</artifactId> | ||
| 180 | - <version>2.2</version> | 173 | + <groupId>org.springdoc</groupId> |
| 174 | + <artifactId>springdoc-openapi-security</artifactId> | ||
| 175 | + <version>1.6.10</version> | ||
| 181 | </dependency> | 176 | </dependency> |
| 182 | 177 | ||
| 183 | <dependency> | 178 | <dependency> |
src/main/java/com/genersoft/iot/vmp/conf/SpringDocConfig.java
| 1 | package com.genersoft.iot.vmp.conf; | 1 | package com.genersoft.iot.vmp.conf; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 4 | +import io.swagger.v3.oas.models.Components; | ||
| 3 | import io.swagger.v3.oas.models.OpenAPI; | 5 | import io.swagger.v3.oas.models.OpenAPI; |
| 4 | import io.swagger.v3.oas.models.info.Contact; | 6 | import io.swagger.v3.oas.models.info.Contact; |
| 5 | import io.swagger.v3.oas.models.info.Info; | 7 | import io.swagger.v3.oas.models.info.Info; |
| 6 | import io.swagger.v3.oas.models.info.License; | 8 | import io.swagger.v3.oas.models.info.License; |
| 9 | +import io.swagger.v3.oas.models.security.SecurityScheme; | ||
| 7 | import org.springframework.core.annotation.Order; | 10 | import org.springframework.core.annotation.Order; |
| 8 | import org.springdoc.core.GroupedOpenApi; | 11 | import org.springdoc.core.GroupedOpenApi; |
| 9 | import org.springframework.beans.factory.annotation.Value; | 12 | import org.springframework.beans.factory.annotation.Value; |
| @@ -26,10 +29,14 @@ public class SpringDocConfig { | @@ -26,10 +29,14 @@ public class SpringDocConfig { | ||
| 26 | contact.setName("pan"); | 29 | contact.setName("pan"); |
| 27 | contact.setEmail("648540858@qq.com"); | 30 | contact.setEmail("648540858@qq.com"); |
| 28 | return new OpenAPI() | 31 | return new OpenAPI() |
| 32 | + .components(new Components() | ||
| 33 | + .addSecuritySchemes(JwtUtils.HEADER, new SecurityScheme() | ||
| 34 | + .type(SecurityScheme.Type.HTTP) | ||
| 35 | + .bearerFormat("JWT"))) | ||
| 29 | .info(new Info().title("WVP-PRO 接口文档") | 36 | .info(new Info().title("WVP-PRO 接口文档") |
| 30 | .contact(contact) | 37 | .contact(contact) |
| 31 | .description("开箱即用的28181协议视频平台") | 38 | .description("开箱即用的28181协议视频平台") |
| 32 | - .version("v2.0") | 39 | + .version("v3.1.0") |
| 33 | .license(new License().name("Apache 2.0").url("http://springdoc.org"))); | 40 | .license(new License().name("Apache 2.0").url("http://springdoc.org"))); |
| 34 | } | 41 | } |
| 35 | 42 |
src/main/java/com/genersoft/iot/vmp/conf/security/JwtUtils.java
| @@ -28,7 +28,7 @@ public class JwtUtils implements InitializingBean { | @@ -28,7 +28,7 @@ public class JwtUtils implements InitializingBean { | ||
| 28 | 28 | ||
| 29 | private static final Logger logger = LoggerFactory.getLogger(JwtUtils.class); | 29 | private static final Logger logger = LoggerFactory.getLogger(JwtUtils.class); |
| 30 | 30 | ||
| 31 | - private static final String HEADER = "access-token"; | 31 | + public static final String HEADER = "access-token"; |
| 32 | 32 | ||
| 33 | private static final String AUDIENCE = "Audience"; | 33 | private static final String AUDIENCE = "Audience"; |
| 34 | 34 |
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
| @@ -68,6 +68,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -68,6 +68,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 68 | matchers.add("/"); | 68 | matchers.add("/"); |
| 69 | matchers.add("/#/**"); | 69 | matchers.add("/#/**"); |
| 70 | matchers.add("/static/**"); | 70 | matchers.add("/static/**"); |
| 71 | + matchers.add("/swagger-ui.html"); | ||
| 72 | + matchers.add("/swagger-ui/"); | ||
| 71 | matchers.add("/index.html"); | 73 | matchers.add("/index.html"); |
| 72 | matchers.add("/doc.html"); | 74 | matchers.add("/doc.html"); |
| 73 | matchers.add("/webjars/**"); | 75 | matchers.add("/webjars/**"); |
| @@ -77,6 +79,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -77,6 +79,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 77 | matchers.add("/api/device/query/snap/**"); | 79 | matchers.add("/api/device/query/snap/**"); |
| 78 | matchers.add("/record_proxy/*/**"); | 80 | matchers.add("/record_proxy/*/**"); |
| 79 | matchers.add("/api/emit"); | 81 | matchers.add("/api/emit"); |
| 82 | + matchers.add("/favicon.ico"); | ||
| 80 | // 可以直接访问的静态数据 | 83 | // 可以直接访问的静态数据 |
| 81 | web.ignoring().antMatchers(matchers.toArray(new String[0])); | 84 | web.ignoring().antMatchers(matchers.toArray(new String[0])); |
| 82 | } | 85 | } |
| @@ -113,7 +116,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -113,7 +116,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 113 | .authorizeRequests() | 116 | .authorizeRequests() |
| 114 | .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() | 117 | .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() |
| 115 | .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll() | 118 | .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll() |
| 116 | - .antMatchers("/api/user/login","/index/hook/**","/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4").permitAll() | 119 | + .antMatchers("/api/user/login", "/index/hook/**", "/swagger-ui/**", "/doc.html").permitAll() |
| 117 | .anyRequest().authenticated() | 120 | .anyRequest().authenticated() |
| 118 | // 异常处理器 | 121 | // 异常处理器 |
| 119 | .and() | 122 | .and() |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 8 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 8 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 9 | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; | 9 | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; |
| 10 | import com.genersoft.iot.vmp.utils.DateUtil; | 10 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 11 | +import org.apache.commons.lang3.StringUtils; | ||
| 11 | import org.apache.commons.lang3.math.NumberUtils; | 12 | import org.apache.commons.lang3.math.NumberUtils; |
| 12 | import org.dom4j.Attribute; | 13 | import org.dom4j.Attribute; |
| 13 | import org.dom4j.Document; | 14 | import org.dom4j.Document; |
| @@ -214,8 +215,11 @@ public class XmlUtil { | @@ -214,8 +215,11 @@ public class XmlUtil { | ||
| 214 | return deviceChannel; | 215 | return deviceChannel; |
| 215 | } | 216 | } |
| 216 | Element nameElement = itemDevice.element("Name"); | 217 | Element nameElement = itemDevice.element("Name"); |
| 217 | - if (nameElement != null) { | 218 | + // 当通道名称为空时,设置通道名称为通道编码,避免级联时因通道名称为空导致上级接收通道失败 |
| 219 | + if (nameElement != null && StringUtils.isNotBlank(nameElement.getText())) { | ||
| 218 | deviceChannel.setName(nameElement.getText()); | 220 | deviceChannel.setName(nameElement.getText()); |
| 221 | + } else { | ||
| 222 | + deviceChannel.setName(channelId); | ||
| 219 | } | 223 | } |
| 220 | if(channelId.length() <= 8) { | 224 | if(channelId.length() <= 8) { |
| 221 | deviceChannel.setHasAudio(false); | 225 | deviceChannel.setHasAudio(false); |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| @@ -6,7 +6,6 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform; | @@ -6,7 +6,6 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform; | ||
| 6 | import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; | 6 | import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 7 | import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend; | 7 | import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend; |
| 8 | import org.apache.ibatis.annotations.*; | 8 | import org.apache.ibatis.annotations.*; |
| 9 | -import org.apache.ibatis.annotations.Param; | ||
| 10 | import org.springframework.stereotype.Repository; | 9 | import org.springframework.stereotype.Repository; |
| 11 | 10 | ||
| 12 | import java.util.List; | 11 | import java.util.List; |
| @@ -31,7 +30,7 @@ public interface DeviceChannelMapper { | @@ -31,7 +30,7 @@ public interface DeviceChannelMapper { | ||
| 31 | @Update(value = {" <script>" + | 30 | @Update(value = {" <script>" + |
| 32 | "UPDATE wvp_device_channel " + | 31 | "UPDATE wvp_device_channel " + |
| 33 | "SET update_time=#{updateTime}" + | 32 | "SET update_time=#{updateTime}" + |
| 34 | - "<if test='name != null'>, name=#{name}</if>" + | 33 | + ", custom_name=#{name}" + |
| 35 | "<if test='manufacture != null'>, manufacture=#{manufacture}</if>" + | 34 | "<if test='manufacture != null'>, manufacture=#{manufacture}</if>" + |
| 36 | "<if test='model != null'>, model=#{model}</if>" + | 35 | "<if test='model != null'>, model=#{model}</if>" + |
| 37 | "<if test='owner != null'>, owner=#{owner}</if>" + | 36 | "<if test='owner != null'>, owner=#{owner}</if>" + |
| @@ -49,12 +48,12 @@ public interface DeviceChannelMapper { | @@ -49,12 +48,12 @@ public interface DeviceChannelMapper { | ||
| 49 | "<if test='ipAddress != null'>, ip_address=#{ipAddress}</if>" + | 48 | "<if test='ipAddress != null'>, ip_address=#{ipAddress}</if>" + |
| 50 | "<if test='port != null'>, port=#{port}</if>" + | 49 | "<if test='port != null'>, port=#{port}</if>" + |
| 51 | "<if test='password != null'>, password=#{password}</if>" + | 50 | "<if test='password != null'>, password=#{password}</if>" + |
| 52 | - "<if test='PTZType != null'>, ptz_type=#{PTZType}</if>" + | 51 | + "<if test='PTZType != null'>, custom_ptz_type=#{PTZType}</if>" + |
| 53 | "<if test='status != null'>, status=#{status}</if>" + | 52 | "<if test='status != null'>, status=#{status}</if>" + |
| 54 | "<if test='streamId != null'>, stream_id=#{streamId}</if>" + | 53 | "<if test='streamId != null'>, stream_id=#{streamId}</if>" + |
| 55 | "<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" + | 54 | "<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" + |
| 56 | - "<if test='longitude != null'>, longitude=#{longitude}</if>" + | ||
| 57 | - "<if test='latitude != null'>, latitude=#{latitude}</if>" + | 55 | + ", custom_longitude=#{longitude}" + |
| 56 | + ", custom_latitude=#{latitude}" + | ||
| 58 | "<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" + | 57 | "<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" + |
| 59 | "<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" + | 58 | "<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" + |
| 60 | "<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" + | 59 | "<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" + |
| @@ -67,7 +66,43 @@ public interface DeviceChannelMapper { | @@ -67,7 +66,43 @@ public interface DeviceChannelMapper { | ||
| 67 | 66 | ||
| 68 | @Select(value = {" <script>" + | 67 | @Select(value = {" <script>" + |
| 69 | "SELECT " + | 68 | "SELECT " + |
| 70 | - "dc.* " + | 69 | + "dc.id, " + |
| 70 | + "dc.channel_id, " + | ||
| 71 | + "COALESCE(dc.custom_name, dc.name) AS name, " + | ||
| 72 | + "dc.manufacture, " + | ||
| 73 | + "dc.model, " + | ||
| 74 | + "dc.owner, " + | ||
| 75 | + "dc.civil_code, " + | ||
| 76 | + "dc.block, " + | ||
| 77 | + "dc.address, " + | ||
| 78 | + "dc.parent_id, " + | ||
| 79 | + "dc.safety_way, " + | ||
| 80 | + "dc.register_way, " + | ||
| 81 | + "dc.cert_num, " + | ||
| 82 | + "dc.certifiable, " + | ||
| 83 | + "dc.err_code, " + | ||
| 84 | + "dc.end_time, " + | ||
| 85 | + "dc.secrecy, " + | ||
| 86 | + "dc.ip_address, " + | ||
| 87 | + "dc.port, " + | ||
| 88 | + "dc.password, " + | ||
| 89 | + "COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, " + | ||
| 90 | + "dc.status, " + | ||
| 91 | + "COALESCE(dc.custom_longitude, dc.longitude) AS longitude, " + | ||
| 92 | + "COALESCE(dc.custom_latitude, dc.latitude) AS latitude, " + | ||
| 93 | + "dc.stream_id, " + | ||
| 94 | + "dc.device_id, " + | ||
| 95 | + "dc.parental, " + | ||
| 96 | + "dc.has_audio, " + | ||
| 97 | + "dc.create_time, " + | ||
| 98 | + "dc.update_time, " + | ||
| 99 | + "dc.sub_count, " + | ||
| 100 | + "dc.longitude_gcj02, " + | ||
| 101 | + "dc.latitude_gcj02, " + | ||
| 102 | + "dc.longitude_wgs84, " + | ||
| 103 | + "dc.latitude_wgs84, " + | ||
| 104 | + "dc.business_group_id, " + | ||
| 105 | + "dc.gps_time " + | ||
| 71 | "from " + | 106 | "from " + |
| 72 | "wvp_device_channel dc " + | 107 | "wvp_device_channel dc " + |
| 73 | "WHERE " + | 108 | "WHERE " + |
| @@ -154,7 +189,7 @@ public interface DeviceChannelMapper { | @@ -154,7 +189,7 @@ public interface DeviceChannelMapper { | ||
| 154 | " dc.id,\n" + | 189 | " dc.id,\n" + |
| 155 | " dc.channel_id,\n" + | 190 | " dc.channel_id,\n" + |
| 156 | " dc.device_id,\n" + | 191 | " dc.device_id,\n" + |
| 157 | - " dc.name,\n" + | 192 | + " COALESCE(dc.custom_name, dc.name) AS name,\n" + |
| 158 | " de.manufacturer,\n" + | 193 | " de.manufacturer,\n" + |
| 159 | " de.host_address,\n" + | 194 | " de.host_address,\n" + |
| 160 | " dc.sub_count,\n" + | 195 | " dc.sub_count,\n" + |
| @@ -392,10 +427,10 @@ public interface DeviceChannelMapper { | @@ -392,10 +427,10 @@ public interface DeviceChannelMapper { | ||
| 392 | @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}") | 427 | @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}") |
| 393 | List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode); | 428 | List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode); |
| 394 | 429 | ||
| 395 | - @Select("select dc.id, dc.channel_id, dc.device_id, dc.name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " + | 430 | + @Select("select dc.id, dc.channel_id, dc.device_id, COALESCE(dc.custom_name, dc.name) AS name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " + |
| 396 | " dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " + | 431 | " dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " + |
| 397 | - " dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, dc.ptz_type, dc.password, dc.status, " + | ||
| 398 | - " dc.longitude_wgs84 as longitude, dc.latitude_wgs84 as latitude, pc.business_group_id " + | 432 | + " dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, dc.password, dc.status, " + |
| 433 | + " COALESCE(dc.custom_longitude, dc.longitude) AS longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " + | ||
| 399 | " from wvp_device_channel dc" + | 434 | " from wvp_device_channel dc" + |
| 400 | " LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" + | 435 | " LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" + |
| 401 | " LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" + | 436 | " LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" + |
| @@ -457,7 +492,44 @@ public interface DeviceChannelMapper { | @@ -457,7 +492,44 @@ public interface DeviceChannelMapper { | ||
| 457 | void clearPlay(String deviceId); | 492 | void clearPlay(String deviceId); |
| 458 | // 设备主子码流逻辑END | 493 | // 设备主子码流逻辑END |
| 459 | @Select(value = {" <script>" + | 494 | @Select(value = {" <script>" + |
| 460 | - "select * " + | 495 | + "SELECT id,\n" + |
| 496 | + " channel_id,\n" + | ||
| 497 | + " COALESCE(custom_name, name) AS name,\n" + | ||
| 498 | + " custom_name,\n" + | ||
| 499 | + " manufacture,\n" + | ||
| 500 | + " model,\n" + | ||
| 501 | + " owner,\n" + | ||
| 502 | + " civil_code,\n" + | ||
| 503 | + " block,\n" + | ||
| 504 | + " address,\n" + | ||
| 505 | + " parent_id,\n" + | ||
| 506 | + " safety_way,\n" + | ||
| 507 | + " register_way,\n" + | ||
| 508 | + " cert_num,\n" + | ||
| 509 | + " certifiable,\n" + | ||
| 510 | + " err_code,\n" + | ||
| 511 | + " end_time,\n" + | ||
| 512 | + " secrecy,\n" + | ||
| 513 | + " ip_address,\n" + | ||
| 514 | + " port,\n" + | ||
| 515 | + " password,\n" + | ||
| 516 | + " COALESCE(custom_ptz_type, ptz_type) AS ptz_type,\n" + | ||
| 517 | + " status,\n" + | ||
| 518 | + " COALESCE(custom_longitude, longitude) AS longitude,\n" + | ||
| 519 | + " COALESCE(custom_latitude, latitude) AS latitude,\n" + | ||
| 520 | + " stream_id,\n" + | ||
| 521 | + " device_id,\n" + | ||
| 522 | + " parental,\n" + | ||
| 523 | + " has_audio,\n" + | ||
| 524 | + " create_time,\n" + | ||
| 525 | + " update_time,\n" + | ||
| 526 | + " sub_count,\n" + | ||
| 527 | + " longitude_gcj02,\n" + | ||
| 528 | + " latitude_gcj02,\n" + | ||
| 529 | + " longitude_wgs84,\n" + | ||
| 530 | + " latitude_wgs84,\n" + | ||
| 531 | + " business_group_id,\n" + | ||
| 532 | + " gps_time\n" + | ||
| 461 | "from wvp_device_channel " + | 533 | "from wvp_device_channel " + |
| 462 | "where device_id=#{deviceId}" + | 534 | "where device_id=#{deviceId}" + |
| 463 | " <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" + | 535 | " <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" + |
src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray; | @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray; | ||
| 4 | import com.genersoft.iot.vmp.conf.DynamicTask; | 4 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 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.media.zlm.SendRtpPortManager; | 8 | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| 8 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | 9 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 9 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 10 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| @@ -15,6 +16,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -15,6 +16,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 15 | import com.github.pagehelper.PageInfo; | 16 | import com.github.pagehelper.PageInfo; |
| 16 | import io.swagger.v3.oas.annotations.Operation; | 17 | import io.swagger.v3.oas.annotations.Operation; |
| 17 | import io.swagger.v3.oas.annotations.Parameter; | 18 | import io.swagger.v3.oas.annotations.Parameter; |
| 19 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 18 | import io.swagger.v3.oas.annotations.tags.Tag; | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 19 | import org.apache.commons.lang3.ObjectUtils; | 21 | import org.apache.commons.lang3.ObjectUtils; |
| 20 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| @@ -46,7 +48,7 @@ public class CloudRecordController { | @@ -46,7 +48,7 @@ public class CloudRecordController { | ||
| 46 | 48 | ||
| 47 | @ResponseBody | 49 | @ResponseBody |
| 48 | @GetMapping("/date/list") | 50 | @GetMapping("/date/list") |
| 49 | - @Operation(summary = "查询存在云端录像的日期") | 51 | + @Operation(summary = "查询存在云端录像的日期", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 50 | @Parameter(name = "app", description = "应用名", required = true) | 52 | @Parameter(name = "app", description = "应用名", required = true) |
| 51 | @Parameter(name = "stream", description = "流ID", required = true) | 53 | @Parameter(name = "stream", description = "流ID", required = true) |
| 52 | @Parameter(name = "year", description = "年,置空则查询当年", required = false) | 54 | @Parameter(name = "year", description = "年,置空则查询当年", required = false) |
| @@ -89,7 +91,7 @@ public class CloudRecordController { | @@ -89,7 +91,7 @@ public class CloudRecordController { | ||
| 89 | 91 | ||
| 90 | @ResponseBody | 92 | @ResponseBody |
| 91 | @GetMapping("/list") | 93 | @GetMapping("/list") |
| 92 | - @Operation(summary = "分页查询云端录像") | 94 | + @Operation(summary = "分页查询云端录像"security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 93 | @Parameter(name = "query", description = "检索内容", required = false) | 95 | @Parameter(name = "query", description = "检索内容", required = false) |
| 94 | @Parameter(name = "app", description = "应用名", required = false) | 96 | @Parameter(name = "app", description = "应用名", required = false) |
| 95 | @Parameter(name = "stream", description = "流ID", required = false) | 97 | @Parameter(name = "stream", description = "流ID", 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
| @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 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.exception.SsrcTransactionNotFoundException; | 8 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 9 | +import com.genersoft.iot.vmp.conf.security.JwtUtils; | ||
| 9 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 10 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 10 | import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; | 11 | import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; |
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 12 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| @@ -23,6 +24,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | @@ -23,6 +24,7 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 23 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 24 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 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.slf4j.Logger; | 29 | import org.slf4j.Logger; |
| 28 | import org.slf4j.LoggerFactory; | 30 | import org.slf4j.LoggerFactory; |
| @@ -69,7 +71,7 @@ public class GBRecordController { | @@ -69,7 +71,7 @@ public class GBRecordController { | ||
| 69 | @Autowired | 71 | @Autowired |
| 70 | private UserSetting userSetting; | 72 | private UserSetting userSetting; |
| 71 | 73 | ||
| 72 | - @Operation(summary = "录像查询") | 74 | + @Operation(summary = "录像查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 73 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 75 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 74 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 76 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 75 | @Parameter(name = "startTime", description = "开始时间", required = true) | 77 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| @@ -123,7 +125,7 @@ public class GBRecordController { | @@ -123,7 +125,7 @@ public class GBRecordController { | ||
| 123 | } | 125 | } |
| 124 | 126 | ||
| 125 | 127 | ||
| 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 = "channelId", description = "通道国标编号", required = true) | 130 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 129 | @Parameter(name = "startTime", description = "开始时间", required = true) | 131 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| @@ -172,7 +174,7 @@ public class GBRecordController { | @@ -172,7 +174,7 @@ public class GBRecordController { | ||
| 172 | return result; | 174 | return result; |
| 173 | } | 175 | } |
| 174 | 176 | ||
| 175 | - @Operation(summary = "停止历史媒体下载") | 177 | + @Operation(summary = "停止历史媒体下载", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 176 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 178 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 177 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 179 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 178 | @Parameter(name = "stream", description = "流ID", required = true) | 180 | @Parameter(name = "stream", description = "流ID", required = true) |
| @@ -200,7 +202,7 @@ public class GBRecordController { | @@ -200,7 +202,7 @@ public class GBRecordController { | ||
| 200 | } | 202 | } |
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | - @Operation(summary = "获取历史媒体下载进度") | 205 | + @Operation(summary = "获取历史媒体下载进度", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 204 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 206 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 205 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 207 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 206 | @Parameter(name = "stream", description = "流ID", required = true) | 208 | @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
| @@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | @@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | ||
| 14 | import com.github.pagehelper.PageInfo; | 14 | import com.github.pagehelper.PageInfo; |
| 15 | import io.swagger.v3.oas.annotations.Operation; | 15 | import io.swagger.v3.oas.annotations.Operation; |
| 16 | import io.swagger.v3.oas.annotations.Parameter; | 16 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | +import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
| 17 | import io.swagger.v3.oas.annotations.tags.Tag; | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.security.authentication.AuthenticationManager; | 20 | import org.springframework.security.authentication.AuthenticationManager; |
| @@ -66,7 +67,7 @@ public class UserController { | @@ -66,7 +67,7 @@ public class UserController { | ||
| 66 | 67 | ||
| 67 | 68 | ||
| 68 | @PostMapping("/changePassword") | 69 | @PostMapping("/changePassword") |
| 69 | - @Operation(summary = "修改密码") | 70 | + @Operation(summary = "修改密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 70 | @Parameter(name = "username", description = "用户名", required = true) | 71 | @Parameter(name = "username", description = "用户名", required = true) |
| 71 | @Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true) | 72 | @Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true) |
| 72 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) | 73 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |
| @@ -95,7 +96,7 @@ public class UserController { | @@ -95,7 +96,7 @@ public class UserController { | ||
| 95 | 96 | ||
| 96 | 97 | ||
| 97 | @PostMapping("/add") | 98 | @PostMapping("/add") |
| 98 | - @Operation(summary = "添加用户") | 99 | + @Operation(summary = "添加用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 99 | @Parameter(name = "username", description = "用户名", required = true) | 100 | @Parameter(name = "username", description = "用户名", required = true) |
| 100 | @Parameter(name = "password", description = "密码(未md5加密的密码)", required = true) | 101 | @Parameter(name = "password", description = "密码(未md5加密的密码)", required = true) |
| 101 | @Parameter(name = "roleId", description = "角色ID", required = true) | 102 | @Parameter(name = "roleId", description = "角色ID", required = true) |
| @@ -131,7 +132,7 @@ public class UserController { | @@ -131,7 +132,7 @@ public class UserController { | ||
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | @DeleteMapping("/delete") | 134 | @DeleteMapping("/delete") |
| 134 | - @Operation(summary = "删除用户") | 135 | + @Operation(summary = "删除用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 135 | @Parameter(name = "id", description = "用户Id", required = true) | 136 | @Parameter(name = "id", description = "用户Id", required = true) |
| 136 | public void delete(@RequestParam Integer id){ | 137 | public void delete(@RequestParam Integer id){ |
| 137 | // 获取当前登录用户id | 138 | // 获取当前登录用户id |
| @@ -147,7 +148,7 @@ public class UserController { | @@ -147,7 +148,7 @@ public class UserController { | ||
| 147 | } | 148 | } |
| 148 | 149 | ||
| 149 | @GetMapping("/all") | 150 | @GetMapping("/all") |
| 150 | - @Operation(summary = "查询用户") | 151 | + @Operation(summary = "查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 151 | public List<User> all(){ | 152 | public List<User> all(){ |
| 152 | // 获取当前登录用户id | 153 | // 获取当前登录用户id |
| 153 | return userService.getAllUsers(); | 154 | return userService.getAllUsers(); |
| @@ -161,7 +162,7 @@ public class UserController { | @@ -161,7 +162,7 @@ public class UserController { | ||
| 161 | * @return 分页用户列表 | 162 | * @return 分页用户列表 |
| 162 | */ | 163 | */ |
| 163 | @GetMapping("/users") | 164 | @GetMapping("/users") |
| 164 | - @Operation(summary = "分页查询用户") | 165 | + @Operation(summary = "分页查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 165 | @Parameter(name = "page", description = "当前页", required = true) | 166 | @Parameter(name = "page", description = "当前页", required = true) |
| 166 | @Parameter(name = "count", description = "每页查询数量", required = true) | 167 | @Parameter(name = "count", description = "每页查询数量", required = true) |
| 167 | public PageInfo<User> users(int page, int count) { | 168 | public PageInfo<User> users(int page, int count) { |
| @@ -169,7 +170,7 @@ public class UserController { | @@ -169,7 +170,7 @@ public class UserController { | ||
| 169 | } | 170 | } |
| 170 | 171 | ||
| 171 | @RequestMapping("/changePushKey") | 172 | @RequestMapping("/changePushKey") |
| 172 | - @Operation(summary = "修改pushkey") | 173 | + @Operation(summary = "修改pushkey", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 173 | @Parameter(name = "userId", description = "用户Id", required = true) | 174 | @Parameter(name = "userId", description = "用户Id", required = true) |
| 174 | @Parameter(name = "pushKey", description = "新的pushKey", required = true) | 175 | @Parameter(name = "pushKey", description = "新的pushKey", required = true) |
| 175 | public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) { | 176 | public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) { |
| @@ -187,7 +188,7 @@ public class UserController { | @@ -187,7 +188,7 @@ public class UserController { | ||
| 187 | } | 188 | } |
| 188 | 189 | ||
| 189 | @PostMapping("/changePasswordForAdmin") | 190 | @PostMapping("/changePasswordForAdmin") |
| 190 | - @Operation(summary = "管理员修改普通用户密码") | 191 | + @Operation(summary = "管理员修改普通用户密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| 191 | @Parameter(name = "adminId", description = "管理员id", required = true) | 192 | @Parameter(name = "adminId", description = "管理员id", required = true) |
| 192 | @Parameter(name = "userId", description = "用户id", required = true) | 193 | @Parameter(name = "userId", description = "用户id", required = true) |
| 193 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) | 194 | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |
web_src/src/components/channelList.vue
| @@ -33,98 +33,156 @@ | @@ -33,98 +33,156 @@ | ||
| 33 | <el-option label="流畅" :value="true"></el-option> | 33 | <el-option label="流畅" :value="true"></el-option> |
| 34 | </el-select> | 34 | </el-select> |
| 35 | </div> | 35 | </div> |
| 36 | - <el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button> | ||
| 37 | - <el-button v-if="showTree" icon="iconfont icon-list" circle size="mini" @click="switchList()"></el-button> | ||
| 38 | - <el-button v-if="!showTree" icon="iconfont icon-tree" circle size="mini" @click="switchTree()"></el-button> | 36 | + <el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button> |
| 37 | + <el-button v-if="showTree" icon="iconfont icon-list" circle size="mini" @click="switchList()"></el-button> | ||
| 38 | + <el-button v-if="!showTree" icon="iconfont icon-tree" circle size="mini" @click="switchTree()"></el-button> | ||
| 39 | + </div> | ||
| 39 | </div> | 40 | </div> |
| 40 | - </div> | ||
| 41 | - <devicePlayer ref="devicePlayer" ></devicePlayer> | ||
| 42 | - <el-container v-loading="isLoging" style="height: 82vh;"> | ||
| 43 | - <el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto" v-if="showTree" > | ||
| 44 | - <DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent" ></DeviceTree> | ||
| 45 | - </el-aside> | ||
| 46 | - <el-main style="padding: 5px;"> | ||
| 47 | - <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" header-row-class-name="table-header"> | ||
| 48 | - <el-table-column prop="channelId" label="通道编号" min-width="200"> | ||
| 49 | - </el-table-column> | ||
| 50 | - <el-table-column prop="deviceId" label="设备编号" min-width="200"> | ||
| 51 | - </el-table-column> | ||
| 52 | - <el-table-column prop="name" label="通道名称" min-width="200"> | ||
| 53 | - </el-table-column> | ||
| 54 | - <el-table-column label="快照" min-width="120"> | ||
| 55 | - <template v-slot:default="scope"> | ||
| 56 | - <el-image | ||
| 57 | - :src="getSnap(scope.row)" | ||
| 58 | - :preview-src-list="getBigSnap(scope.row)" | ||
| 59 | - @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)" | ||
| 60 | - :fit="'contain'" | ||
| 61 | - style="width: 60px"> | ||
| 62 | - <div slot="error" class="image-slot"> | ||
| 63 | - <i class="el-icon-picture-outline"></i> | 41 | + <devicePlayer ref="devicePlayer"></devicePlayer> |
| 42 | + <el-container v-loading="isLoging" style="height: 82vh;"> | ||
| 43 | + <el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto" v-if="showTree"> | ||
| 44 | + <DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent"></DeviceTree> | ||
| 45 | + </el-aside> | ||
| 46 | + <el-main style="padding: 5px;"> | ||
| 47 | + <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" | ||
| 48 | + header-row-class-name="table-header"> | ||
| 49 | + <el-table-column prop="channelId" label="通道编号" min-width="200"> | ||
| 50 | + </el-table-column> | ||
| 51 | + <el-table-column prop="deviceId" label="设备编号" min-width="200"> | ||
| 52 | + </el-table-column> | ||
| 53 | + <el-table-column prop="name" label="通道名称" min-width="200"> | ||
| 54 | + <template v-slot:default="scope"> | ||
| 55 | + <el-input | ||
| 56 | + v-show="scope.row.edit" | ||
| 57 | + v-model="scope.row.name" | ||
| 58 | + placeholder="通道名称" | ||
| 59 | + :maxlength="255" | ||
| 60 | + show-word-limit | ||
| 61 | + clearable | ||
| 62 | + /> | ||
| 63 | + <span v-show="!scope.row.edit">{{ scope.row.name }}</span> | ||
| 64 | + </template> | ||
| 65 | + </el-table-column> | ||
| 66 | + <el-table-column label="快照" min-width="120"> | ||
| 67 | + <template v-slot:default="scope"> | ||
| 68 | + <el-image | ||
| 69 | + :src="getSnap(scope.row)" | ||
| 70 | + :preview-src-list="getBigSnap(scope.row)" | ||
| 71 | + @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)" | ||
| 72 | + :fit="'contain'" | ||
| 73 | + style="width: 60px"> | ||
| 74 | + <div slot="error" class="image-slot"> | ||
| 75 | + <i class="el-icon-picture-outline"></i> | ||
| 76 | + </div> | ||
| 77 | + </el-image> | ||
| 78 | + </template> | ||
| 79 | + </el-table-column> | ||
| 80 | + <el-table-column prop="subCount" label="子节点数" min-width="120"> | ||
| 81 | + </el-table-column> | ||
| 82 | + <el-table-column prop="manufacture" label="厂家" min-width="120"> | ||
| 83 | + </el-table-column> | ||
| 84 | + <el-table-column label="位置信息" min-width="200"> | ||
| 85 | + <template v-slot:default="scope"> | ||
| 86 | + <el-input | ||
| 87 | + v-show="scope.row.edit" | ||
| 88 | + v-model="scope.row.location" | ||
| 89 | + placeholder="例:117.234,36.378" | ||
| 90 | + :maxlength="30" | ||
| 91 | + show-word-limit | ||
| 92 | + clearable | ||
| 93 | + /> | ||
| 94 | + <span v-show="!scope.row.edit">{{ scope.row.location }}</span> | ||
| 95 | + </template> | ||
| 96 | + </el-table-column> | ||
| 97 | + <el-table-column prop="PTZType" label="云台类型" min-width="120"> | ||
| 98 | + <template v-slot:default="scope"> | ||
| 99 | + <el-select v-show="scope.row.edit" v-model="scope.row.PTZType" | ||
| 100 | + placeholder="云台类型" filterable> | ||
| 101 | + <el-option | ||
| 102 | + v-for="(value, key) in ptzTypes" | ||
| 103 | + :key="key" | ||
| 104 | + :label="value" | ||
| 105 | + :value="key" | ||
| 106 | + /> | ||
| 107 | + </el-select> | ||
| 108 | + <div v-show="!scope.row.edit">{{ scope.row.PTZTypeText }}</div> | ||
| 109 | + </template> | ||
| 110 | + </el-table-column> | ||
| 111 | + <el-table-column label="开启音频" min-width="120"> | ||
| 112 | + <template slot-scope="scope"> | ||
| 113 | + <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF"> | ||
| 114 | + </el-switch> | ||
| 115 | + </template> | ||
| 116 | + </el-table-column> | ||
| 117 | + <el-table-column label="状态" min-width="120"> | ||
| 118 | + <template slot-scope="scope"> | ||
| 119 | + <div slot="reference" class="name-wrapper"> | ||
| 120 | + <el-tag size="medium" v-if="scope.row.status === true">在线</el-tag> | ||
| 121 | + <el-tag size="medium" type="info" v-if="scope.row.status === false">离线</el-tag> | ||
| 64 | </div> | 122 | </div> |
| 65 | - </el-image> | ||
| 66 | - </template> | ||
| 67 | - </el-table-column> | ||
| 68 | - <el-table-column prop="subCount" label="子节点数" min-width="120"> | ||
| 69 | - </el-table-column> | ||
| 70 | - <el-table-column prop="manufacture" label="厂家" min-width="120"> | ||
| 71 | - </el-table-column> | ||
| 72 | - <el-table-column label="位置信息" min-width="200"> | ||
| 73 | - <template slot-scope="scope"> | ||
| 74 | - <span v-if="scope.row.longitude*scope.row.latitude > 0">{{ scope.row.longitude }},<br>{{ scope.row.latitude }}</span> | ||
| 75 | - <span v-if="scope.row.longitude*scope.row.latitude === 0">无</span> | ||
| 76 | - </template> | ||
| 77 | - </el-table-column> | ||
| 78 | - <el-table-column prop="PTZTypeText" label="云台类型" min-width="120"/> | ||
| 79 | - <el-table-column label="开启音频" min-width="120"> | ||
| 80 | - <template slot-scope="scope"> | ||
| 81 | - <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF"> | ||
| 82 | - </el-switch> | ||
| 83 | - </template> | ||
| 84 | - </el-table-column> | ||
| 85 | - <el-table-column label="状态" min-width="120"> | ||
| 86 | - <template slot-scope="scope"> | ||
| 87 | - <div slot="reference" class="name-wrapper"> | ||
| 88 | - <el-tag size="medium" v-if="scope.row.status === true">在线</el-tag> | ||
| 89 | - <el-tag size="medium" type="info" v-if="scope.row.status === false">离线</el-tag> | ||
| 90 | - </div> | ||
| 91 | - </template> | ||
| 92 | - </el-table-column> | 123 | + </template> |
| 124 | + </el-table-column> | ||
| 93 | 125 | ||
| 94 | 126 | ||
| 95 | - <el-table-column label="操作" min-width="280" fixed="right"> | ||
| 96 | - <template slot-scope="scope"> | ||
| 97 | - <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-play" type="text" @click="sendDevicePush(scope.row)">播放</el-button> | ||
| 98 | - <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-switch-button" type="text" style="color: #f56c6c" v-if="!!scope.row.streamId" | ||
| 99 | - @click="stopDevicePush(scope.row)">停止 | ||
| 100 | - </el-button> | ||
| 101 | - <el-divider direction="vertical"></el-divider> | ||
| 102 | - <el-button size="medium" icon="el-icon-s-open" type="text" v-if="scope.row.subCount > 0 || scope.row.parental === 1" | ||
| 103 | - @click="changeSubchannel(scope.row)">查看 | ||
| 104 | - </el-button> | ||
| 105 | - <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider> | ||
| 106 | - <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-camera" type="text" @click="queryRecords(scope.row)">设备录像 | ||
| 107 | - </el-button> | ||
| 108 | - <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-cloudy" | ||
| 109 | - type="text" @click="queryCloudRecords(scope.row)">云端录像 | ||
| 110 | - </el-button> | ||
| 111 | - </template> | ||
| 112 | - </el-table-column> | ||
| 113 | - </el-table> | ||
| 114 | - <el-pagination | ||
| 115 | - style="float: right" | ||
| 116 | - @size-change="handleSizeChange" | ||
| 117 | - @current-change="currentChange" | ||
| 118 | - :current-page="currentPage" | ||
| 119 | - :page-size="count" | ||
| 120 | - :page-sizes="[15, 25, 35, 50]" | ||
| 121 | - layout="total, sizes, prev, pager, next" | ||
| 122 | - :total="total"> | ||
| 123 | - </el-pagination> | ||
| 124 | - </el-main> | ||
| 125 | - </el-container> | 127 | + <el-table-column label="操作" min-width="340" fixed="right"> |
| 128 | + <template slot-scope="scope"> | ||
| 129 | + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-play" | ||
| 130 | + type="text" @click="sendDevicePush(scope.row)">播放 | ||
| 131 | + </el-button> | ||
| 132 | + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" | ||
| 133 | + icon="el-icon-switch-button" | ||
| 134 | + type="text" style="color: #f56c6c" v-if="!!scope.row.streamId" | ||
| 135 | + @click="stopDevicePush(scope.row)">停止 | ||
| 136 | + </el-button> | ||
| 137 | + <el-divider direction="vertical"></el-divider> | ||
| 138 | + <el-button | ||
| 139 | + v-if="scope.row.edit" | ||
| 140 | + size="medium" | ||
| 141 | + type="text" | ||
| 142 | + icon="el-icon-edit-outline" | ||
| 143 | + @click="handleSave(scope.row)" | ||
| 144 | + > | ||
| 145 | + 保存 | ||
| 146 | + </el-button> | ||
| 147 | + <el-button | ||
| 148 | + v-else | ||
| 149 | + size="medium" | ||
| 150 | + type="text" | ||
| 151 | + icon="el-icon-edit" | ||
| 152 | + @click="handleEdit(scope.row)" | ||
| 153 | + > | ||
| 154 | + 编辑 | ||
| 155 | + </el-button> | ||
| 156 | + <el-divider direction="vertical"></el-divider> | ||
| 157 | + <el-button size="medium" icon="el-icon-s-open" type="text" | ||
| 158 | + v-if="scope.row.subCount > 0 || scope.row.parental === 1" | ||
| 159 | + @click="changeSubchannel(scope.row)">查看 | ||
| 160 | + </el-button> | ||
| 161 | + <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider> | ||
| 162 | + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" | ||
| 163 | + icon="el-icon-video-camera" | ||
| 164 | + type="text" @click="queryRecords(scope.row)">设备录像 | ||
| 165 | + </el-button> | ||
| 166 | + <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-cloudy" | ||
| 167 | + type="text" @click="queryCloudRecords(scope.row)">云端录像 | ||
| 168 | + </el-button> | ||
| 169 | + </template> | ||
| 170 | + </el-table-column> | ||
| 171 | + </el-table> | ||
| 172 | + <el-pagination | ||
| 173 | + style="float: right" | ||
| 174 | + @size-change="handleSizeChange" | ||
| 175 | + @current-change="currentChange" | ||
| 176 | + :current-page="currentPage" | ||
| 177 | + :page-size="count" | ||
| 178 | + :page-sizes="[15, 25, 35, 50]" | ||
| 179 | + layout="total, sizes, prev, pager, next" | ||
| 180 | + :total="total"> | ||
| 181 | + </el-pagination> | ||
| 182 | + </el-main> | ||
| 183 | + </el-container> | ||
| 126 | 184 | ||
| 127 | - <!--设备列表--> | 185 | + <!--设备列表--> |
| 128 | 186 | ||
| 129 | </div> | 187 | </div> |
| 130 | </template> | 188 | </template> |
| @@ -163,16 +221,23 @@ export default { | @@ -163,16 +221,23 @@ export default { | ||
| 163 | beforeUrl: "/deviceList", | 221 | beforeUrl: "/deviceList", |
| 164 | isLoging: false, | 222 | isLoging: false, |
| 165 | showTree: false, | 223 | showTree: false, |
| 166 | - loadSnap: {} | 224 | + loadSnap: {}, |
| 225 | + ptzTypes: { | ||
| 226 | + 0: "未知", | ||
| 227 | + 1: "球机", | ||
| 228 | + 2: "半球", | ||
| 229 | + 3: "固定枪机", | ||
| 230 | + 4: "遥控枪机" | ||
| 231 | + } | ||
| 167 | }; | 232 | }; |
| 168 | }, | 233 | }, |
| 169 | 234 | ||
| 170 | mounted() { | 235 | mounted() { |
| 171 | if (this.deviceId) { | 236 | if (this.deviceId) { |
| 172 | - this.deviceService.getDevice(this.deviceId, (result)=>{ | ||
| 173 | - this.device = result; | 237 | + this.deviceService.getDevice(this.deviceId, (result) => { |
| 238 | + this.device = result; | ||
| 174 | 239 | ||
| 175 | - }, (error)=>{ | 240 | + }, (error) => { |
| 176 | console.log("获取设备信息失败") | 241 | console.log("获取设备信息失败") |
| 177 | console.error(error) | 242 | console.error(error) |
| 178 | }) | 243 | }) |
| @@ -227,6 +292,14 @@ export default { | @@ -227,6 +292,14 @@ export default { | ||
| 227 | if (res.data.code === 0) { | 292 | if (res.data.code === 0) { |
| 228 | that.total = res.data.data.total; | 293 | that.total = res.data.data.total; |
| 229 | that.deviceChannelList = res.data.data.list; | 294 | that.deviceChannelList = res.data.data.list; |
| 295 | + that.deviceChannelList.forEach(e => { | ||
| 296 | + e.PTZType = e.PTZType + ""; | ||
| 297 | + that.$set(e, "edit", false); | ||
| 298 | + that.$set(e, "location", ""); | ||
| 299 | + if (e.longitude && e.latitude) { | ||
| 300 | + that.$set(e, "location", e.longitude + "," + e.latitude); | ||
| 301 | + } | ||
| 302 | + }); | ||
| 230 | // 防止出现表格错位 | 303 | // 防止出现表格错位 |
| 231 | that.$nextTick(() => { | 304 | that.$nextTick(() => { |
| 232 | that.$refs.channelListTable.doLayout(); | 305 | that.$refs.channelListTable.doLayout(); |
| @@ -248,7 +321,7 @@ export default { | @@ -248,7 +321,7 @@ export default { | ||
| 248 | this.$axios({ | 321 | this.$axios({ |
| 249 | method: 'get', | 322 | method: 'get', |
| 250 | url: '/api/play/start/' + deviceId + '/' + channelId, | 323 | url: '/api/play/start/' + deviceId + '/' + channelId, |
| 251 | - params:{ | 324 | + params: { |
| 252 | isSubStream: this.isSubStream | 325 | isSubStream: this.isSubStream |
| 253 | } | 326 | } |
| 254 | }).then(function (res) { | 327 | }).then(function (res) { |
| @@ -271,7 +344,7 @@ export default { | @@ -271,7 +344,7 @@ export default { | ||
| 271 | that.initData(); | 344 | that.initData(); |
| 272 | }, 1000) | 345 | }, 1000) |
| 273 | 346 | ||
| 274 | - }else{ | 347 | + } else { |
| 275 | that.$message.error(res.data.msg); | 348 | that.$message.error(res.data.msg); |
| 276 | } | 349 | } |
| 277 | }).catch(function (e) { | 350 | }).catch(function (e) { |
| @@ -297,7 +370,7 @@ export default { | @@ -297,7 +370,7 @@ export default { | ||
| 297 | this.$axios({ | 370 | this.$axios({ |
| 298 | method: 'get', | 371 | method: 'get', |
| 299 | url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId, | 372 | url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId, |
| 300 | - params:{ | 373 | + params: { |
| 301 | isSubStream: this.isSubStream | 374 | isSubStream: this.isSubStream |
| 302 | } | 375 | } |
| 303 | }).then(function (res) { | 376 | }).then(function (res) { |
| @@ -326,7 +399,7 @@ export default { | @@ -326,7 +399,7 @@ export default { | ||
| 326 | return; | 399 | return; |
| 327 | } | 400 | } |
| 328 | setTimeout(() => { | 401 | setTimeout(() => { |
| 329 | - let url = (process.env.NODE_ENV === 'development'? "debug": "") + '/api/device/query/snap/' + deviceId + '/' + channelId | 402 | + let url = (process.env.NODE_ENV === 'development' ? "debug" : "") + '/api/device/query/snap/' + deviceId + '/' + channelId |
| 330 | this.loadSnap[deviceId + channelId]++ | 403 | this.loadSnap[deviceId + channelId]++ |
| 331 | document.getElementById(deviceId + channelId).setAttribute("src", url + '?' + new Date().getTime()) | 404 | document.getElementById(deviceId + channelId).setAttribute("src", url + '?' + new Date().getTime()) |
| 332 | }, 1000) | 405 | }, 1000) |
| @@ -363,10 +436,18 @@ export default { | @@ -363,10 +436,18 @@ export default { | ||
| 363 | online: this.online, | 436 | online: this.online, |
| 364 | channelType: this.channelType | 437 | channelType: this.channelType |
| 365 | } | 438 | } |
| 366 | - }).then( (res) =>{ | 439 | + }).then((res) => { |
| 367 | if (res.data.code === 0) { | 440 | if (res.data.code === 0) { |
| 368 | this.total = res.data.data.total; | 441 | this.total = res.data.data.total; |
| 369 | this.deviceChannelList = res.data.data.list; | 442 | this.deviceChannelList = res.data.data.list; |
| 443 | + this.deviceChannelList.forEach(e => { | ||
| 444 | + e.PTZType = e.PTZType + ""; | ||
| 445 | + this.$set(e, "edit", false); | ||
| 446 | + this.$set(e, "location", ""); | ||
| 447 | + if (e.longitude && e.latitude) { | ||
| 448 | + this.$set(e, "location", e.longitude + "," + e.latitude); | ||
| 449 | + } | ||
| 450 | + }); | ||
| 370 | // 防止出现表格错位 | 451 | // 防止出现表格错位 |
| 371 | this.$nextTick(() => { | 452 | this.$nextTick(() => { |
| 372 | this.$refs.channelListTable.doLayout(); | 453 | this.$refs.channelListTable.doLayout(); |
| @@ -376,7 +457,7 @@ export default { | @@ -376,7 +457,7 @@ export default { | ||
| 376 | }).catch(function (error) { | 457 | }).catch(function (error) { |
| 377 | console.log(error); | 458 | console.log(error); |
| 378 | }); | 459 | }); |
| 379 | - }else { | 460 | + } else { |
| 380 | this.$axios({ | 461 | this.$axios({ |
| 381 | method: 'get', | 462 | method: 'get', |
| 382 | url: `/api/device/query/tree/channel/${this.deviceId}`, | 463 | url: `/api/device/query/tree/channel/${this.deviceId}`, |
| @@ -385,7 +466,7 @@ export default { | @@ -385,7 +466,7 @@ export default { | ||
| 385 | page: this.currentPage, | 466 | page: this.currentPage, |
| 386 | count: this.count, | 467 | count: this.count, |
| 387 | } | 468 | } |
| 388 | - }).then((res)=> { | 469 | + }).then((res) => { |
| 389 | if (res.data.code === 0) { | 470 | if (res.data.code === 0) { |
| 390 | this.total = res.data.total; | 471 | this.total = res.data.total; |
| 391 | this.deviceChannelList = res.data.list; | 472 | this.deviceChannelList = res.data.list; |
| @@ -417,14 +498,14 @@ export default { | @@ -417,14 +498,14 @@ export default { | ||
| 417 | refresh: function () { | 498 | refresh: function () { |
| 418 | this.initData(); | 499 | this.initData(); |
| 419 | }, | 500 | }, |
| 420 | - switchTree: function (){ | 501 | + switchTree: function () { |
| 421 | this.showTree = true; | 502 | this.showTree = true; |
| 422 | this.deviceChannelList = []; | 503 | this.deviceChannelList = []; |
| 423 | this.parentChannelId = 0; | 504 | this.parentChannelId = 0; |
| 424 | this.currentPage = 1; | 505 | this.currentPage = 1; |
| 425 | 506 | ||
| 426 | }, | 507 | }, |
| 427 | - switchList: function (){ | 508 | + switchList: function () { |
| 428 | this.showTree = false; | 509 | this.showTree = false; |
| 429 | this.deviceChannelList = []; | 510 | this.deviceChannelList = []; |
| 430 | this.parentChannelId = 0; | 511 | this.parentChannelId = 0; |
| @@ -435,12 +516,70 @@ export default { | @@ -435,12 +516,70 @@ export default { | ||
| 435 | console.log(device) | 516 | console.log(device) |
| 436 | if (!!!data.channelId) { | 517 | if (!!!data.channelId) { |
| 437 | this.parentChannelId = device.deviceId; | 518 | this.parentChannelId = device.deviceId; |
| 438 | - }else { | 519 | + } else { |
| 439 | this.parentChannelId = data.channelId; | 520 | this.parentChannelId = data.channelId; |
| 440 | } | 521 | } |
| 441 | this.initData(); | 522 | this.initData(); |
| 442 | - } | 523 | + }, |
| 524 | + // 保存 | ||
| 525 | + handleSave(row) { | ||
| 526 | + if (row.location) { | ||
| 527 | + const segements = row.location.split(","); | ||
| 528 | + if (segements.length !== 2) { | ||
| 529 | + this.$message.warning("位置信息格式有误,例:117.234,36.378"); | ||
| 530 | + return; | ||
| 531 | + } else { | ||
| 532 | + row.longitude = parseFloat(segements[0]); | ||
| 533 | + row.latitude = parseFloat(segements[1]); | ||
| 534 | + if (!(row.longitude && row.latitude)) { | ||
| 535 | + this.$message.warning("位置信息格式有误,例:117.234,36.378"); | ||
| 536 | + return; | ||
| 537 | + } | ||
| 538 | + } | ||
| 539 | + } else { | ||
| 540 | + delete row.longitude; | ||
| 541 | + delete row.latitude; | ||
| 542 | + } | ||
| 543 | + Object.keys(row).forEach(key => { | ||
| 544 | + const value = row[key]; | ||
| 545 | + if (value === null || value === undefined || (typeof value === "string" && value.trim() === "")) { | ||
| 546 | + delete row[key]; | ||
| 547 | + } | ||
| 548 | + }); | ||
| 549 | + this.$axios({ | ||
| 550 | + method: 'post', | ||
| 551 | + url: `/api/device/query/channel/update/${this.deviceId}`, | ||
| 552 | + params: row | ||
| 553 | + }).then(response => { | ||
| 554 | + if (response.data.code === 0) { | ||
| 555 | + this.$message.success("修改成功!"); | ||
| 556 | + this.initData(); | ||
| 557 | + } else { | ||
| 558 | + this.$message.error("修改失败!"); | ||
| 559 | + } | ||
| 560 | + }).catch(_ => { | ||
| 561 | + this.$message.error("修改失败!"); | ||
| 562 | + }) | ||
| 563 | + }, | ||
| 564 | + // 是否正在编辑 | ||
| 565 | + isEdit() { | ||
| 566 | + let editing = false; | ||
| 567 | + this.deviceChannelList.forEach(e => { | ||
| 568 | + if (e.edit) { | ||
| 569 | + editing = true; | ||
| 570 | + } | ||
| 571 | + }); | ||
| 443 | 572 | ||
| 573 | + return editing; | ||
| 574 | + }, | ||
| 575 | + // 编辑 | ||
| 576 | + handleEdit(row) { | ||
| 577 | + if (this.isEdit()) { | ||
| 578 | + this.$message.warning('请保存当前编辑项!'); | ||
| 579 | + } else { | ||
| 580 | + row.edit = true; | ||
| 581 | + } | ||
| 582 | + } | ||
| 444 | } | 583 | } |
| 445 | }; | 584 | }; |
| 446 | </script> | 585 | </script> |