From 1882999b4ee899b79fa5e064238796f1e315d963 Mon Sep 17 00:00:00 2001
From: qixiaoning <jony.kee@outlook.com>
Date: 星期三, 30 七月 2025 15:01:46 +0800
Subject: [PATCH] 修改算力管理,统计信息以及增加摄像机关联任务描述事件等级
---
camera-common/models/Record.go | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/camera-common/models/Record.go b/camera-common/models/Record.go
index 2b01025..e615e31 100644
--- a/camera-common/models/Record.go
+++ b/camera-common/models/Record.go
@@ -5,6 +5,7 @@
"fmt"
"math"
"sort"
+ "strconv"
"strings"
"time"
@@ -28,7 +29,7 @@
// 缁熻鏌ヨ
type StaticRecord struct {
- Id int64 `json:"id"`
+ Id string `json:"id"`
TaskId []int64 `json:"task_id"`
RuleId []int64 `json:"rule_id"`
EventLevelId []int64 `json:"event_level_id"`
@@ -153,9 +154,9 @@
// 鐭ヨ瘑搴�
type KnowledgeDocumentOption struct {
Id string `db:"id" json:"id"`
- Title string `db:"file_name" json:"title"`
+ Title string `db:"title" json:"title"`
KnowId int64 `db:"know_id" json:"know_id"`
- FileUrl string `db:"file_name" json:"file_url"`
+ FileUrl string `db:"title" json:"file_url"`
}
// Pagination 鍒嗛〉淇℃伅
@@ -226,7 +227,7 @@
case "id":
IdColumn := field.(*entity.ColumnInt64).Data()
if len(IdColumn) > 0 {
- record.Id = IdColumn[i]
+ record.Id = strconv.FormatInt(IdColumn[i], 10)
}
case "task_id":
TaskIdColumn := field.(*entity.ColumnInt64Array).Data()
@@ -487,7 +488,7 @@
placeholders[i] = "?"
args[i] = id
}
- sqlStr := `SELECT id, know_id, file_name FROM mal_knowledge_document where id in (` + strings.Join(placeholders, ",") + `)`
+ sqlStr := `SELECT id, know_id, file_name as title FROM mal_knowledge_document where id in (` + strings.Join(placeholders, ",") + `)`
if err := db.Raw(sqlStr, args...).Scan(&items).Error; err != nil {
return nil, err
}
@@ -495,7 +496,7 @@
}
// 鏍规嵁鐭ヨ瘑搴搃d鏌ユ暟鎹�
-func GetCameraIds(ids []string) (items []Camera, err error) {
+func GetCameraIds(ids []string) (items []CameraDto, err error) {
placeholders := make([]string, len(ids))
args := make([]interface{}, len(ids))
for i, id := range ids {
--
Gitblit v1.8.0