From ef51da5404827e826e979ad614950a9e0192f4c6 Mon Sep 17 00:00:00 2001
From: qixiaoning <jony.kee@outlook.com>
Date: 星期五, 08 八月 2025 09:15:26 +0800
Subject: [PATCH] 调整数据推送相关接口

---
 sync-service/vo/camera.go |  116 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 59 insertions(+), 57 deletions(-)

diff --git a/sync-service/vo/camera.go b/sync-service/vo/camera.go
index 666dce0..4073a01 100644
--- a/sync-service/vo/camera.go
+++ b/sync-service/vo/camera.go
@@ -1,44 +1,46 @@
 package vo
 
 import (
-	"basic.com/pubsub/protomsg.git"
 	"vamicro/sync-service/models"
+
+	"basic.com/pubsub/protomsg.git"
 )
 
 type CameraEditVo struct {
 	models.Camera
-	AreaId    			string       			`json:"areaId"`
-	Sensors   			[]models.Sensor 		`json:"sensors"`
+	AreaId  string          `json:"areaId"`
+	Sensors []models.Sensor `json:"sensors"`
 }
 
-func (v *CameraEditVo) Copy2Camera() models.Camera{
+func (v *CameraEditVo) Copy2Camera() models.Camera {
 	return v.Camera
 }
 
-//鎽勫儚鏈鸿繍琛岀姸鎬佺粨鏋勪綋
+// 鎽勫儚鏈鸿繍琛岀姸鎬佺粨鏋勪綋
 type CameraRunVo struct {
-	Id 					string 					`json:"id"`//鎽勫儚鏈篿d
-	Name 				string 					`json:"name"`//鎽勫儚鏈哄悕绉�
-	IsRunning 			bool 					`json:"is_running"`//鏄惁姝e湪杩愯锛�0锛氭湭杩愯浠诲姟锛�1锛氭鍦ㄨ繍琛屼换鍔★級
-	RunType 			int 					`json:"run_type"`//杩愯绫诲瀷锛�0锛氳疆璇紝1锛氬疄鏃讹級
-	RunEnable 			bool 					`json:"run_enable"`//鏄惁鍚敤
+	Id        string `json:"id"`         //鎽勫儚鏈篿d
+	Name      string `json:"name"`       //鎽勫儚鏈哄悕绉�
+	IsRunning bool   `json:"is_running"` //鏄惁姝e湪杩愯锛�0锛氭湭杩愯浠诲姟锛�1锛氭鍦ㄨ繍琛屼换鍔★級
+	RunType   int    `json:"run_type"`   //杩愯绫诲瀷锛�0锛氳疆璇紝1锛氬疄鏃讹級
+	RunEnable bool   `json:"run_enable"` //鏄惁鍚敤
 }
 
 type CameraChangeRunVo struct {
-	CameraIds 			[]string 				`json:"camera_ids"`
-	RunType 			int 					`json:"run_type"`
+	CameraIds []string `json:"camera_ids"`
+	RunType   int      `json:"run_type"`
 }
 
 type CameraRunInfo struct {
 	models.Camera
-	RunServerName 		string 					`json:"runServerName"`
-	Tasks 				[]CameraRunTask 		`json:"tasks"`
-	Status 				int 					`json:"status"`
+	RunServerName string          `json:"runServerName"`
+	Tasks         []CameraRunTask `json:"tasks"`
+	//AllTasks []models.Task `json:"allTasks"`
+	Status int `json:"status"`
 }
 
 type CameraRunTask struct {
-	TaskName 			string 					`json:"taskname"` //鍦烘櫙鍚嶇О
-	HasRule   			bool   					`json:"hasRule"`
+	TaskName string `json:"taskname"` //鍦烘櫙鍚嶇О
+	HasRule  bool   `json:"hasRule"`
 }
 
 func (cri *CameraRunInfo) CopyFromCamera(v models.Camera) {
@@ -47,54 +49,54 @@
 
 func (cri *CameraRunInfo) CopyFromProtoCamera(v protomsg.Camera) {
 	cri.Camera = models.Camera{
-		Id: v.Id,
-		Name: v.Name,
-		Alias: v.Alias,
-		SnapshotUrl: v.SnapshotUrl,
-		Type: int(v.Type),
-		Addr: v.Addr,
-		Longitude: v.Longitude,
-		Latitude: v.Latitude,
-		Floor: int(v.Floor),
-		Rtsp: v.Rtsp,
-		Ip: v.Ip,
-		Port: int(v.Port),
-		Username: v.Username,
-		Password: v.Password,
-		Brand: v.Brand,
-		Reserved: v.Reserved,
-		IsRunning: v.IsRunning,
-		RunEnable: v.RunEnable,
-		RunType: int(v.RunType),
-		RunServerId: v.RunServerId,
-		ResolutionWidth: int(v.ResolutionWidth),
+		Id:               v.Id,
+		Name:             v.Name,
+		Alias:            v.Alias,
+		SnapshotUrl:      v.SnapshotUrl,
+		Type:             int(v.Type),
+		Addr:             v.Addr,
+		Longitude:        v.Longitude,
+		Latitude:         v.Latitude,
+		Floor:            int(v.Floor),
+		Rtsp:             v.Rtsp,
+		Ip:               v.Ip,
+		Port:             int(v.Port),
+		Username:         v.Username,
+		Password:         v.Password,
+		Brand:            v.Brand,
+		Reserved:         v.Reserved,
+		IsRunning:        v.IsRunning,
+		RunEnable:        v.RunEnable,
+		RunType:          int(v.RunType),
+		RunServerId:      v.RunServerId,
+		ResolutionWidth:  int(v.ResolutionWidth),
 		ResolutionHeight: int(v.ResolutionHeight),
-		VoiceEnable: v.VoiceEnable,
-		VoiceId: v.VoiceId,
+		VoiceEnable:      v.VoiceEnable,
+		VoiceId:          v.VoiceId,
 	}
 }
 
 type CameraRunStatistic struct {
-	ChannelTotal 		int 					`json:"channelTotal"`
-	RealTotal 			int 					`json:"realTotal"`
-	RealValidCount 		int 					`json:"realValidCount"`
-	RealInvalidCount 	int 					`json:"realInvalidCount"`
-	RealRunningCount 	int 					`json:"realRunningCount"`
+	ChannelTotal     int `json:"channelTotal"`
+	RealTotal        int `json:"realTotal"`
+	RealValidCount   int `json:"realValidCount"`
+	RealInvalidCount int `json:"realInvalidCount"`
+	RealRunningCount int `json:"realRunningCount"`
 
-	PollChannelCount    int 					`json:"pollChannelCount"`
-	PollTotal 			int 					`json:"pollTotal"`
-	PollValidCount 		int 					`json:"pollValidCount"`
-	PollInvalidCount 	int 					`json:"pollInvalidCount"`
-	PollRunningCount 	int 					`json:"pollRunningCount"`
+	PollChannelCount int `json:"pollChannelCount"`
+	PollTotal        int `json:"pollTotal"`
+	PollValidCount   int `json:"pollValidCount"`
+	PollInvalidCount int `json:"pollInvalidCount"`
+	PollRunningCount int `json:"pollRunningCount"`
 
-	StackChannelCount 	int 					`json:"stackChannelCount"` //鏁版嵁鏍堝崰鐢ㄩ�氶亾鏁伴噺
-	StackTotal 			int 					`json:"stackTotal"`
-	StackValidCount 	int 					`json:"stackValidCount"`
-	StackInvalidCount   int 					`json:"stackInvalidCount"`
-	StackRunningCount 	int 					`json:"stackRunningCount"`
+	StackChannelCount int `json:"stackChannelCount"` //鏁版嵁鏍堝崰鐢ㄩ�氶亾鏁伴噺
+	StackTotal        int `json:"stackTotal"`
+	StackValidCount   int `json:"stackValidCount"`
+	StackInvalidCount int `json:"stackInvalidCount"`
+	StackRunningCount int `json:"stackRunningCount"`
 }
 
 type CamSensorVo struct {
 	models.Camera
-	Sensors 			[]models.Sensor 		`json:"sensors"`
-}
\ No newline at end of file
+	Sensors []models.Sensor `json:"sensors"`
+}

--
Gitblit v1.8.0