|
@@ -69,19 +69,18 @@ func (h *HikvisionHandler) GetMonitor(ctx *gin.Context) {
|
|
func (h *HikvisionHandler) GetInvade(ctx *gin.Context) {
|
|
func (h *HikvisionHandler) GetInvade(ctx *gin.Context) {
|
|
m := make(map[string]any)
|
|
m := make(map[string]any)
|
|
AlarmTrend24Hour := make(map[string]any)
|
|
AlarmTrend24Hour := make(map[string]any)
|
|
- var realTime []model.RealTimeInspection
|
|
|
|
|
|
+ var realTime []model.Device
|
|
for i := 0; i < 24; i++ {
|
|
for i := 0; i < 24; i++ {
|
|
name := fmt.Sprintf("%v时", i+1)
|
|
name := fmt.Sprintf("%v时", i+1)
|
|
AlarmTrend24Hour[name] = rand.Intn(100)
|
|
AlarmTrend24Hour[name] = rand.Intn(100)
|
|
}
|
|
}
|
|
for i := 0; i < 10; i++ {
|
|
for i := 0; i < 10; i++ {
|
|
- name := fmt.Sprintf("巡检事件%v", i+1)
|
|
|
|
- Location := fmt.Sprintf("位置%v", i+1)
|
|
|
|
- inspection := model.RealTimeInspection{
|
|
|
|
- Id: i + 1,
|
|
|
|
- Name: name,
|
|
|
|
- Location: Location,
|
|
|
|
- Event: name,
|
|
|
|
|
|
+ name := fmt.Sprintf("设备%v", i+1)
|
|
|
|
+ inspection := model.Device{
|
|
|
|
+ Id: i + 1,
|
|
|
|
+ Name: name,
|
|
|
|
+ State: rand.Intn(2),
|
|
|
|
+ Date: time.Now().Format("2006-01-02 15:04:05"),
|
|
}
|
|
}
|
|
realTime = append(realTime, inspection)
|
|
realTime = append(realTime, inspection)
|
|
}
|
|
}
|
|
@@ -145,25 +144,35 @@ func (h *HikvisionHandler) GetElectronicInspections(ctx *gin.Context) {
|
|
// 访客系统
|
|
// 访客系统
|
|
func (h *HikvisionHandler) GetVisitor(ctx *gin.Context) {
|
|
func (h *HikvisionHandler) GetVisitor(ctx *gin.Context) {
|
|
m := make(map[string]any)
|
|
m := make(map[string]any)
|
|
- PersonnelAllocation := make(map[string]any)
|
|
|
|
|
|
+ PrevailingTrends := make(map[string]any)
|
|
var visitor []model.Visitor
|
|
var visitor []model.Visitor
|
|
- for i := 0; i < 10; i++ {
|
|
|
|
|
|
+ for i := 0; i < 24; i++ {
|
|
name := fmt.Sprintf("人员%v", i+1)
|
|
name := fmt.Sprintf("人员%v", i+1)
|
|
- address := fmt.Sprintf("地址%v", i+1)
|
|
|
|
|
|
+ address := fmt.Sprintf("%v时", i+1)
|
|
m2 := model.Visitor{
|
|
m2 := model.Visitor{
|
|
- Id: i + 1,
|
|
|
|
- Name: name,
|
|
|
|
- State: rand.Intn(2),
|
|
|
|
- Date: time.Now().Format("2006-01-02 15:04:05"),
|
|
|
|
|
|
+ Id: i + 1,
|
|
|
|
+ Name: name,
|
|
|
|
+ State: rand.Intn(2),
|
|
|
|
+ Phone: strconv.Itoa(rand.Intn(1000000000)),
|
|
|
|
+ Location: address,
|
|
|
|
+ Date: time.Now().Format("2006-01-02 15:04:05"),
|
|
}
|
|
}
|
|
- PersonnelAllocation[address] = rand.Intn(100)
|
|
|
|
|
|
+ PrevailingTrends[address] = rand.Intn(100)
|
|
visitor = append(visitor, m2)
|
|
visitor = append(visitor, m2)
|
|
}
|
|
}
|
|
|
|
|
|
- m["Area"] = rand.Intn(100) //总建筑面积
|
|
|
|
- m["Test"] = rand.Intn(100) //测试
|
|
|
|
- m["DeviceList"] = visitor //访客列表
|
|
|
|
- m["PersonnelAllocation"] = PersonnelAllocation //外地人员分配
|
|
|
|
|
|
+ m["VisitorCount"] = rand.Intn(1000) //访客总量
|
|
|
|
+ m["SignInCount"] = rand.Intn(1000) //签到数量
|
|
|
|
+ m["TransitCount"] = rand.Intn(1000) //通行数量
|
|
|
|
+ m["Exit"] = rand.Intn(1000) //离场数量
|
|
|
|
+ m["Client"] = rand.Intn(100) //客户
|
|
|
|
+ m["Vendor"] = rand.Intn(100) //供应商
|
|
|
|
+ m["Interviewees"] = rand.Intn(100) //面试者
|
|
|
|
+ m["GovernmentPersonnel"] = rand.Intn(100) //政府人员
|
|
|
|
+ m["Other"] = rand.Intn(100) //其他
|
|
|
|
+ m["PrevailingTrends"] = PrevailingTrends //通行趋势
|
|
|
|
+ m["VisitorRegistration"] = visitor //访客登记
|
|
|
|
+ m["VisitorsSwipeCards"] = visitor //访客刷卡记录
|
|
resp.HandleSuccess(ctx, m)
|
|
resp.HandleSuccess(ctx, m)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -262,11 +271,13 @@ func (h *HikvisionHandler) GetAccess(ctx *gin.Context) {
|
|
m["Abnormal"] = rand.Intn(100) //异常
|
|
m["Abnormal"] = rand.Intn(100) //异常
|
|
m["Fault"] = rand.Intn(100) //故障
|
|
m["Fault"] = rand.Intn(100) //故障
|
|
m["Offline"] = rand.Intn(100) //离线
|
|
m["Offline"] = rand.Intn(100) //离线
|
|
|
|
+ m["Attendance"] = rand.Intn(100) //出勤率
|
|
m["Invasio1"] = invasio1 //入侵事件1
|
|
m["Invasio1"] = invasio1 //入侵事件1
|
|
m["Invasio2"] = invasio2 //入侵事件2
|
|
m["Invasio2"] = invasio2 //入侵事件2
|
|
m["DailyTotal"] = DailyTotal //每日统计
|
|
m["DailyTotal"] = DailyTotal //每日统计
|
|
m["Cumulative"] = Cumulative //累计统计
|
|
m["Cumulative"] = Cumulative //累计统计
|
|
m["AlarmList"] = alarmList //实时告警与通知
|
|
m["AlarmList"] = alarmList //实时告警与通知
|
|
|
|
+ m["devices"] = devices //设备列表
|
|
resp.HandleSuccess(ctx, m)
|
|
resp.HandleSuccess(ctx, m)
|
|
}
|
|
}
|
|
|
|
|