package model import ( "gorm.io/gorm" "time" ) type Illuminating struct { gorm.Model } type IlluminatingDevice struct { Id int `json:"Id"` DeviceName string `json:"DeviceName"` //设备名称 SwitchStatus int `json:"SwitchStatus"` //开工状态 OnlinePresence int `json:"OnlinePresence"` //在线状态 } type RunAnalyse struct { OpenCount int `json:"OpenCount"` //开启数量 OffCount int `json:"OffCount"` //关闭数量 FaultCount int `json:"FaultCount"` //故障数量 } type EventList struct { Id int `json:"Id"` DeviceName string `json:"DeviceName"` //设备名称 DeviceStatus int `json:"DeviceStatus"` //设备状态 EventDate string `json:"EventDate"` //事件时间 } type Login struct { AccessToken string `json:"access_token"` SysUser struct { SysUsersId int `json:"sys_users_id"` UserName string `json:"user_name"` Password string `json:"password"` DisplayName string `json:"display_name"` Mobile string `json:"mobile"` Email string `json:"email"` HeadImage string `json:"head_image"` Valid int `json:"valid"` LockStatus int `json:"lock_status"` VerificationCode string `json:"verification_code"` CreatedDatetime string `json:"created_datetime"` LastLoginDatetime string `json:"last_login_datetime"` LastLoginInfo string `json:"last_login_info"` Additional string `json:"additional"` Sex int `json:"sex"` OrgId int `json:"org_id"` } `json:"sys_user"` RefreshToken string `json:"refresh_token"` ExpiresIn string `json:"expires_in"` TokenType string `json:"token_type"` IsNew bool `json:"is_new"` RoleType int `json:"role_type"` } type LoginRequst struct { Authorization string `json:"authorization"` ClientId int `json:"clientId"` Mobile string `json:"mobile"` Password string `json:"password"` } type IlluminatingStatistics struct { BuildingCount int `json:"building_count"` RoomCount int `json:"room_count"` GatewayCount int `json:"gateway_count"` DeviceCount int `json:"device_count"` AlarmCount int `json:"alarm_count"` StrategyCount int `json:"strategy_count"` UserCount int `json:"user_count"` DdcCount int `json:"ddc_count"` ThermostatCount int `json:"thermostat_count"` } // 设备列表接口,该结构体属于多个系统结构体(照明,能耗,温控) type IlluminatingBaseecic struct { Devices []struct { DevicesId int `json:"devices_id"` DevicesUdid string `json:"devices_udid"` DevicesTypeId int `json:"devices_type_id"` DevicesName string `json:"devices_name"` DevicesReqInterval int `json:"devices_req_interval"` DevicesLastRequestTime time.Time `json:"devices_last_request_time"` DevicesJsonObject string `json:"devices_json_object"` DevicesEnabled int `json:"devices_enabled"` DevicesCreated time.Time `json:"devices_created"` DevicesSource string `json:"devices_source"` DevicesDescription string `json:"devices_description"` DevicesTypeCode string `json:"devices_type_code"` DevicesTypeName string `json:"devices_type_name"` DevicesTypeWiredWireless int `json:"devices_type_wired_wireless"` DevicesTypeCategoryId int `json:"devices_type_category_id"` DevicesTypeSort int `json:"devices_type_sort"` DevicesTypeCharging int `json:"devices_type_charging"` CategoryId int `json:"category_id"` CategoryClassification string `json:"category_classification"` CategoryName string `json:"category_name"` CategorySystematic int `json:"category_systematic"` CategorySort int `json:"category_sort"` GatewayId int `json:"gateway_id"` GatewayCode string `json:"gateway_code"` GatewayName string `json:"gateway_name"` GatewayDescription string `json:"gateway_description"` GatewayOrgId int `json:"gateway_org_id"` GatewayStatus int `json:"gateway_status"` GatewayLastRequestTime time.Time `json:"gateway_last_request_time"` DevicesGatewayId int `json:"devices_gateway_id"` RoomId int `json:"room_id"` RoomRegionId int `json:"room_region_id"` RoomName string `json:"room_name"` RoomUserId int `json:"room_user_id"` RoomCheckinDate string `json:"room_checkin_date"` RoomCheckoutDate string `json:"room_checkout_date"` RoomArea string `json:"room_area"` RegionId int `json:"region_id"` RegionBuildingId int `json:"region_building_id"` RegionName string `json:"region_name"` RegionParentId int `json:"region_parent_id"` OnLine int `json:"on_line"` RealDeviceName string `json:"real_device_name"` DeviceDataStatus int `json:"device_data_status"` BuildingId int `json:"building_id"` BuildingName string `json:"building_name"` DataFrom string `json:"data_from"` GatewayType int `json:"gateway_type"` FullRegionName string `json:"full_region_name"` DevicesReplaceStatus int `json:"devices_replace_status"` DevicesReplaceApplyStatus int `json:"devices_replace_apply_status"` Bacnet []interface{} `json:"bacnet"` RatioId int `json:"ratio_id"` Sort int `json:"sort"` DevicesTypeFanRatio int `json:"devices_type_fan_ratio"` } `json:"devices"` Count int `json:"count"` } // DeviceStatistics 设备统计 type DeviceStatistics struct { CategoryStatistics []struct { CategoryId int `json:"category_id"` CategoryName string `json:"category_name"` Total int `json:"total"` TypeStatistics []struct { DevicesTypeId int `json:"devices_type_id"` DevicesTypeName string `json:"devices_type_name"` Total int `json:"total"` OnLine int `json:"on_line"` OffLine int `json:"off_line"` } `json:"type_statistics"` CategorySort int `json:"category_sort"` OnLine int `json:"on_line"` OffLine int `json:"off_line"` } `json:"category_statistics"` } type AlarmStatistics struct { MessageStatistics []struct { AlarmType int `json:"alarm_type"` Count int `json:"count"` } `json:"message_statistics"` LevelStatistics []struct { AlarmLevel int `json:"alarm_level"` Count int `json:"count"` } `json:"level_statistics"` StatusStatistics []struct { AlarmStatus int `json:"alarm_Status"` Count int `json:"count"` } `json:"status_statistics"` TimeStatistics []struct { TimeDay time.Time `json:"time_day"` Time string `json:"time"` Count int `json:"count"` } `json:"time_statistics"` } type AlarmCount struct { Alarm []struct { AlarmMessageId int `json:"alarm_message_id"` OrgId int `json:"org_id"` DeviceId int `json:"device_id"` GatewayId int `json:"gateway_id"` AlarmTitle string `json:"alarm_title"` AlarmRemarks string `json:"alarm_remarks"` AlarmCreateTime string `json:"alarm_create_time"` AlarmRecentlyTime string `json:"alarm_recently_time"` AlarmType int `json:"alarm_type"` AlarmLevel int `json:"alarm_level"` AlarmRecoveryTime string `json:"alarm_recovery_time"` AlarmIsRead int `json:"alarm_is_read"` DevicesName string `json:"devices_name"` OrdersStatus int `json:"orders_status"` AlarmDurationTime string `json:"alarm_duration_time"` GatewayName string `json:"gateway_name"` FullRegionName string `json:"full_region_name"` AlarmStatus int `json:"alarm_status"` WorkOrder interface{} `json:"work_order"` OrdersId int `json:"orders_id"` } `json:"alarm"` Count int `json:"count"` } type GatewayFind struct { GatewayAndBacnet []struct { GatewayId int `json:"gateway_id"` GatewayName string `json:"gateway_name"` GatewayCode string `json:"gateway_code"` GatewayDescription string `json:"gateway_description"` GatewayOrgId int `json:"gateway_org_id"` GatewayStatus int `json:"gateway_status"` GatewayLastRequestTime time.Time `json:"gateway_last_request_time"` CreateTime time.Time `json:"create_time"` CreateAuthor int `json:"create_author"` UserName string `json:"user_name"` GatewayType int `json:"gateway_type"` EncryAlg int `json:"encry_alg"` EncryKey string `json:"encry_key"` BacnetId int `json:"bacnet_id"` Interface string `json:"interface"` Port int `json:"port"` OrgId int `json:"org_id"` UpdateUserId int `json:"update_user_id"` UpdateTime string `json:"update_time"` HisSaveCycle int `json:"his_save_cycle"` LimitHisSaveCycle int `json:"limit_his_save_cycle"` DdcIpInstance []interface{} `json:"ddc_ip_instance"` CollectCycle int `json:"collect_cycle"` RemoteIp string `json:"remote_ip"` MqttUsername string `json:"mqtt_username"` MqttPassword string `json:"mqtt_password"` GatewayModbusTcp interface{} `json:"gateway_modbus_tcp"` GatewayIp string `json:"gateway_ip"` } `json:"gatewayAndBacnet"` Count int `json:"count"` } // 设备控制 type DevicesControl struct { Status int `json:"status"` Msg string `json:"msg"` Mac string `json:"mac"` Udid string `json:"udid"` Device string `json:"device"` Region string `json:"region"` Enabled int `json:"enabled"` LastRequestTime string `json:"last_request_time"` } // DeviceOrgid 定时策略 type DeviceOrgid struct { Count int `json:"count"` Timing []struct { TimingId int `json:"timing_id"` TimingName string `json:"timing_name"` TimingWeek int `json:"timing_week"` TimingStartTime string `json:"timing_start_time"` TimingState int `json:"timing_state"` TimingAgreement string `json:"timing_agreement"` OrgId int `json:"org_id"` DeviceIds []interface{} `json:"device_ids"` Devices []interface{} `json:"devices"` Weeks []int `json:"weeks"` Agreement string `json:"agreement"` RegionIds string `json:"region_ids"` CategoryId int `json:"category_id"` DeviceTypeId int `json:"device_type_id"` GroupId int `json:"group_id"` CommitAgreement string `json:"commit_agreement"` } `json:"Timing"` } // GetBuildingRegionRoomTree 获取建筑区域树 type GetBuildingRegionRoomTree struct { Data []struct { Id int `json:"id"` Name string `json:"name"` Type int `json:"type"` ParentId int `json:"parentId"` RegionId int `json:"RegionId"` BuildingId int `json:"BuildingId"` IsLastRegion int `json:"IsLastRegion"` RegionType int `json:"RegionType"` ParentName string `json:"parentName"` SysRole []interface{} `json:"sys_role"` Children []interface{} `json:"children"` BuildingProvinceId int `json:"building_province_id"` BuildingCityId int `json:"building_city_id"` BuildingCountyId int `json:"building_county_id"` ProvinceName string `json:"province_name"` CityName string `json:"city_name"` CountyName string `json:"county_name"` BuildingAddress string `json:"building_address"` BuildingLongitude string `json:"building_longitude"` BuildingLatitude string `json:"building_latitude"` RoomAccountBalance int `json:"room_account_balance"` Sort int `json:"sort"` ChildrenCount int `json:"children_count"` BuildingCoordAddress string `json:"building_coord_address"` RoomArea int `json:"room_area"` SplicingId string `json:"splicing_id"` TotalUser int `json:"total_user"` TotalArea int `json:"total_area"` TotalAir int `json:"total_air"` } `json:"data"` BuildCount int `json:"build_count"` } type CategoryPart struct { BaseDevicesCategorys []struct { CategoryId int `json:"category_id"` CategoryClassification string `json:"category_classification"` CategoryName string `json:"category_name"` CategorySystematic int `json:"category_systematic"` CategorySort int `json:"category_sort"` TsHour string `json:"ts_hour"` TsDay string `json:"ts_day"` TsHourStatistics string `json:"ts_hour_statistics"` TsDayStatistics string `json:"ts_day_statistics"` TsHis string `json:"ts_his"` } `json:"BaseDevicesCategorys"` } // 设备列表 type DeviceAllMini struct { Devices []struct { DevicesId int `json:"devices_id"` DevicesUdid string `json:"devices_udid"` DevicesTypeId int `json:"devices_type_id"` DevicesName string `json:"devices_name"` DevicesLastRequestTime time.Time `json:"devices_last_request_time"` DevicesEnabled int `json:"devices_enabled"` DevicesCreated time.Time `json:"devices_created"` DevicesTypeCode string `json:"devices_type_code"` DevicesTypeName string `json:"devices_type_name"` DevicesTypeCharging int `json:"devices_type_charging"` CategoryId int `json:"category_id"` CategoryClassification string `json:"category_classification"` CategoryName string `json:"category_name"` GatewayId int `json:"gateway_id"` GatewayCode string `json:"gateway_code"` GatewayName string `json:"gateway_name"` FullRegionName string `json:"full_region_name"` RoomName string `json:"room_name"` Sort int `json:"sort"` } `json:"devices"` Count int `json:"count"` } // 定时策略保存-请求参数 type TimingSave struct { RegionIds string `json:"region_ids"` Radio int `json:"radio"` TimingName string `json:"timing_name"` Weeks []int `json:"weeks"` TimingStartTime string `json:"timing_start_time"` TimingAgreement string `json:"timing_agreement"` CommitAgreement string `json:"commit_agreement"` DeviceIds []int `json:"device_ids"` TimingState int `json:"timing_state"` TimingId int `json:"timing_id"` } type ResponeTimingSave struct { TimingId int `json:"timing_id"` TimingName string `json:"timing_name"` TimingWeek int `json:"timing_week"` TimingStartTime string `json:"timing_start_time"` TimingState int `json:"timing_state"` TimingAgreement string `json:"timing_agreement"` OrgId int `json:"org_id"` DeviceIds []interface{} `json:"device_ids"` Devices []interface{} `json:"devices"` Weeks []interface{} `json:"weeks"` Agreement string `json:"agreement"` RegionIds string `json:"region_ids"` CategoryId int `json:"category_id"` DeviceTypeId int `json:"device_type_id"` GroupId int `json:"group_id"` CommitAgreement string `json:"commit_agreement"` } // 获取设备类型 type GetTypeFind struct { Count int `json:"count"` BaseDeviceType []struct { DevicesTypeId int `json:"devices_type_id"` DevicesTypeCode string `json:"devices_type_code"` DevicesTypeName string `json:"devices_type_name"` DevicesTypeWiredWireless int `json:"devices_type_wired_wireless"` DevicesTypeCategoryId int `json:"devices_type_category_id"` DevicesTypeSort int `json:"devices_type_sort"` DevicesTypeCharging int `json:"devices_type_charging"` CategoryName string `json:"category_name"` CategoryClassification string `json:"category_classification"` IsControl int `json:"is_control"` DialectAgreements []struct { DialectId int `json:"dialect_id"` DeviceTypeId int `json:"device_type_id"` DialectKey string `json:"dialect_key"` DialectDataType int `json:"dialect_data_type"` DialectIsEnable int `json:"dialect_is_enable"` AgreementId int `json:"agreement_id"` DialectShow int `json:"dialect_show"` DialectSetting int `json:"dialect_setting"` DialectRange int `json:"dialect_range"` DialectMin int `json:"dialect_min"` DialectMax int `json:"dialect_max"` DialectDetails int `json:"dialect_details"` AgreementKey string `json:"agreement_key"` AgreementName string `json:"agreement_name"` AgreementDataType int `json:"agreement_data_type"` AgreementDescription string `json:"agreement_description"` OpsMonitorSettingIsShow int `json:"ops_monitor_setting_is_show"` DialectAgreements []interface{} `json:"dialect_agreements"` Option []struct { OptionId int `json:"option_id"` AgreementId int `json:"agreement_id"` OptionValue string `json:"option_value"` OptionName string `json:"option_name"` Kv string `json:"kv"` DialectDataoptionId int `json:"dialect_dataoption_id"` DialectId int `json:"dialect_id"` DialectOptionValue string `json:"dialect_option_value"` AgreementOptionId int `json:"agreement_option_id"` DialectOptionShow int `json:"dialect_option_show"` DialectOptionSetting int `json:"dialect_option_setting"` } `json:"option"` DialectParentId int `json:"dialect_parent_id"` Sort int `json:"sort"` DialectStepLen int `json:"dialect_step_len"` } `json:"dialect_agreements"` EnergyType []interface{} `json:"energy_type"` DeviceTypeFile []interface{} `json:"device_type_file"` TypeFileId int `json:"type_file_id"` DevicesTypeImage interface{} `json:"devices_type_image"` IsSettingFanRatio int `json:"is_setting_fan_ratio"` Sum int `json:"sum"` FunctionType []interface{} `json:"function_type"` DevicesTypeNonStandard int `json:"devices_type_non_standard"` } `json:"baseDeviceType"` } // 获取定时策略详情 type TimingId struct { TimingId int `json:"timing_id"` TimingName string `json:"timing_name"` TimingWeek int `json:"timing_week"` TimingStartTime string `json:"timing_start_time"` TimingState int `json:"timing_state"` TimingAgreement string `json:"timing_agreement"` OrgId int `json:"org_id"` DeviceIds []int `json:"device_ids"` Devices []struct { DevicesId int `json:"devices_id"` DevicesUdid string `json:"devices_udid"` DevicesTypeId int `json:"devices_type_id"` DevicesName string `json:"devices_name"` DevicesReqInterval int `json:"devices_req_interval"` DevicesLastRequestTime time.Time `json:"devices_last_request_time"` DevicesJsonObject string `json:"devices_json_object"` DevicesEnabled int `json:"devices_enabled"` DevicesCreated time.Time `json:"devices_created"` DevicesSource string `json:"devices_source"` DevicesDescription string `json:"devices_description"` ExtendId int `json:"extend_id"` BaseId int `json:"base_id"` Longitude string `json:"longitude"` Latitude string `json:"latitude"` ExtendJson string `json:"extend_json"` Adcode string `json:"adcode"` McuFirmwareVer string `json:"mcu_firmware_ver"` WifiFirmwareVer string `json:"wifi_firmware_ver"` McuProgramCode string `json:"mcu_program_code"` UpdatePrior int `json:"update_prior"` LastUpdateQueueTime string `json:"last_update_queue_time"` LastUpdateValue int `json:"last_update_value"` UtcDeviation int `json:"utc_deviation"` ConsecutiveUpdateTimes int `json:"consecutive_update_times"` UpgradeOption int `json:"upgrade_option"` DevicesTypeCode string `json:"devices_type_code"` DevicesTypeName string `json:"devices_type_name"` DevicesTypeWiredWireless int `json:"devices_type_wired_wireless"` DevicesTypeCategoryId int `json:"devices_type_category_id"` DevicesTypeSort int `json:"devices_type_sort"` DevicesTypeCharging int `json:"devices_type_charging"` CategoryId int `json:"category_id"` CategoryClassification string `json:"category_classification"` CategoryName string `json:"category_name"` CategorySystematic int `json:"category_systematic"` CategorySort int `json:"category_sort"` GatewayId int `json:"gateway_id"` GatewayCode string `json:"gateway_code"` GatewayDescription string `json:"gateway_description"` GatewayOrgId int `json:"gateway_org_id"` GatewayStatus int `json:"gateway_status"` GatewayLastRequestTime string `json:"gateway_last_request_time"` DevicesGatewayId int `json:"devices_gateway_id"` RoomId int `json:"room_id"` RoomRegionId int `json:"room_region_id"` RoomName string `json:"room_name"` RoomUserId int `json:"room_user_id"` RoomCheckinDate string `json:"room_checkin_date"` RoomCheckoutDate string `json:"room_checkout_date"` RegionId int `json:"region_id"` RegionBuildingId int `json:"region_building_id"` RegionName string `json:"region_name"` RegionParentId int `json:"region_parent_id"` OnLine int `json:"on_line"` RealDeviceName string `json:"real_device_name"` DeviceDataStatus int `json:"device_data_status"` BuildingId int `json:"building_id"` BuildingName string `json:"building_name"` ProvinceId int `json:"province_id"` ProvinceName string `json:"province_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` CountyId int `json:"county_id"` CountyName string `json:"county_name"` OfflineConsecutiveTimes int `json:"offline_consecutive_times"` OfflineInterval int `json:"offline_interval"` OfflineLastRequestTime string `json:"offline_last_request_time"` DataFrom string `json:"data_from"` OriginalMcuFirmwareVer string `json:"original_mcu_firmware_ver"` OriginalWifiFirmwareVer string `json:"original_wifi_firmware_ver"` Ip string `json:"ip"` LastRequestTimestampInSeconds string `json:"lastRequestTimestampInSeconds"` RoomType string `json:"room_type"` GatewayName string `json:"gateway_name"` LastFreqTimestamp string `json:"last_freq_timestamp"` UpgradeFreq bool `json:"upgrade_freq"` DeviceVer string `json:"device_ver"` LastUpdateSuccessTime string `json:"last_update_success_time"` DownloadPercent int `json:"download_percent"` FileDeviceVersion string `json:"file_device_version"` ProgramName string `json:"program_name"` GatewayType int `json:"gateway_type"` FullRegionName string `json:"full_region_name"` DevicesReplaceStatus int `json:"devices_replace_status"` DevicesReplaceApplyStatus int `json:"devices_replace_apply_status"` } `json:"devices"` Weeks []int `json:"weeks"` Agreement string `json:"agreement"` RegionIds string `json:"region_ids"` CategoryId int `json:"category_id"` DeviceTypeId int `json:"device_type_id"` GroupId int `json:"group_id"` CommitAgreement string `json:"commit_agreement"` } func (m *Illuminating) TableName() string { return "illuminating" }