From fd31206bcb8b084720291a53c986db771d8f5975 Mon Sep 17 00:00:00 2001
From: qixiaoning <jony.kee@outlook.com>
Date: 星期四, 18 九月 2025 13:58:16 +0800
Subject: [PATCH] 抓拍预警记录查询修改,备份还原接口问题修复,应用安装接口调试

---
 push-service/controllers/eventPush.go |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/push-service/controllers/eventPush.go b/push-service/controllers/eventPush.go
index 048a46d..95853ac 100644
--- a/push-service/controllers/eventPush.go
+++ b/push-service/controllers/eventPush.go
@@ -1,6 +1,9 @@
 package controllers
 
 import (
+	"encoding/json"
+	"vamicro/push-service/models"
+	"vamicro/push-service/mqtt"
 	"vamicro/push-service/service"
 	"vamicro/push-service/vo"
 
@@ -127,6 +130,26 @@
 	}
 	sv := service.NewEventPushService(h.Bk)
 	if sv.ChangeStatus(statusBody.Id, statusBody.Enable) {
+		//娑堟伅鎻愰啋
+		var epE models.EventPush
+		epE.GetById(statusBody.Id)
+
+		//udp鎺ㄩ��
+		if epE.PushType == 1 {
+			msg := map[string]string{
+				"type":   "change", // 娉ㄦ剰閫楀彿
+				"status": "",       // 鏈�鍚庝竴涓厓绱犱篃闇�瑕侀�楀彿锛圙o 璇硶瑕佹眰锛�
+				"id":     statusBody.Id,
+			}
+			if statusBody.Enable {
+				msg["status"] = "start"
+			} else {
+				msg["status"] = "stop"
+			}
+			jsonStr, _ := json.Marshal(msg)
+			go mqtt.Client.Publish(mqtt.MQTT_CONFIG_TOPIC, jsonStr)
+		}
+
 		return &bhomeclient.Reply{Success: true, Msg: "淇敼鎴愬姛"}
 	} else {
 		return &bhomeclient.Reply{Success: false, Msg: "淇敼澶辫触"}

--
Gitblit v1.8.0