CZT
2023-10-24 f27f3ea5055888f7f1c797d0fd7fb26a2013c89c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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<String, HikMediaProp> mapMedia;
 
 
    /**
     * 根据组织编码获取海康流媒体配置信息
     *
     * @param companyId
     * @return
     */
    public HikMediaProp getHikProp(String companyId) {
 
        if (StringUtils.isEmpty(companyId)) {
            return null;
        }
 
        Map<String, HikMediaProp> all = this.getMapMedia();
        if (null == all) {
            return null;
        }
 
        return all.get(companyId);
    }
}