| | |
| | | } |
| | | alarmRules, exist := source["alarmRules"] |
| | | if exist { |
| | | fmt.Println("exist alarmRules") |
| | | if alarmB,ae := json.Marshal(alarmRules);ae ==nil { |
| | | var alarmRArr []AlarmRule |
| | | if ae = json.Unmarshal(alarmB, &alarmRArr);ae ==nil && len(alarmRArr) >0 { |
| | | d["alarmLevel"] = alarmRArr[0].AlarmLevel |
| | | } else { |
| | | fmt.Println("unmarshal ae:", ae) |
| | | } |
| | | } else { |
| | | fmt.Println("ae:", ae) |
| | | } |
| | | } else { |
| | | fmt.Println("no alarmRules") |
| | | d["alarmLevel"] = "" |
| | | } |
| | | pmArr := pmax.([]interface{}) |
| | |
| | | if len(tiArr) > 0 { |
| | | ti := tiArr[0] |
| | | d["picSmUrl"] = ti.PicSmUrl |
| | | if ti.TargetType == "face" { |
| | | if ti.TargetType == "FaceDetect" { |
| | | sLabelStr, ok := source["showLabels"] |
| | | if ok { |
| | | labelArr := strings.Split(sLabelStr.(string), "/") |