package com.ld.igds.data; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; import java.util.Map; /** * 系统配置的海康流媒体配置信息 * @author: chen */ @Component @PropertySource("classpath:media.properties") @ConfigurationProperties(prefix = "hik") @Data public class ConfigHikMedia { /** * 配置封装规则:组织编码.ip -- 内网ip * 配置封装规则:组织编码.wanIp -- 外网ip * 配置封装规则:组织编码.port -- 端口 * 配置封装规则:组织编码.appKey -- key * 配置封装规则:组织编码.appSecret -- 秘钥 * 配置封装规则:组织编码.contextPath -- 路径 * 配置封装规则:组织编码.hikPort -- hik端口 */ private Map mapMedia; /** * 根据组织编码获取海康流媒体配置信息 * * @param companyId * @return */ public HikMediaProp getHikProp(String companyId) { if (StringUtils.isEmpty(companyId)) { return null; } Map all = this.getMapMedia(); if (null == all) { return null; } return all.get(companyId); } }