package model import "gorm.io/gorm" type Hikvision struct { gorm.Model } type Monitor struct { Id int `json:"Id"` Name string `json:"Name"` Location string `json:"Location"` //位置 State int `json:"State"` //状态 } type MonitorNms struct { Id int `json:"Id"` Name string `json:"Name"` InspectResult int `json:"InspectResult"` //状态(0-视频异常,1-视频正常,2-登录失败,3-取流异常,4-解码失败,5-码流延时,6-诊断失败) } type RealTimeInspection struct { Id int `json:"Id"` Name string `json:"Name"` //名称 Location string `json:"Location"` //位置 Event string `json:"Event"` //事件-列3 Date string `json:"Date"` } type Device struct { Id int `json:"Id"` Car string `json:"Car"` //车牌号 Name string `json:"Name"` //名称 State int `json:"State"` //状态 Date string `json:"Date"` //事件-列3 } type Visitor struct { Id int `json:"Id"` Name string `json:"Name"` //名称 State int `json:"State"` //状态 Phone string `json:"Phone"` //电话 Location string `json:"Location"` //位置 Date string `json:"Date"` //时间 } type AlarmList struct { Id int `json:"Id"` Name string `json:"Name"` //名称 AlarmContent string `json:"AlarmContent"` //告警内容 Location string `json:"Location"` //位置 State int `json:"State"` //状态 Date string `json:"Date"` //时间 } type Door struct { Name string `json:"name"` RegionIndexCodes []string `json:"regionIndexCodes"` IsSubRegion bool `json:"isSubRegion"` PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` AuthCodes []string `json:"authCodes"` Expressions []struct { Key string `json:"key"` Operator int `json:"operator"` Values []string `json:"values"` } `json:"expressions"` OrderBy string `json:"orderBy"` OrderType string `json:"orderType"` } type DoorResp struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Total int `json:"total"` PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` List []DoorList `json:"list"` } `json:"data"` } type DoorList struct { IndexCode string `json:"indexCode"` //资源唯一编码 ResourceType string `json:"resourceType"` //资源类型 Name string `json:"name"` //资源名称 DoorNo string `json:"doorNo"` //门禁点编号 ChannelNo string `json:"channelNo"` //通道号 ParentIndexCode string `json:"parentIndexCode"` //父资源索引 ControlOneId string `json:"controlOneId"` //一级控制器id ControlTwoId string `json:"controlTwoId"` //二级控制器id ReaderInId string `json:"readerInId"` //读卡器1 ReaderOutId string `json:"readerOutId"` //读卡器2 DoorSerial int `json:"doorSerial"` //门序号 TreatyType string `json:"treatyType"` //接入协议 RegionIndexCode string `json:"regionIndexCode"` //所属区域 RegionPath string `json:"regionPath"` //所属区域目录,以@符号分割,包含本节点 CreateTime string `json:"createTime"` //创建时间 UpdateTime string `json:"updateTime"` //更新时间 Description string `json:"description"` //描述 ChannelType string `json:"channelType"` //通道类型 RegionName string `json:"regionName"` //区域名称 RegionPathName string `json:"regionPathName"` //区域目录名称 InstallLocation string `json:"installLocation"` //安装位置 } type Response struct { RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"` Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` Data any `json:"data"` } type DoControl struct { Code string `json:"code"` Msg string `json:"msg"` Data []DoControlData `json:"data"` } type DoControlData struct { DoorIndexCode string `json:"doorIndexCode"` ControlResultCode int `json:"controlResultCode"` ControlResultDesc string `json:"controlResultDesc"` } type Doorstates struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { AuthDoorList []struct { DoorIndexCode string `json:"doorIndexCode"` //门禁点indexCode DoorState int `json:"doorState"` //门状态,0 初始状态,1 开门状态,2关门状态,3离线状态 } `json:"authDoorList"` NoAuthDoorIndexCodeList []string `json:"noAuthDoorIndexCodeList"` //没有权限的门禁点集合 } `json:"data"` } // DeviceResource 设备资源 type DeviceResource struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Total int `json:"total"` PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` List []struct { IndexCode string `json:"indexCode"` Name string `json:"name"` ResourceType string `json:"resourceType"` DoorNo string `json:"doorNo"` Description string `json:"description"` ParentIndexCodes string `json:"parentIndexCodes"` RegionIndexCode string `json:"regionIndexCode"` RegionPath string `json:"regionPath"` ChannelType string `json:"channelType"` ChannelNo string `json:"channelNo"` InstallLocation string `json:"installLocation"` CapabilitySet string `json:"capabilitySet"` ControlOneId string `json:"controlOneId"` ControlTwoId string `json:"controlTwoId"` ReaderInId string `json:"readerInId"` ReaderOutId string `json:"readerOutId"` ComId string `json:"comId"` CreateTime string `json:"createTime"` UpdateTime string `json:"updateTime"` } `json:"list"` } `json:"data"` } type EventLogs struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Total int `json:"total"` PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` List []struct { EventId string `json:"eventId"` StartTime string `json:"startTime"` EndTime string `json:"endTime"` EventType int `json:"eventType"` SrcIndex string `json:"srcIndex"` SrcName string `json:"srcName"` SrcType string `json:"srcType"` RegionId string `json:"regionId"` Status int `json:"status"` } `json:"list"` } `json:"data"` } var ResourceType = map[string]string{ "region": "区域", "acsDevice": "门禁控制器", "door": "门禁点", "reader": "门禁读卡器", "encodeDevice": "编码设备", "camera": "监控点", "ioIn": "报警输入", "ioOut": "报警输出", "iasDevice": "入侵报警-报警主机", "subSys": "入侵报警-子系统", "defence": "入侵报警-防区通道", "radarDevice": "入侵报警-雷达设备", "visDevice": "可视对讲设备", "visDeviceInDoor": "可视对讲-室内机", "visDeviceOutDoor": "可视对讲-门口机", "visDeviceWallDoor": "可视对讲-围墙机", "visDeviceManager": "可视对讲-管理机", "ecsDevice": "梯控-控制器", "ladderCardReader": "梯控-读卡器", "floor": "梯控-楼层", "peDevice": "动环设备", "pemsIoOut": "动环-开关量", "transducer": "动环-传感器", "sensor": "动环-环境量", "snapCamera": "停车场-抓拍机", "led": "停车场-显示屏", "inoutControl": "停车场-出入口控制机", "barrierGate": "停车场-道闸", "bluetoothReader": "停车场-蓝牙读卡器", "rfiReader": "停车场-远距离读卡器", "guideManager": "停车场-诱导管理器", "guideLed": "停车场-诱导/引导屏幕", "geoManage": "停车场-地磁管理器", "monitoringPointDevice": "园区-卡口设备", "monitoringPoint": "园区-卡口点", "gardenLed": "园区-显示屏", "emerdevice": "紧急报警设备", "talk": "对讲通道", "electricLock": "电锁", "alarmLamp": "警灯", "siren": "警号", } func (m *Hikvision) TableName() string { return "hikvision" }