qixiaoning
2025-08-22 0f97177f258c67397b206b70e5aea2b24a4868c1
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package controllers
 
import (
    "vamicro/config"
    "vamicro/push-service/vo"
 
    "basic.com/valib/bhomeclient.git"
    "basic.com/valib/logger.git"
)
 
type PushSetController struct {
}
 
// @Summary 获取所有的推送字段配置
// @Description 获取所有的推送字段配置
// @Produce json
// @Tags 事件推送
// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}"
// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}"
// @Router /data/api-v/eventPush/getPushSet [get]
func (psc *PushSetController) GetPushSet(h *bhomeclient.WrapperHandler, c *bhomeclient.Request) *bhomeclient.Reply {
    //大类   摄像机信息、场景信息、分析服务器、数据、检测区域、目标、底库信息等等
    logger.Debug("config PushSet:", config.PushSet)
    if len(config.PushSet) > 0 {
        return &bhomeclient.Reply{Success: true, Data: config.PushSet}
    }
 
    set := make([]vo.PushSetMenu, 0)
    camInfoSet := vo.PushSetMenu{
        Id:      "camInfo",
        Name:    "摄像机信息",
        Alias:   "camInfo",
        Checked: true,
        Children: []vo.PushSetMenu{
            {Checked: true, Id: "cameraId", Name: "摄像机ID", Alias: "cameraId"},
            {Checked: true, Id: "cameraName", Name: "摄像机名称", Alias: "cameraName"},
            {Checked: true, Id: "cameraAddr", Name: "摄像机地址", Alias: "cameraAddr"},
        },
    }
    // sceneInfoSet := vo.PushSetMenu{
    //     Id:      "alarmRules", //报警规则
    //     Name:    "场景信息",
    //     Alias:   "alarmRules",
    //     Checked: true,
    //     Children: []vo.PushSetMenu{
    //         {Checked: true, Id: "taskId", Name: "场景ID", Alias: "taskId"},
    //         {Checked: true, Id: "taskName", Name: "场景名称", Alias: "taskName"},
    //         {Checked: true, Id: "alarmRules.#.alarmLevel", Name: "事件等级", Alias: "alarmLevel"},
    //         {Checked: true, Id: "alarmRules.#.ruleText", Name: "场景描述", Alias: "groupText"},
    //         {Checked: true, Id: "alarmRules.#.linkInfo", Name: "联动信息", Alias: "linkInfo"},
    //         {Checked: true, Id: "alarmRules.#.groupId", Name: "报警规则组id", Alias: "groupId"},
    //     },
    // }
    taskInfoSet := vo.PushSetMenu{
        Id:      "aiTasks", //ai任务
        Name:    "任务信息",
        Alias:   "aiTasks",
        Checked: true,
        Children: []vo.PushSetMenu{
            {Checked: true, Id: "taskId", Name: "任务id", Alias: "taskId"},
            {Checked: true, Id: "taskName", Name: "任务名称", Alias: "taskName"},
            {Checked: true, Id: "aiTasks.#.eventLevel", Name: "事件等级", Alias: "eventLevel"},
            {Checked: true, Id: "aiTasks.#.workingTime", Name: "时间段", Alias: "workingTime"},
            {Checked: true, Id: "aiTasks.#.rules", Name: "任务描述", Alias: "rules"},
            {Checked: true, Id: "aiTasks.#.taskDescription", Name: "备注", Alias: "taskDescription"},
        },
    }
    serverSet := vo.PushSetMenu{
        Id:      "serverInfo",
        Name:    "分析服务器",
        Alias:   "serverInfo",
        Checked: true,
        Children: []vo.PushSetMenu{
            {Checked: true, Id: "analyServerId", Name: "设备ID", Alias: "analyServerId"},
            {Checked: true, Id: "analyServerIp", Name: "设备IP", Alias: "analyServerIp"},
            {Checked: true, Id: "analyServerName", Name: "设备名称", Alias: "analyServerName"},
        },
    }
    dataSet := vo.PushSetMenu{
        Id:      "dataInfo",
        Name:    "数据",
        Alias:   "dataInfo",
        Checked: true,
        Children: []vo.PushSetMenu{
            {Checked: true, Id: "id", Name: "主键ID", Alias: "id"},
            {Checked: true, Id: "detect_time", Name: "创建时间", Alias: "detect_time"},
            {Checked: true, Id: "zh_desc_class", Name: "中文描述", Alias: "zh_desc_class"},
            {Checked: true, Id: "image_path", Name: "图像地址", Alias: "image_path"},
            {Checked: true, Id: "video_path", Name: "录像地址", Alias: "video_path"},
            {Checked: true, Id: "event_level_name", Name: "事件等级", Alias: "event_level_name"},
            {Checked: true, Id: "suggestion", Name: "处理建议", Alias: "suggestion"},
            {Checked: true, Id: "risk_description", Name: "隐患描述", Alias: "risk_description"},
            {Checked: true, Id: "is_warning", Name: "是否预警", Alias: "is_warning"},
        },
    }
    // detectAreaSet := vo.PushSetMenu{
    //     Id:      "detectAreaInfo",
    //     Name:    "检测区域",
    //     Alias:   "detectAreaInfo",
    //     Checked: true,
    //     Children: []vo.PushSetMenu{
    //         {Checked: true, Id: "targetInfo.#.areaId", Name: "检测区域id", Alias: "areaId"},
    //         {Checked: true, Id: "targetInfo.#.areaName", Name: "检测区域名称", Alias: "areaName"},
    //     },
    // }
    // targetSet := vo.PushSetMenu{
    //     Id:      "targetInfo",
    //     Name:    "目标",
    //     Alias:   "targetInfo",
    //     Checked: true,
    //     Children: []vo.PushSetMenu{
    //         {Checked: true, Id: "targetInfo.#.attribute", Name: "算法属性", Alias: "attribute"},
    //         {Checked: true, Id: "targetInfo.#.targetLocation", Name: "目标坐标", Alias: "targetLocation"},
    //         {Checked: true, Id: "targetInfo.#.targetScore", Name: "目标置信度", Alias: "targetScore"},
    //         {Checked: true, Id: "targetInfo.#.targetType", Name: "目标类别", Alias: "targetType"},
    //     },
    // }
    // dtSet := vo.PushSetMenu{
    //     Id:      "tableInfo",
    //     Name:    "底库信息",
    //     Alias:   "tableInfo",
    //     Checked: true,
    //     Children: []vo.PushSetMenu{
    //         {Checked: true, Id: "baseInfo.#.tableId", Name: "底库ID", Alias: "tableId"},
    //         {Checked: true, Id: "baseInfo.#.tableName", Name: "底库名称", Alias: "tableName"},
    //         {Checked: true, Id: "baseInfo.#.bwType", Name: "黑白名单", Alias: "bwType"},
    //         {Checked: true, Id: "baseInfo.#.targetPicUrl", Name: "目标抓拍图片", Alias: "targetPicUrl"},
    //         {Checked: true, Id: "baseInfo.#.compareScore", Name: "相似度", Alias: "compareScore"},
    //         {Checked: true, Id: "baseInfo.#.content", Name: "内容", Alias: "content"},
    //     },
    // }
    // dbpInfo := vo.PushSetMenu{
    //     Id:      "baseInfo",
    //     Name:    "底库人员信息",
    //     Alias:   "baseInfo",
    //     Checked: true,
    //     Children: []vo.PushSetMenu{
    //         {Checked: true, Id: "baseInfo.#.targetId", Name: "目标ID", Alias: "targetId"},
    //         {Checked: true, Id: "baseInfo.#.targetName", Name: "姓名", Alias: "targetName"},
    //         {Checked: true, Id: "baseInfo.#.sex", Name: "性别", Alias: "sex"},
    //         {Checked: true, Id: "baseInfo.#.idCard", Name: "身份证号", Alias: "idCard"},
    //         {Checked: true, Id: "baseInfo.#.phoneNum", Name: "手机号", Alias: "phoneNum"},
    //         {Checked: true, Id: "baseInfo.#.monitorLevel", Name: "人员等级", Alias: "monitorLevel"},
    //     },
    // }
    // set = append(set, camInfoSet, sceneInfoSet, serverSet, dataSet, detectAreaSet, targetSet, dtSet, dbpInfo)
    set = append(set, camInfoSet, taskInfoSet, serverSet, dataSet)
 
    return &bhomeclient.Reply{Success: true, Data: set}
}