sa
2025-07-25 1bcd788a7dea4a3d1a1aa91054dd55b0d2f1e9ca
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!-- 
安防系统服务端推送与通知管理模块配置文件
定义了系统的基础服务、推送服务、事件处理规则和角色权限等核心配置
-->
<Configuration>
    <BaseService>
        <IPPort>0.0.0.0:8080</IPPort>
        <MessageSizeLimit>1024</MessageSizeLimit>
        <DBConnection>
            <!-- 数据库服务器主机地址 -->
            <Host>localhost</Host>
 
            <!-- 数据库用户名 -->
            <Username>root</Username>
            
            <!-- 数据库密码 -->
            <Password>123456</Password>
            
            <!-- 数据库名称 -->
            <Database>configuration_system</Database>
        </DBConnection>
    </BaseService>
 
    <PushService>
        <Channels>
            <Channel>App</Channel>
            <Channel>SMS</Channel>
            <Channel>Email</Channel>
        </Channels>
        <PushStatus>false</PushStatus>
        <RetryPolicy>
             <!--最大重试次数-->
            <MaxRetries>3</MaxRetries>         
             <!-- 重试间隔时间(秒) -->
            <RetryInterval>5</RetryInterval> 
        </RetryPolicy>
        <OfflineCache>
            <!-- 消息保留天数 -->
            <RetentionDays>7</RetentionDays>
            
            <!-- 最大缓存消息数量 -->
            <MaxMessages>100000</MaxMessages>
        </OfflineCache>
    </PushService>
 
    <EventProcessing>
        <EventLevels>
            <!-- 
            人脸识别类事件等级配置
            type: 事件类型标识符
            level: 风险等级(紧急/重要)
            -->
            <Event type="face_recognition_blacklist" level="紧急"/>
            <Event type="face_recognition_stranger" level="紧急"/>
            <Event type="face_recognition_vip" level="重要"/>            
            <!-- 
            视频监控一场类事件等级配置
            -->
            <Event type="video_monitor_intrusion" level="紧急"/>
            <Event type="video_monitor_object_left" level="紧急"/>
            <Event type="video_monitor_fire_smoke" level="紧急"/> 
             <!-- 
            设备状态类事件等级配置
            --> 
             <Event type="device_status_offline" level="重要"/>
            <Event type="device_status_storage_low" level="重要"/>
            <Event type="device_status_network_down" level="重要"/>
        </EventLevels>
    </EventProcessing>
 
    <!-- ====================== 角色与权限配置 ====================== -->
    <RolePermissions>
        <!-- 
        安保人员角色配置
        主要接收紧急事件通知
        -->
        <Role name="安保人员">
            <!-- 
            该角色可接收的事件类型列表
            "*" 表示所有事件类型
            -->
            <EventTypes>
                <Type>face_recognition_blacklist</Type>
                <Type>face_recognition__stranger</Type>
                <Type>video_monitor_intrusion</Type>
                <Type>video_monitor_object_left</Type>
                <Type>video_monitor_fire_smoke</Type>
            </EventTypes>
            
            <!-- 
            该角色接收通知的渠道
            -->
            <Channels>
                <Channel>App</Channel>
            </Channels>
        </Role>
        
        <!-- 
        管理员角色配置
        接收所有事件和系统告警
        -->
        <Role name="管理员">
            <!-- 
            该角色可接收所有事件类型
            -->
            <EventTypes>
                <Type>*</Type>
            </EventTypes>
            
            <!-- 
            该角色接收通知的渠道列表
            -->
            <Channels>
                <Channel>App</Channel>
                <Channel>Email</Channel>
            </Channels>
        </Role>
        
        <!-- 
        部门负责人角色配置
        主要接收VIP识别和管辖区域告警
        -->
        <Role name="部门负责人">
            <EventTypes>
                <Type>face_recognition_vip</Type>  
            <Type>video_monitor_intrusion</Type> 
            </EventTypes>
            
            <Channels>
                <Channel>App</Channel>
            </Channels>
        </Role>
    </RolePermissions>
</Configuration>