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} }