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
| | |
| | | </dependency> |
| | | |
| | | <!--在线文档 --> |
| | | <!--在线文档 --> |
| | | <dependency> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-ui</artifactId> |
| | | <version>1.7.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | <version>1.6.10</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | <version>2.2</version> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-security</artifactId> |
| | | <version>1.6.10</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | package com.genersoft.iot.vmp.conf; |
| | | |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import io.swagger.v3.oas.models.Components; |
| | | import io.swagger.v3.oas.models.OpenAPI; |
| | | import io.swagger.v3.oas.models.info.Contact; |
| | | import io.swagger.v3.oas.models.info.Info; |
| | | import io.swagger.v3.oas.models.info.License; |
| | | import io.swagger.v3.oas.models.security.SecurityScheme; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springdoc.core.GroupedOpenApi; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | contact.setName("pan"); |
| | | contact.setEmail("648540858@qq.com"); |
| | | return new OpenAPI() |
| | | .components(new Components() |
| | | .addSecuritySchemes(JwtUtils.HEADER, new SecurityScheme() |
| | | .type(SecurityScheme.Type.HTTP) |
| | | .bearerFormat("JWT"))) |
| | | .info(new Info().title("WVP-PRO 接口文档") |
| | | .contact(contact) |
| | | .description("开箱即用的28181协议视频平台") |
| | | .version("v2.0") |
| | | .version("v3.1.0") |
| | | .license(new License().name("Apache 2.0").url("http://springdoc.org"))); |
| | | } |
| | | |
| | |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(JwtUtils.class); |
| | | |
| | | private static final String HEADER = "access-token"; |
| | | public static final String HEADER = "access-token"; |
| | | |
| | | private static final String AUDIENCE = "Audience"; |
| | | |
| | |
| | | matchers.add("/"); |
| | | matchers.add("/#/**"); |
| | | matchers.add("/static/**"); |
| | | matchers.add("/swagger-ui.html"); |
| | | matchers.add("/swagger-ui/"); |
| | | matchers.add("/index.html"); |
| | | matchers.add("/doc.html"); |
| | | matchers.add("/webjars/**"); |
| | |
| | | matchers.add("/api/device/query/snap/**"); |
| | | matchers.add("/record_proxy/*/**"); |
| | | matchers.add("/api/emit"); |
| | | matchers.add("/favicon.ico"); |
| | | // 可以直接访问的静态数据 |
| | | web.ignoring().antMatchers(matchers.toArray(new String[0])); |
| | | } |
| | |
| | | .authorizeRequests() |
| | | .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() |
| | | .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll() |
| | | .antMatchers("/api/user/login","/index/hook/**","/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4").permitAll() |
| | | .antMatchers("/api/user/login", "/index/hook/**", "/swagger-ui/**", "/doc.html").permitAll() |
| | | .anyRequest().authenticated() |
| | | // 异常处理器 |
| | | .and() |
| | |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.math.NumberUtils; |
| | | import org.dom4j.Attribute; |
| | | import org.dom4j.Document; |
| | |
| | | return deviceChannel; |
| | | } |
| | | Element nameElement = itemDevice.element("Name"); |
| | | if (nameElement != null) { |
| | | // 当通道名称为空时,设置通道名称为通道编码,避免级联时因通道名称为空导致上级接收通道失败 |
| | | if (nameElement != null && StringUtils.isNotBlank(nameElement.getText())) { |
| | | deviceChannel.setName(nameElement.getText()); |
| | | } else { |
| | | deviceChannel.setName(channelId); |
| | | } |
| | | if(channelId.length() <= 8) { |
| | | deviceChannel.setHasAudio(false); |
| | |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| | | import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend; |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | @Update(value = {" <script>" + |
| | | "UPDATE wvp_device_channel " + |
| | | "SET update_time=#{updateTime}" + |
| | | "<if test='name != null'>, name=#{name}</if>" + |
| | | ", custom_name=#{name}" + |
| | | "<if test='manufacture != null'>, manufacture=#{manufacture}</if>" + |
| | | "<if test='model != null'>, model=#{model}</if>" + |
| | | "<if test='owner != null'>, owner=#{owner}</if>" + |
| | |
| | | "<if test='ipAddress != null'>, ip_address=#{ipAddress}</if>" + |
| | | "<if test='port != null'>, port=#{port}</if>" + |
| | | "<if test='password != null'>, password=#{password}</if>" + |
| | | "<if test='PTZType != null'>, ptz_type=#{PTZType}</if>" + |
| | | "<if test='PTZType != null'>, custom_ptz_type=#{PTZType}</if>" + |
| | | "<if test='status != null'>, status=#{status}</if>" + |
| | | "<if test='streamId != null'>, stream_id=#{streamId}</if>" + |
| | | "<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" + |
| | | "<if test='longitude != null'>, longitude=#{longitude}</if>" + |
| | | "<if test='latitude != null'>, latitude=#{latitude}</if>" + |
| | | ", custom_longitude=#{longitude}" + |
| | | ", custom_latitude=#{latitude}" + |
| | | "<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" + |
| | | "<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" + |
| | | "<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" + |
| | |
| | | |
| | | @Select(value = {" <script>" + |
| | | "SELECT " + |
| | | "dc.* " + |
| | | "dc.id, " + |
| | | "dc.channel_id, " + |
| | | "COALESCE(dc.custom_name, dc.name) AS name, " + |
| | | "dc.manufacture, " + |
| | | "dc.model, " + |
| | | "dc.owner, " + |
| | | "dc.civil_code, " + |
| | | "dc.block, " + |
| | | "dc.address, " + |
| | | "dc.parent_id, " + |
| | | "dc.safety_way, " + |
| | | "dc.register_way, " + |
| | | "dc.cert_num, " + |
| | | "dc.certifiable, " + |
| | | "dc.err_code, " + |
| | | "dc.end_time, " + |
| | | "dc.secrecy, " + |
| | | "dc.ip_address, " + |
| | | "dc.port, " + |
| | | "dc.password, " + |
| | | "COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, " + |
| | | "dc.status, " + |
| | | "COALESCE(dc.custom_longitude, dc.longitude) AS longitude, " + |
| | | "COALESCE(dc.custom_latitude, dc.latitude) AS latitude, " + |
| | | "dc.stream_id, " + |
| | | "dc.device_id, " + |
| | | "dc.parental, " + |
| | | "dc.has_audio, " + |
| | | "dc.create_time, " + |
| | | "dc.update_time, " + |
| | | "dc.sub_count, " + |
| | | "dc.longitude_gcj02, " + |
| | | "dc.latitude_gcj02, " + |
| | | "dc.longitude_wgs84, " + |
| | | "dc.latitude_wgs84, " + |
| | | "dc.business_group_id, " + |
| | | "dc.gps_time " + |
| | | "from " + |
| | | "wvp_device_channel dc " + |
| | | "WHERE " + |
| | |
| | | " dc.id,\n" + |
| | | " dc.channel_id,\n" + |
| | | " dc.device_id,\n" + |
| | | " dc.name,\n" + |
| | | " COALESCE(dc.custom_name, dc.name) AS name,\n" + |
| | | " de.manufacturer,\n" + |
| | | " de.host_address,\n" + |
| | | " dc.sub_count,\n" + |
| | |
| | | @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}") |
| | | List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode); |
| | | |
| | | @Select("select dc.id, dc.channel_id, dc.device_id, dc.name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " + |
| | | @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, " + |
| | | " 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, " + |
| | | " dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, dc.ptz_type, dc.password, dc.status, " + |
| | | " dc.longitude_wgs84 as longitude, dc.latitude_wgs84 as latitude, pc.business_group_id " + |
| | | " 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, " + |
| | | " COALESCE(dc.custom_longitude, dc.longitude) AS longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " + |
| | | " from wvp_device_channel dc" + |
| | | " LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" + |
| | | " LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" + |
| | |
| | | void clearPlay(String deviceId); |
| | | // 设备主子码流逻辑END |
| | | @Select(value = {" <script>" + |
| | | "select * " + |
| | | "SELECT id,\n" + |
| | | " channel_id,\n" + |
| | | " COALESCE(custom_name, name) AS name,\n" + |
| | | " custom_name,\n" + |
| | | " manufacture,\n" + |
| | | " model,\n" + |
| | | " owner,\n" + |
| | | " civil_code,\n" + |
| | | " block,\n" + |
| | | " address,\n" + |
| | | " parent_id,\n" + |
| | | " safety_way,\n" + |
| | | " register_way,\n" + |
| | | " cert_num,\n" + |
| | | " certifiable,\n" + |
| | | " err_code,\n" + |
| | | " end_time,\n" + |
| | | " secrecy,\n" + |
| | | " ip_address,\n" + |
| | | " port,\n" + |
| | | " password,\n" + |
| | | " COALESCE(custom_ptz_type, ptz_type) AS ptz_type,\n" + |
| | | " status,\n" + |
| | | " COALESCE(custom_longitude, longitude) AS longitude,\n" + |
| | | " COALESCE(custom_latitude, latitude) AS latitude,\n" + |
| | | " stream_id,\n" + |
| | | " device_id,\n" + |
| | | " parental,\n" + |
| | | " has_audio,\n" + |
| | | " create_time,\n" + |
| | | " update_time,\n" + |
| | | " sub_count,\n" + |
| | | " longitude_gcj02,\n" + |
| | | " latitude_gcj02,\n" + |
| | | " longitude_wgs84,\n" + |
| | | " latitude_wgs84,\n" + |
| | | " business_group_id,\n" + |
| | | " gps_time\n" + |
| | | "from wvp_device_channel " + |
| | | "where device_id=#{deviceId}" + |
| | | " <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" + |
| | |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/date/list") |
| | | @Operation(summary = "查询存在云端录像的日期") |
| | | @Operation(summary = "查询存在云端录像的日期", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流ID", required = true) |
| | | @Parameter(name = "year", description = "年,置空则查询当年", required = false) |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/list") |
| | | @Operation(summary = "分页查询云端录像") |
| | | @Operation(summary = "分页查询云端录像"security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "query", description = "检索内容", required = false) |
| | | @Parameter(name = "app", description = "应用名", required = false) |
| | | @Parameter(name = "stream", description = "流ID", required = false) |
| | |
| | | package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition; |
| | | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | |
| | | import com.github.pagehelper.util.StringUtil; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @param end 结束时间 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查询历史轨迹") |
| | | @Operation(summary = "查询历史轨迹", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号") |
| | | @Parameter(name = "start", description = "开始时间") |
| | |
| | | * @param deviceId 设备ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查询设备最新位置") |
| | | @Operation(summary = "查询设备最新位置", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/latest/{deviceId}") |
| | | public MobilePosition latestPosition(@PathVariable String deviceId) { |
| | |
| | | * @param deviceId 设备ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取移动位置信息") |
| | | @Operation(summary = "获取移动位置信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/realtime/{deviceId}") |
| | | public DeferredResult<MobilePosition> realTimePosition(@PathVariable String deviceId) { |
| | |
| | | * @param interval 上报时间间隔 |
| | | * @return true = 命令发送成功 |
| | | */ |
| | | @Operation(summary = "订阅位置信息") |
| | | @Operation(summary = "订阅位置信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "expires", description = "订阅超时时间", required = true) |
| | | @Parameter(name = "interval", description = "上报时间间隔", required = true) |
| | |
| | | * @param deviceId 设备ID |
| | | * @return true = 命令发送成功 |
| | | */ |
| | | @Operation(summary = "数据位置信息格式处理") |
| | | @Operation(summary = "数据位置信息格式处理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/transform/{deviceId}") |
| | | public void positionTransform(@PathVariable String deviceId) { |
| | |
| | | package com.genersoft.iot.vmp.vmanager.gb28181.alarm; |
| | | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除报警") |
| | | @Operation(summary = "删除报警", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "ID") |
| | | @Parameter(name = "deviceIds", description = "多个设备id,逗号分隔") |
| | | @Parameter(name = "time", description = "结束时间") |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/test/notify/alarm") |
| | | @Operation(summary = "测试向上级/设备发送模拟报警通知") |
| | | @Operation(summary = "测试向上级/设备发送模拟报警通知", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号") |
| | | public void delete(@RequestParam String deviceId) { |
| | | Device device = storage.queryVideoDevice(deviceId); |
| | |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询报警") |
| | | @Operation(summary = "分页查询报警", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page",description = "当前页",required = true) |
| | | @Parameter(name = "count",description = "每页查询数量",required = true) |
| | | @Parameter(name = "deviceId",description = "设备id") |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/basicParam/{deviceId}") |
| | | @Operation(summary = "基本配置设置命令") |
| | | @Operation(summary = "基本配置设置命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "name", description = "名称") |
| | |
| | | * @param channelId 通道ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "设备配置查询请求") |
| | | @Operation(summary = "设备配置查询请求", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "configType", description = "配置类型") |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * |
| | | * @param deviceId 设备ID |
| | | */ |
| | | @Operation(summary = "远程启动控制命令") |
| | | @Operation(summary = "远程启动控制命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/teleboot/{deviceId}") |
| | | public void teleBootApi(@PathVariable String deviceId) { |
| | |
| | | * @param recordCmdStr Record:手动录像,StopRecord:停止手动录像 |
| | | * @param channelId 通道编码(可选) |
| | | */ |
| | | @Operation(summary = "录像控制") |
| | | @Operation(summary = "录像控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "recordCmdStr", description = "命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", required = true) |
| | |
| | | * @param deviceId 设备ID |
| | | * @param guardCmdStr SetGuard:布防,ResetGuard:撤防 |
| | | */ |
| | | @Operation(summary = "布防/撤防命令") |
| | | @Operation(summary = "布防/撤防命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "guardCmdStr", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true) |
| | | @GetMapping("/guard/{deviceId}/{guardCmdStr}") |
| | |
| | | * @param alarmMethod 报警方式(可选) |
| | | * @param alarmType 报警类型(可选) |
| | | */ |
| | | @Operation(summary = "报警复位") |
| | | @Operation(summary = "报警复位", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "alarmMethod", description = "报警方式") |
| | |
| | | * @param deviceId 设备ID |
| | | * @param channelId 通道ID |
| | | */ |
| | | @Operation(summary = "强制关键帧") |
| | | @Operation(summary = "强制关键帧", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号") |
| | | @GetMapping("/i_frame/{deviceId}") |
| | |
| | | * @param presetIndex 调用预置位编号(可选) |
| | | * @param channelId 通道编码(可选) |
| | | */ |
| | | @Operation(summary = "看守位控制") |
| | | @Operation(summary = "看守位控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "enabled", description = "是否开启看守位 1:开启,0:关闭", required = true) |
| | |
| | | * @param lengthy 拉框宽度像素值 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "拉框放大") |
| | | @Operation(summary = "拉框放大", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) |
| | |
| | | * @param lengthy 拉框宽度像素值 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "拉框放大") |
| | | @Operation(summary = "拉框缩小", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号") |
| | | @Parameter(name = "length", description = "播放窗口长度像素值", required = true) |
| | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.SyncStatus; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.apache.commons.compress.utils.IOUtils; |
| | | import org.apache.ibatis.annotations.Options; |
| | |
| | | * @param deviceId 国标ID |
| | | * @return 国标设备 |
| | | */ |
| | | @Operation(summary = "查询国标设备") |
| | | @Operation(summary = "查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/devices/{deviceId}") |
| | | public Device devices(@PathVariable String deviceId){ |
| | |
| | | * @param count 每页查询数量 |
| | | * @return 分页国标列表 |
| | | */ |
| | | @Operation(summary = "分页查询国标设备") |
| | | @Operation(summary = "分页查询国标设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页查询数量", required = true) |
| | | @GetMapping("/devices") |
| | |
| | | * @return 通道列表 |
| | | */ |
| | | @GetMapping("/devices/{deviceId}/channels") |
| | | @Operation(summary = "分页查询通道") |
| | | @Operation(summary = "分页查询通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页查询数量", required = true) |
| | |
| | | * @param deviceId 设备id |
| | | * @return |
| | | */ |
| | | @Operation(summary = "同步设备通道") |
| | | @Operation(summary = "同步设备通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/devices/{deviceId}/sync") |
| | | public WVPResult<SyncStatus> devicesSync(@PathVariable String deviceId){ |
| | |
| | | * @param deviceId 设备id |
| | | * @return |
| | | */ |
| | | @Operation(summary = "移除设备") |
| | | @Operation(summary = "移除设备", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @DeleteMapping("/devices/{deviceId}/delete") |
| | | public String delete(@PathVariable String deviceId){ |
| | |
| | | * @param channelType 通道类型 |
| | | * @return 子通道列表 |
| | | */ |
| | | @Operation(summary = "分页查询子目录通道") |
| | | @Operation(summary = "分页查询子目录通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | |
| | | * @param channel 通道 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "更新通道信息") |
| | | @Operation(summary = "更新通道信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channel", description = "通道信息", required = true) |
| | | @PostMapping("/channel/update/{deviceId}") |
| | |
| | | * @param streamMode 数据流传输模式 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改数据流传输模式") |
| | | @Operation(summary = "修改数据流传输模式", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "streamMode", description = "数据流传输模式, 取值:" + |
| | | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", required = true) |
| | |
| | | * @param device 设备信息 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加设备信息") |
| | | @Operation(summary = "添加设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "device", description = "设备", required = true) |
| | | @PostMapping("/device/add/") |
| | | public void addDevice(Device device){ |
| | |
| | | * @param device 设备信息 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "更新设备信息") |
| | | @Operation(summary = "更新设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "device", description = "设备", required = true) |
| | | @PostMapping("/device/update/") |
| | | public void updateDevice(Device device){ |
| | |
| | | * |
| | | * @param deviceId 设备id |
| | | */ |
| | | @Operation(summary = "设备状态查询") |
| | | @Operation(summary = "设备状态查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/devices/{deviceId}/status") |
| | | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { |
| | |
| | | * @param endTime 报警发生终止时间(可选) |
| | | * @return true = 命令发送成功 |
| | | */ |
| | | @Operation(summary = "设备状态查询") |
| | | @Operation(summary = "设备报警查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "startPriority", description = "报警起始级别") |
| | | @Parameter(name = "endPriority", description = "报警终止级别") |
| | |
| | | |
| | | |
| | | @GetMapping("/{deviceId}/sync_status") |
| | | @Operation(summary = "获取通道同步进度") |
| | | @Operation(summary = "获取通道同步进度", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | public WVPResult<SyncStatus> getSyncStatus(@PathVariable String deviceId) { |
| | | SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId); |
| | |
| | | } |
| | | |
| | | @GetMapping("/{deviceId}/subscribe_info") |
| | | @Operation(summary = "获取设备的订阅状态") |
| | | @Operation(summary = "获取设备的订阅状态", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | public WVPResult<Map<String, Integer>> getSubscribeInfo(@PathVariable String deviceId) { |
| | | Set<String> allKeys = dynamicTask.getAllKeys(); |
| | |
| | | package com.genersoft.iot.vmp.vmanager.gb28181.gbStream; |
| | | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @param platformId 平台ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查询国标通道") |
| | | @Operation(summary = "查询国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页条数", required = true) |
| | | @Parameter(name = "platformId", description = "平台ID", required = true) |
| | |
| | | * @param gbStreamParam |
| | | * @return |
| | | */ |
| | | @Operation(summary = "移除国标关联") |
| | | @Operation(summary = "移除国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @DeleteMapping(value = "/del") |
| | | @ResponseBody |
| | | public void del(@RequestBody GbStreamParam gbStreamParam){ |
| | |
| | | * @param gbStreamParam |
| | | * @return |
| | | */ |
| | | @Operation(summary = "保存国标关联") |
| | | @Operation(summary = "保存国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping(value = "/add") |
| | | @ResponseBody |
| | | public void add(@RequestBody GbStreamParam gbStreamParam){ |
| | |
| | | * @param gbId |
| | | * @return |
| | | */ |
| | | @Operation(summary = "保存国标关联") |
| | | @Operation(summary = "保存国标关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping(value = "/addWithGbid") |
| | | @ResponseBody |
| | | public void add(String gbId, String platformGbId, @RequestParam(required = false) String catalogGbId){ |
| | |
| | | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| | | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @param stream 流id |
| | | * @return |
| | | */ |
| | | @Operation(summary = "根据应用名和流id获取播放地址") |
| | | @Operation(summary = "根据应用名和流id获取播放地址", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
| | |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; |
| | | import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取国标服务的配置") |
| | | @Operation(summary = "获取国标服务的配置", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping("/server_config") |
| | | public JSONObject serverConfig() { |
| | | JSONObject result = new JSONObject(); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取级联服务器信息") |
| | | @Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "平台国标编号", required = true) |
| | | @GetMapping("/info/{id}") |
| | | public ParentPlatform getPlatform(@PathVariable String id) { |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/query/{count}/{page}") |
| | | @Operation(summary = "分页查询级联平台") |
| | | @Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页条数", required = true) |
| | | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count) { |
| | |
| | | * @param parentPlatform |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加上级平台信息") |
| | | @Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public void addPlatform(@RequestBody ParentPlatform parentPlatform) { |
| | |
| | | * @param parentPlatform |
| | | * @return |
| | | */ |
| | | @Operation(summary = "保存上级平台信息") |
| | | @Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping("/save") |
| | | @ResponseBody |
| | | public void savePlatform(@RequestBody ParentPlatform parentPlatform) { |
| | |
| | | * @param serverGBId 上级平台国标ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "删除上级平台") |
| | | @Operation(summary = "删除上级平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "serverGBId", description = "上级平台的国标编号") |
| | | @DeleteMapping("/delete/{serverGBId}") |
| | | @ResponseBody |
| | |
| | | * @param serverGBId 上级平台国标ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查询上级平台是否存在") |
| | | @Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "serverGBId", description = "上级平台的国标编号") |
| | | @GetMapping("/exit/{serverGBId}") |
| | | @ResponseBody |
| | |
| | | * @param channelType 通道类型 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "查询上级平台是否存在") |
| | | @Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页条数", required = true) |
| | | @Parameter(name = "platformId", description = "上级平台的国标编号") |
| | |
| | | * @param param 通道关联参数 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "向上级平台添加国标通道") |
| | | @Operation(summary = "向上级平台添加国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping("/update_channel_for_gb") |
| | | @ResponseBody |
| | | public void updateChannelForGB(@RequestBody UpdateChannelParam param) { |
| | |
| | | * @param param 通道关联参数 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "从上级平台移除国标通道") |
| | | @Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @DeleteMapping("/del_channel_for_gb") |
| | | @ResponseBody |
| | | public void delChannelForGB(@RequestBody UpdateChannelParam param) { |
| | |
| | | * @param parentId 目录父ID |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取目录") |
| | | @Operation(summary = "获取目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "platformId", description = "上级平台的国标编号", required = true) |
| | | @Parameter(name = "parentId", description = "父级目录的国标编号", required = true) |
| | | @GetMapping("/catalog") |
| | |
| | | * @param platformCatalog 目录 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加目录") |
| | | @Operation(summary = "添加目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping("/catalog/add") |
| | | @ResponseBody |
| | | public void addCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| | |
| | | * @param platformCatalog 目录 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "编辑目录") |
| | | @Operation(summary = "编辑目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @PostMapping("/catalog/edit") |
| | | @ResponseBody |
| | | public void editCatalog(@RequestBody PlatformCatalog platformCatalog) { |
| | |
| | | * @param platformId 平台Id |
| | | * @return |
| | | */ |
| | | @Operation(summary = "删除目录") |
| | | @Operation(summary = "删除目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "目录Id", required = true) |
| | | @Parameter(name = "platformId", description = "平台Id", required = true) |
| | | @DeleteMapping("/catalog/del") |
| | |
| | | * @param platformCatalog 关联的信息 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "删除关联") |
| | | @Operation(summary = "删除关联", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @DeleteMapping("/catalog/relation/del") |
| | | @ResponseBody |
| | | public void delRelation(@RequestBody PlatformCatalog platformCatalog) { |
| | |
| | | * @param catalogId 目录Id |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改默认目录") |
| | | @Operation(summary = "修改默认目录", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "catalogId", description = "目录Id", required = true) |
| | | @Parameter(name = "platformId", description = "平台Id", required = true) |
| | | @PostMapping("/catalog/default/update") |
| | |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; |
| | | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Autowired |
| | | private UserSetting userSetting; |
| | | |
| | | @Operation(summary = "开始点播") |
| | | @Operation(summary = "开始点播", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @GetMapping("/start/{deviceId}/{channelId}") |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Operation(summary = "停止点播") |
| | | @Operation(summary = "停止点播", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) |
| | |
| | | * 将不是h264的视频通过ffmpeg 转码为h264 + aac |
| | | * @param streamId 流ID |
| | | */ |
| | | @Operation(summary = "将不是h264的视频通过ffmpeg 转码为h264 + aac") |
| | | @Operation(summary = "将不是h264的视频通过ffmpeg 转码为h264 + aac", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "streamId", description = "视频流ID", required = true) |
| | | @PostMapping("/convert/{streamId}") |
| | | public JSONObject playConvert(@PathVariable String streamId) { |
| | |
| | | /** |
| | | * 结束转码 |
| | | */ |
| | | @Operation(summary = "结束转码") |
| | | @Operation(summary = "结束转码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "key", description = "视频流key", required = true) |
| | | @Parameter(name = "mediaServerId", description = "流媒体服务ID", required = true) |
| | | @PostMapping("/convertStop/{key}") |
| | |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "语音广播命令") |
| | | @Operation(summary = "语音广播命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/broadcast/{deviceId}") |
| | | @PostMapping("/broadcast/{deviceId}") |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Operation(summary = "获取所有的ssrc") |
| | | @Operation(summary = "获取所有的ssrc", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping("/ssrc") |
| | | public JSONObject getSSRC() { |
| | | if (logger.isDebugEnabled()) { |
| | |
| | | return jsonObject; |
| | | } |
| | | |
| | | @Operation(summary = "获取截图") |
| | | @Operation(summary = "获取截图", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "isSubStream", description = "是否子码流(true-子码流,false-主码流),默认为false", required = true) |
| | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.exception.ServiceException; |
| | | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Autowired |
| | | private UserSetting userSetting; |
| | | |
| | | @Operation(summary = "开始视频回放") |
| | | @Operation(summary = "开始视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "startTime", description = "开始时间", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "停止视频回放") |
| | | @Operation(summary = "停止视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "stream", description = "流ID", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "回放暂停") |
| | | @Operation(summary = "回放暂停", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| | | @GetMapping("/pause/{streamId}") |
| | | public void playPause(@PathVariable String streamId) { |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "回放恢复") |
| | | @Operation(summary = "回放恢复", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| | | @GetMapping("/resume/{streamId}") |
| | | public void playResume(@PathVariable String streamId) { |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "回放拖动播放") |
| | | @Operation(summary = "回放拖动播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| | | @Parameter(name = "seekTime", description = "拖动偏移量,单位s", required = true) |
| | | @GetMapping("/seek/{streamId}/{seekTime}") |
| | |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "回放倍速播放") |
| | | @Operation(summary = "回放倍速播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "streamId", description = "回放流ID", required = true) |
| | | @Parameter(name = "speed", description = "倍速0.25 0.5 1、2、4", required = true) |
| | | @GetMapping("/speed/{streamId}/{speed}") |
| | |
| | | |
| | | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @param zoomSpeed 缩放速度 |
| | | */ |
| | | |
| | | @Operation(summary = "云台控制") |
| | | @Operation(summary = "云台控制", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "command", description = "控制指令,允许值: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "通用前端控制命令") |
| | | @Operation(summary = "通用前端控制命令", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "cmdCode", description = "指令码", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "预置位查询") |
| | | @Operation(summary = "预置位查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @GetMapping("/preset/query/{deviceId}/{channelId}") |
| | |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Autowired |
| | | private UserSetting userSetting; |
| | | |
| | | @Operation(summary = "录像查询") |
| | | @Operation(summary = "录像查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "startTime", description = "开始时间", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "开始历史媒体下载") |
| | | @Operation(summary = "开始历史媒体下载", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "startTime", description = "开始时间", required = true) |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Operation(summary = "停止历史媒体下载") |
| | | @Operation(summary = "停止历史媒体下载", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "stream", description = "流ID", required = true) |
| | |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "获取历史媒体下载进度") |
| | | @Operation(summary = "获取历史媒体下载进度", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| | | @Parameter(name = "stream", description = "流ID", required = true) |
| | |
| | | |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.service.ILogService; |
| | | import com.genersoft.iot.vmp.storager.dao.dto.LogDto; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/all") |
| | | @Operation(summary = "分页查询日志") |
| | | @Operation(summary = "分页查询日志", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "query", description = "查询内容", required = true) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页查询数量", required = true) |
| | |
| | | * 清空日志 |
| | | * |
| | | */ |
| | | @Operation(summary = "清空日志") |
| | | @Operation(summary = "清空日志", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @DeleteMapping("/clear") |
| | | public void clear() { |
| | | logService.clear(); |
| | |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | |
| | | |
| | | @GetMapping(value = "/receive/open") |
| | | @ResponseBody |
| | | @Operation(summary = "开启收流和获取发流信息") |
| | | @Operation(summary = "开启收流和获取发流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) |
| | | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) |
| | | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) |
| | |
| | | |
| | | @GetMapping(value = "/receive/close") |
| | | @ResponseBody |
| | | @Operation(summary = "关闭收流") |
| | | @Operation(summary = "关闭收流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "stream", description = "流的ID", required = true) |
| | | public void closeRtpServer(String stream) { |
| | | logger.info("[第三方PS服务对接->关闭收流] stream->{}", stream); |
| | |
| | | |
| | | @GetMapping(value = "/send/start") |
| | | @ResponseBody |
| | | @Operation(summary = "发送流") |
| | | @Operation(summary = "发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) |
| | | @Parameter(name = "dstIp", description = "目标收流IP", required = true) |
| | | @Parameter(name = "dstPort", description = "目标收流端口", required = true) |
| | |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | |
| | | |
| | | @GetMapping(value = "/receive/open") |
| | | @ResponseBody |
| | | @Operation(summary = "开启收流和获取发流信息") |
| | | @Operation(summary = "开启收流和获取发流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) |
| | | @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) |
| | | @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) |
| | |
| | | |
| | | @GetMapping(value = "/receive/close") |
| | | @ResponseBody |
| | | @Operation(summary = "关闭收流") |
| | | @Operation(summary = "关闭收流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "stream", description = "流的ID", required = true) |
| | | public void closeRtpServer(String stream) { |
| | | logger.info("[第三方服务对接->关闭收流] stream->{}", stream); |
| | |
| | | |
| | | @GetMapping(value = "/send/start") |
| | | @ResponseBody |
| | | @Operation(summary = "发送流") |
| | | @Operation(summary = "发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) |
| | | @Parameter(name = "dstIpForAudio", description = "目标音频收流IP", required = false) |
| | | @Parameter(name = "dstIpForVideo", description = "目标视频收流IP", required = false) |
| | |
| | | |
| | | @GetMapping(value = "/send/stop") |
| | | @ResponseBody |
| | | @Operation(summary = "关闭发送流") |
| | | @Operation(summary = "关闭发送流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "callId", description = "整个过程的唯一标识,不传则使用随机端口发流", required = true) |
| | | public void closeSendRTP(String callId) { |
| | | logger.info("[第三方服务对接->关闭发送流] callId->{}", callId); |
| | |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.VersionInfo; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @GetMapping(value = "/media_server/list") |
| | | @ResponseBody |
| | | @Operation(summary = "流媒体服务列表") |
| | | @Operation(summary = "流媒体服务列表", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public List<MediaServerItem> getMediaServerList() { |
| | | return mediaServerService.getAll(); |
| | | } |
| | | |
| | | @GetMapping(value = "/media_server/online/list") |
| | | @ResponseBody |
| | | @Operation(summary = "在线流媒体服务列表") |
| | | @Operation(summary = "在线流媒体服务列表", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public List<MediaServerItem> getOnlineMediaServerList() { |
| | | return mediaServerService.getAllOnline(); |
| | | } |
| | | |
| | | @GetMapping(value = "/media_server/one/{id}") |
| | | @ResponseBody |
| | | @Operation(summary = "停止视频回放") |
| | | @Operation(summary = "停止视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "流媒体服务ID", required = true) |
| | | public MediaServerItem getMediaServer(@PathVariable String id) { |
| | | return mediaServerService.getOne(id); |
| | | } |
| | | |
| | | @Operation(summary = "测试流媒体服务") |
| | | @Operation(summary = "测试流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "ip", description = "流媒体服务IP", required = true) |
| | | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) |
| | | @Parameter(name = "secret", description = "流媒体服务secret", required = true) |
| | |
| | | return mediaServerService.checkMediaServer(ip, port, secret); |
| | | } |
| | | |
| | | @Operation(summary = "测试流媒体录像管理服务") |
| | | @Operation(summary = "测试流媒体录像管理服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "ip", description = "流媒体服务IP", required = true) |
| | | @Parameter(name = "port", description = "流媒体服务HTT端口", required = true) |
| | | @GetMapping(value = "/media_server/record/check") |
| | |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "保存流媒体服务") |
| | | @Operation(summary = "保存流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "mediaServerItem", description = "流媒体信息", required = true) |
| | | @PostMapping(value = "/media_server/save") |
| | | @ResponseBody |
| | |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "移除流媒体服务") |
| | | @Operation(summary = "移除流媒体服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "流媒体ID", required = true) |
| | | @DeleteMapping(value = "/media_server/delete") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "重启服务") |
| | | @Operation(summary = "重启服务", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping(value = "/restart") |
| | | @ResponseBody |
| | | public void restart() { |
| | |
| | | // }); |
| | | }; |
| | | |
| | | @Operation(summary = "获取系统信息信息") |
| | | @Operation(summary = "获取系统信息信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping(value = "/system/configInfo") |
| | | @ResponseBody |
| | | public SystemConfigInfo getConfigInfo() { |
| | |
| | | return systemConfigInfo; |
| | | } |
| | | |
| | | @Operation(summary = "获取版本信息") |
| | | @Operation(summary = "获取版本信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @GetMapping(value = "/version") |
| | | @ResponseBody |
| | | public VersionPo VersionPogetVersion() { |
| | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | private UserSetting userSetting; |
| | | |
| | | |
| | | @Operation(summary = "分页查询流代理") |
| | | @Operation(summary = "分页查询流代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页") |
| | | @Parameter(name = "count", description = "每页查询数量") |
| | | @Parameter(name = "query", description = "查询内容") |
| | |
| | | return streamProxyService.getAll(page, count); |
| | | } |
| | | |
| | | @Operation(summary = "查询流代理") |
| | | @Operation(summary = "查询流代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名") |
| | | @Parameter(name = "stream", description = "流Id") |
| | | @GetMapping(value = "/one") |
| | |
| | | return streamProxyService.getStreamProxyByAppAndStream(app, stream); |
| | | } |
| | | |
| | | @Operation(summary = "保存代理", parameters = { |
| | | @Operation(summary = "保存代理", security = @SecurityRequirement(name = JwtUtils.HEADER), parameters = { |
| | | @Parameter(name = "param", description = "代理参数", required = true), |
| | | }) |
| | | @PostMapping(value = "/save") |
| | |
| | | |
| | | @GetMapping(value = "/ffmpeg_cmd/list") |
| | | @ResponseBody |
| | | @Operation(summary = "获取ffmpeg.cmd模板") |
| | | @Operation(summary = "获取ffmpeg.cmd模板", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "mediaServerId", description = "流媒体ID", required = true) |
| | | public JSONObject getFFmpegCMDs(@RequestParam String mediaServerId){ |
| | | logger.debug("获取节点[ {} ]ffmpeg.cmd模板", mediaServerId ); |
| | |
| | | |
| | | @DeleteMapping(value = "/del") |
| | | @ResponseBody |
| | | @Operation(summary = "移除代理") |
| | | @Operation(summary = "移除代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | public void del(@RequestParam String app, @RequestParam String stream){ |
| | |
| | | |
| | | @GetMapping(value = "/start") |
| | | @ResponseBody |
| | | @Operation(summary = "启用代理") |
| | | @Operation(summary = "启用代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | public void start(String app, String stream){ |
| | |
| | | |
| | | @GetMapping(value = "/stop") |
| | | @ResponseBody |
| | | @Operation(summary = "停用代理") |
| | | @Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | public void stop(String app, String stream){ |
| | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| | | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | @Operation(summary = "推流列表查询") |
| | | @Operation(summary = "推流列表查询", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页") |
| | | @Parameter(name = "count", description = "每页查询数量") |
| | | @Parameter(name = "query", description = "查询内容") |
| | |
| | | |
| | | @PostMapping(value = "/save_to_gb") |
| | | @ResponseBody |
| | | @Operation(summary = "将推流添加到国标") |
| | | @Operation(summary = "将推流添加到国标", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public void saveToGB(@RequestBody GbStream stream){ |
| | | if (!streamPushService.saveToGB(stream)){ |
| | | throw new ControllerException(ErrorCode.ERROR100); |
| | |
| | | |
| | | @DeleteMapping(value = "/remove_form_gb") |
| | | @ResponseBody |
| | | @Operation(summary = "将推流移出到国标") |
| | | @Operation(summary = "将推流移出到国标", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public void removeFormGB(@RequestBody GbStream stream){ |
| | | if (!streamPushService.removeFromGB(stream)){ |
| | | throw new ControllerException(ErrorCode.ERROR100); |
| | |
| | | |
| | | @PostMapping(value = "/stop") |
| | | @ResponseBody |
| | | @Operation(summary = "中止一个推流") |
| | | @Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | public void stop(String app, String streamId){ |
| | |
| | | |
| | | @DeleteMapping(value = "/batchStop") |
| | | @ResponseBody |
| | | @Operation(summary = "中止多个推流") |
| | | @Operation(summary = "中止多个推流", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public void batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ |
| | | if (batchGBStreamParam.getGbStreams().size() == 0) { |
| | | throw new ControllerException(ErrorCode.ERROR100); |
| | |
| | | */ |
| | | @GetMapping(value = "/getPlayUrl") |
| | | @ResponseBody |
| | | @Operation(summary = "获取推流播放地址") |
| | | @Operation(summary = "获取推流播放地址", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流id", required = true) |
| | | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
| | |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @ResponseBody |
| | | @Operation(summary = "添加推流信息") |
| | | @Operation(summary = "添加推流信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public void add(@RequestBody StreamPushItem stream){ |
| | | if (ObjectUtils.isEmpty(stream.getGbId())) { |
| | | throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空"); |
| | |
| | | package com.genersoft.iot.vmp.vmanager.user; |
| | | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| | | import com.genersoft.iot.vmp.service.IRoleService; |
| | | import com.genersoft.iot.vmp.storager.dao.dto.Role; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private IRoleService roleService; |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "添加角色") |
| | | @Operation(summary = "添加角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "name", description = "角色名", required = true) |
| | | @Parameter(name = "authority", description = "权限(自行定义内容,目前未使用)", required = true) |
| | | public void add(@RequestParam String name, |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除角色") |
| | | @Operation(summary = "删除角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "用户Id", required = true) |
| | | public void delete(@RequestParam Integer id){ |
| | | // 获取当前登录用户id |
| | |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | @Operation(summary = "查询角色") |
| | | @Operation(summary = "查询角色", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public List<Role> all(){ |
| | | // 获取当前登录用户id |
| | | List<Role> allRoles = roleService.getAll(); |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | |
| | | |
| | | |
| | | @PostMapping("/changePassword") |
| | | @Operation(summary = "修改密码") |
| | | @Operation(summary = "修改密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "username", description = "用户名", required = true) |
| | | @Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true) |
| | | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |
| | |
| | | |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "添加用户") |
| | | @Operation(summary = "添加用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "username", description = "用户名", required = true) |
| | | @Parameter(name = "password", description = "密码(未md5加密的密码)", required = true) |
| | | @Parameter(name = "roleId", description = "角色ID", required = true) |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除用户") |
| | | @Operation(summary = "删除用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "id", description = "用户Id", required = true) |
| | | public void delete(@RequestParam Integer id){ |
| | | // 获取当前登录用户id |
| | |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | @Operation(summary = "查询用户") |
| | | @Operation(summary = "查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | public List<User> all(){ |
| | | // 获取当前登录用户id |
| | | return userService.getAllUsers(); |
| | |
| | | * @return 分页用户列表 |
| | | */ |
| | | @GetMapping("/users") |
| | | @Operation(summary = "分页查询用户") |
| | | @Operation(summary = "分页查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "page", description = "当前页", required = true) |
| | | @Parameter(name = "count", description = "每页查询数量", required = true) |
| | | public PageInfo<User> users(int page, int count) { |
| | |
| | | } |
| | | |
| | | @RequestMapping("/changePushKey") |
| | | @Operation(summary = "修改pushkey") |
| | | @Operation(summary = "修改pushkey", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "userId", description = "用户Id", required = true) |
| | | @Parameter(name = "pushKey", description = "新的pushKey", required = true) |
| | | public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) { |
| | |
| | | } |
| | | |
| | | @PostMapping("/changePasswordForAdmin") |
| | | @Operation(summary = "管理员修改普通用户密码") |
| | | @Operation(summary = "管理员修改普通用户密码", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "adminId", description = "管理员id", required = true) |
| | | @Parameter(name = "userId", description = "用户id", required = true) |
| | | @Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true) |
| | |
| | | <el-option label="流畅" :value="true"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button> |
| | | <el-button v-if="showTree" icon="iconfont icon-list" circle size="mini" @click="switchList()"></el-button> |
| | | <el-button v-if="!showTree" icon="iconfont icon-tree" circle size="mini" @click="switchTree()"></el-button> |
| | | <el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button> |
| | | <el-button v-if="showTree" icon="iconfont icon-list" circle size="mini" @click="switchList()"></el-button> |
| | | <el-button v-if="!showTree" icon="iconfont icon-tree" circle size="mini" @click="switchTree()"></el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <devicePlayer ref="devicePlayer" ></devicePlayer> |
| | | <el-container v-loading="isLoging" style="height: 82vh;"> |
| | | <el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto" v-if="showTree" > |
| | | <DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent" ></DeviceTree> |
| | | </el-aside> |
| | | <el-main style="padding: 5px;"> |
| | | <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" header-row-class-name="table-header"> |
| | | <el-table-column prop="channelId" label="通道编号" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceId" label="设备编号" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="通道名称" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column label="快照" min-width="120"> |
| | | <template v-slot:default="scope"> |
| | | <el-image |
| | | :src="getSnap(scope.row)" |
| | | :preview-src-list="getBigSnap(scope.row)" |
| | | @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)" |
| | | :fit="'contain'" |
| | | style="width: 60px"> |
| | | <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | <devicePlayer ref="devicePlayer"></devicePlayer> |
| | | <el-container v-loading="isLoging" style="height: 82vh;"> |
| | | <el-aside width="auto" style="height: 82vh; background-color: #ffffff; overflow: auto" v-if="showTree"> |
| | | <DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent"></DeviceTree> |
| | | </el-aside> |
| | | <el-main style="padding: 5px;"> |
| | | <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%" |
| | | header-row-class-name="table-header"> |
| | | <el-table-column prop="channelId" label="通道编号" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceId" label="设备编号" min-width="200"> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="通道名称" min-width="200"> |
| | | <template v-slot:default="scope"> |
| | | <el-input |
| | | v-show="scope.row.edit" |
| | | v-model="scope.row.name" |
| | | placeholder="通道名称" |
| | | :maxlength="255" |
| | | show-word-limit |
| | | clearable |
| | | /> |
| | | <span v-show="!scope.row.edit">{{ scope.row.name }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="快照" min-width="120"> |
| | | <template v-slot:default="scope"> |
| | | <el-image |
| | | :src="getSnap(scope.row)" |
| | | :preview-src-list="getBigSnap(scope.row)" |
| | | @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)" |
| | | :fit="'contain'" |
| | | style="width: 60px"> |
| | | <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="subCount" label="子节点数" min-width="120"> |
| | | </el-table-column> |
| | | <el-table-column prop="manufacture" label="厂家" min-width="120"> |
| | | </el-table-column> |
| | | <el-table-column label="位置信息" min-width="200"> |
| | | <template v-slot:default="scope"> |
| | | <el-input |
| | | v-show="scope.row.edit" |
| | | v-model="scope.row.location" |
| | | placeholder="例:117.234,36.378" |
| | | :maxlength="30" |
| | | show-word-limit |
| | | clearable |
| | | /> |
| | | <span v-show="!scope.row.edit">{{ scope.row.location }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="PTZType" label="云台类型" min-width="120"> |
| | | <template v-slot:default="scope"> |
| | | <el-select v-show="scope.row.edit" v-model="scope.row.PTZType" |
| | | placeholder="云台类型" filterable> |
| | | <el-option |
| | | v-for="(value, key) in ptzTypes" |
| | | :key="key" |
| | | :label="value" |
| | | :value="key" |
| | | /> |
| | | </el-select> |
| | | <div v-show="!scope.row.edit">{{ scope.row.PTZTypeText }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="开启音频" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <div slot="reference" class="name-wrapper"> |
| | | <el-tag size="medium" v-if="scope.row.status === true">在线</el-tag> |
| | | <el-tag size="medium" type="info" v-if="scope.row.status === false">离线</el-tag> |
| | | </div> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="subCount" label="子节点数" min-width="120"> |
| | | </el-table-column> |
| | | <el-table-column prop="manufacture" label="厂家" min-width="120"> |
| | | </el-table-column> |
| | | <el-table-column label="位置信息" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.longitude*scope.row.latitude > 0">{{ scope.row.longitude }},<br>{{ scope.row.latitude }}</span> |
| | | <span v-if="scope.row.longitude*scope.row.latitude === 0">无</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="PTZTypeText" label="云台类型" min-width="120"/> |
| | | <el-table-column label="开启音频" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <div slot="reference" class="name-wrapper"> |
| | | <el-tag size="medium" v-if="scope.row.status === true">在线</el-tag> |
| | | <el-tag size="medium" type="info" v-if="scope.row.status === false">离线</el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | |
| | | <el-table-column label="操作" min-width="280" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <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> |
| | | <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" |
| | | @click="stopDevicePush(scope.row)">停止 |
| | | </el-button> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <el-button size="medium" icon="el-icon-s-open" type="text" v-if="scope.row.subCount > 0 || scope.row.parental === 1" |
| | | @click="changeSubchannel(scope.row)">查看 |
| | | </el-button> |
| | | <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider> |
| | | <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-camera" type="text" @click="queryRecords(scope.row)">设备录像 |
| | | </el-button> |
| | | <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-cloudy" |
| | | type="text" @click="queryCloudRecords(scope.row)">云端录像 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | style="float: right" |
| | | @size-change="handleSizeChange" |
| | | @current-change="currentChange" |
| | | :current-page="currentPage" |
| | | :page-size="count" |
| | | :page-sizes="[15, 25, 35, 50]" |
| | | layout="total, sizes, prev, pager, next" |
| | | :total="total"> |
| | | </el-pagination> |
| | | </el-main> |
| | | </el-container> |
| | | <el-table-column label="操作" min-width="340" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <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> |
| | | <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" |
| | | @click="stopDevicePush(scope.row)">停止 |
| | | </el-button> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <el-button |
| | | v-if="scope.row.edit" |
| | | size="medium" |
| | | type="text" |
| | | icon="el-icon-edit-outline" |
| | | @click="handleSave(scope.row)" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | <el-button |
| | | v-else |
| | | size="medium" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleEdit(scope.row)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <el-button size="medium" icon="el-icon-s-open" type="text" |
| | | v-if="scope.row.subCount > 0 || scope.row.parental === 1" |
| | | @click="changeSubchannel(scope.row)">查看 |
| | | </el-button> |
| | | <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1" direction="vertical"></el-divider> |
| | | <el-button size="medium" v-bind:disabled="device == null || device.online === 0" |
| | | icon="el-icon-video-camera" |
| | | type="text" @click="queryRecords(scope.row)">设备录像 |
| | | </el-button> |
| | | <el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-cloudy" |
| | | type="text" @click="queryCloudRecords(scope.row)">云端录像 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | style="float: right" |
| | | @size-change="handleSizeChange" |
| | | @current-change="currentChange" |
| | | :current-page="currentPage" |
| | | :page-size="count" |
| | | :page-sizes="[15, 25, 35, 50]" |
| | | layout="total, sizes, prev, pager, next" |
| | | :total="total"> |
| | | </el-pagination> |
| | | </el-main> |
| | | </el-container> |
| | | |
| | | <!--设备列表--> |
| | | <!--设备列表--> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | beforeUrl: "/deviceList", |
| | | isLoging: false, |
| | | showTree: false, |
| | | loadSnap: {} |
| | | loadSnap: {}, |
| | | ptzTypes: { |
| | | 0: "未知", |
| | | 1: "球机", |
| | | 2: "半球", |
| | | 3: "固定枪机", |
| | | 4: "遥控枪机" |
| | | } |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | if (this.deviceId) { |
| | | this.deviceService.getDevice(this.deviceId, (result)=>{ |
| | | this.device = result; |
| | | this.deviceService.getDevice(this.deviceId, (result) => { |
| | | this.device = result; |
| | | |
| | | }, (error)=>{ |
| | | }, (error) => { |
| | | console.log("获取设备信息失败") |
| | | console.error(error) |
| | | }) |
| | |
| | | if (res.data.code === 0) { |
| | | that.total = res.data.data.total; |
| | | that.deviceChannelList = res.data.data.list; |
| | | that.deviceChannelList.forEach(e => { |
| | | e.PTZType = e.PTZType + ""; |
| | | that.$set(e, "edit", false); |
| | | that.$set(e, "location", ""); |
| | | if (e.longitude && e.latitude) { |
| | | that.$set(e, "location", e.longitude + "," + e.latitude); |
| | | } |
| | | }); |
| | | // 防止出现表格错位 |
| | | that.$nextTick(() => { |
| | | that.$refs.channelListTable.doLayout(); |
| | |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: '/api/play/start/' + deviceId + '/' + channelId, |
| | | params:{ |
| | | params: { |
| | | isSubStream: this.isSubStream |
| | | } |
| | | }).then(function (res) { |
| | |
| | | that.initData(); |
| | | }, 1000) |
| | | |
| | | }else{ |
| | | } else { |
| | | that.$message.error(res.data.msg); |
| | | } |
| | | }).catch(function (e) { |
| | |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId, |
| | | params:{ |
| | | params: { |
| | | isSubStream: this.isSubStream |
| | | } |
| | | }).then(function (res) { |
| | |
| | | return; |
| | | } |
| | | setTimeout(() => { |
| | | let url = (process.env.NODE_ENV === 'development'? "debug": "") + '/api/device/query/snap/' + deviceId + '/' + channelId |
| | | let url = (process.env.NODE_ENV === 'development' ? "debug" : "") + '/api/device/query/snap/' + deviceId + '/' + channelId |
| | | this.loadSnap[deviceId + channelId]++ |
| | | document.getElementById(deviceId + channelId).setAttribute("src", url + '?' + new Date().getTime()) |
| | | }, 1000) |
| | |
| | | online: this.online, |
| | | channelType: this.channelType |
| | | } |
| | | }).then( (res) =>{ |
| | | }).then((res) => { |
| | | if (res.data.code === 0) { |
| | | this.total = res.data.data.total; |
| | | this.deviceChannelList = res.data.data.list; |
| | | this.deviceChannelList.forEach(e => { |
| | | e.PTZType = e.PTZType + ""; |
| | | this.$set(e, "edit", false); |
| | | this.$set(e, "location", ""); |
| | | if (e.longitude && e.latitude) { |
| | | this.$set(e, "location", e.longitude + "," + e.latitude); |
| | | } |
| | | }); |
| | | // 防止出现表格错位 |
| | | this.$nextTick(() => { |
| | | this.$refs.channelListTable.doLayout(); |
| | |
| | | }).catch(function (error) { |
| | | console.log(error); |
| | | }); |
| | | }else { |
| | | } else { |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: `/api/device/query/tree/channel/${this.deviceId}`, |
| | |
| | | page: this.currentPage, |
| | | count: this.count, |
| | | } |
| | | }).then((res)=> { |
| | | }).then((res) => { |
| | | if (res.data.code === 0) { |
| | | this.total = res.data.total; |
| | | this.deviceChannelList = res.data.list; |
| | |
| | | refresh: function () { |
| | | this.initData(); |
| | | }, |
| | | switchTree: function (){ |
| | | switchTree: function () { |
| | | this.showTree = true; |
| | | this.deviceChannelList = []; |
| | | this.parentChannelId = 0; |
| | | this.currentPage = 1; |
| | | |
| | | }, |
| | | switchList: function (){ |
| | | switchList: function () { |
| | | this.showTree = false; |
| | | this.deviceChannelList = []; |
| | | this.parentChannelId = 0; |
| | |
| | | console.log(device) |
| | | if (!!!data.channelId) { |
| | | this.parentChannelId = device.deviceId; |
| | | }else { |
| | | } else { |
| | | this.parentChannelId = data.channelId; |
| | | } |
| | | this.initData(); |
| | | } |
| | | }, |
| | | // 保存 |
| | | handleSave(row) { |
| | | if (row.location) { |
| | | const segements = row.location.split(","); |
| | | if (segements.length !== 2) { |
| | | this.$message.warning("位置信息格式有误,例:117.234,36.378"); |
| | | return; |
| | | } else { |
| | | row.longitude = parseFloat(segements[0]); |
| | | row.latitude = parseFloat(segements[1]); |
| | | if (!(row.longitude && row.latitude)) { |
| | | this.$message.warning("位置信息格式有误,例:117.234,36.378"); |
| | | return; |
| | | } |
| | | } |
| | | } else { |
| | | delete row.longitude; |
| | | delete row.latitude; |
| | | } |
| | | Object.keys(row).forEach(key => { |
| | | const value = row[key]; |
| | | if (value === null || value === undefined || (typeof value === "string" && value.trim() === "")) { |
| | | delete row[key]; |
| | | } |
| | | }); |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: `/api/device/query/channel/update/${this.deviceId}`, |
| | | params: row |
| | | }).then(response => { |
| | | if (response.data.code === 0) { |
| | | this.$message.success("修改成功!"); |
| | | this.initData(); |
| | | } else { |
| | | this.$message.error("修改失败!"); |
| | | } |
| | | }).catch(_ => { |
| | | this.$message.error("修改失败!"); |
| | | }) |
| | | }, |
| | | // 是否正在编辑 |
| | | isEdit() { |
| | | let editing = false; |
| | | this.deviceChannelList.forEach(e => { |
| | | if (e.edit) { |
| | | editing = true; |
| | | } |
| | | }); |
| | | |
| | | return editing; |
| | | }, |
| | | // 编辑 |
| | | handleEdit(row) { |
| | | if (this.isEdit()) { |
| | | this.$message.warning('请保存当前编辑项!'); |
| | | } else { |
| | | row.edit = true; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |