Files
zmkgC/internal/app/system/model/manage_device.go
2025-07-07 20:11:59 +08:00

108 lines
7.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ==========================================================================
// GFast自动生成model操作代码。
// 生成日期2023-11-14 10:53:21
// 生成路径: internal/app/system/model/manage_device.go
// 生成人gfast
// desc:设备信息
// company:云南奇讯科技有限公司
// ==========================================================================
package model
import (
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/gmeta"
)
// ManageDeviceInfoRes is the golang structure for table manage_device.
type ManageDeviceInfoRes struct {
gmeta.Meta `orm:"table:manage_device"`
Id uint64 `orm:"id,primary" json:"id"` // 自增ID
DeviceSn string `orm:"device_sn" json:"deviceSn"` // 对接站点、无人机或遥控器的序列号
DeviceName string `orm:"device_name" json:"deviceName"` // 设备的型号。该参数对应设备字典表中的设备名称
MqClientId string `orm:"mq_client_id" json:"mqClientId"` // 客户端id
UserId string `orm:"user_id" json:"userId"` // 设备绑定时使用的账号
Nickname string `orm:"nickname" json:"nickname"` // 设备的自定义名称
WorkspaceId string `orm:"workspace_id" json:"workspaceId"` // 当前设备所属的工作区
DeviceType int64 `orm:"device_type" json:"deviceType"` // 该参数对应设备字典表中的设备类型
SubType int64 `orm:"sub_type" json:"subType"` // 该参数对应设备字典表中的子类型
Domain int64 `orm:"domain" json:"domain"` // 该参数对应设备字典表中的域
FirmwareVersion string `orm:"firmware_version" json:"firmwareVersion"` // 设备的固件版本
CompatibleStatus int `orm:"compatible_status" json:"compatibleStatus"` // 1: 一致0: 不一致;固件版本是否一致
Version string `orm:"version" json:"version"` // 协议版本。该字段目前没有用处。
DeviceIndex string `orm:"device_index" json:"deviceIndex"` // 无人机的控制A控制或B控制
ChildSn string `orm:"child_sn" json:"childSn"` // 由网关控制的设备
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
BoundTime *gtime.Time `orm:"bound_time" json:"boundTime"` // 设备绑定工作区的时间
BoundStatus int `orm:"bound_status" json:"boundStatus"` // 设备绑定工作区的状态。1: 已绑定0: 未绑定
LoginTime *gtime.Time `orm:"login_time" json:"loginTime"` // 设备的上次登录时间
DeviceDesc string `orm:"device_desc" json:"deviceDesc"` // 设备描述
UrlNormal string `orm:"url_normal" json:"urlNormal"` // 遥控器上显示的图标
UrlSelect string `orm:"url_select" json:"urlSelect"` // 选中遥控器时显示的图标
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
DictionaryId int64 `orm:"dictionary_id" json:"dictionaryId"` // 该参数对应设备字典表中的设备类型
LngAndLatAndHeight string `orm:"lngAndLatAndHeight" json:"lngAndLatAndHeight"`
ManageDeviceVideoEntity []*ManageDeviceVideoEntity `json:"manageDeviceVideoEntity" orm:"with:gateway_sn=mq_client_id"`
}
type ManageDeviceListRes struct {
Id uint64 `json:"id"`
DeviceSn string `json:"deviceSn"`
DeviceName string `json:"deviceName"`
MqClientId string `json:"mqClientId"`
UserId string `json:"userId"`
Nickname string `json:"nickname"`
WorkspaceId string `json:"workspaceId"`
DeviceType int64 `json:"deviceType"`
SubType int64 `json:"subType"`
Domain int64 `json:"domain"`
FirmwareVersion string `json:"firmwareVersion"`
CompatibleStatus int `json:"compatibleStatus"`
Version string `json:"version"`
DeviceIndex string `json:"deviceIndex"`
ChildSn string `json:"childSn"`
CreatedAt *gtime.Time `json:"createdAt"`
BoundTime *gtime.Time `json:"boundTime"`
BoundStatus int `json:"boundStatus"`
LoginTime *gtime.Time `json:"loginTime"`
DeviceDesc string `json:"deviceDesc"`
UrlNormal string `json:"urlNormal"`
UrlSelect string `json:"urlSelect"`
ProjectId int64 `json:"projectId"`
DictionaryId int64 `json:"dictionaryId"`
LngAndLatAndHeight string `json:"lngAndLatAndHeight"`
ManageDeviceVideoEntity []*ManageDeviceVideoEntity `json:"manageDeviceVideoEntity"`
}
type ManageDeviceVideoEntity struct {
gmeta.Meta `orm:"table:manage_device_video"`
Id string `json:"id" dc:"主键ID"`
Type string `json:"type" dc:"0机场 1飞机"`
GatewaySn string `json:"gatewaySn"`
DeviceSn string `json:"deviceSn"`
SonSn string `json:"sonSn"`
}
// ManageDeviceDictionaryInfo 产品枚举
type ManageDeviceDictionaryInfo struct {
gmeta.Meta `orm:"table:manage_device_dictionary"`
Id uint64 `orm:"id,primary" json:"id"`
Domain string `orm:"domain" json:"domain" dc:"该参数对应文档中的产品类型中的域。0: 无人机; 1: 载荷; 2: 遥控器; 3: 停机坪"`
DeviceType string `orm:"device_type" json:"device_type" dc:"该参数对应文档中的产品类型中的类型"`
SubType string `orm:"sub_type" json:"sub_type" dc:"该参数对应文档中的产品类型中的子类型"`
DeviceName string `orm:"device_name" json:"device_name" dc:"该参数对应文档中的产品类型中的名称"`
DeviceDesc string `orm:"device_desc" json:"device_desc" dc:"备注"`
}
// ButtonEntity 飞机调试模式下的一些按钮状态
type ButtonEntity struct {
gmeta.Meta `orm:"table:manage_button_state"`
MqClientId string `orm:"mq_client_id" json:"mqClientId" dc:"关联飞机"`
Debug int16 `orm:"debug" json:"debug" dc:"调试模式1开 2关"`
HatchCover int16 `orm:"hatch_cover" json:"hatchCover" dc:"舱盖"`
Power int16 `orm:"power" json:"power" dc:"飞行器电源 "`
PushRod int16 `orm:"push_rod" json:"pushRod" dc:"推杆"`
Recharge int16 `orm:"recharge" json:"recharge" dc:"飞行器充电"`
}