Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IotAlert ¶
type IotAlert struct {
// 告警ID
ID uint64 `db:"id" json:"id"`
// 告警名称
Name string `db:"name" json:"name"`
// 告警级别(1=提醒通知,2=轻微问题,3=严重警告)
Level uint32 `db:"level" json:"level"`
// 产品ID
ProductID uint64 `db:"product_id" json:"product_id"`
// 执行动作
Actions json.RawMessage `db:"actions" json:"actions"`
// 告警状态(1-启动,2-停止)
Status int8 `db:"status" json:"status"`
// 消息通知类型[1,2,3],1=设备告警,2=短信通知,3=移动端推送
MessageType sql.NullString `db:"message_type" json:"message_type"`
// 创建者
CreateBy sql.NullString `db:"create_by" json:"create_by"`
// 创建时间
CreateTime time.Time `db:"create_time" json:"create_time"`
// 更新者
UpdateBy sql.NullString `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime time.Time `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
设备告警
type IotAlertTrigger ¶
type IotAlertTrigger struct {
// 告警触发器ID
ID uint64 `db:"id" json:"id"`
// 场景ID
AlertID uint64 `db:"alert_id" json:"alert_id"`
// 告警状态(1-启动,2-停止)
Status int8 `db:"status" json:"status"`
// 触发源(1=设备触发,2=定时触发)
Source uint32 `db:"source" json:"source"`
// 物模型标识符
ThingsModelID sql.NullInt64 `db:"things_model_id" json:"things_model_id"`
// 物模型值
ThingsModelValue sql.NullString `db:"things_model_value" json:"things_model_value"`
// 操作符
Operator sql.NullString `db:"operator" json:"operator"`
// 物模型类别(1=属性,2=功能,3=事件,4=设备升级,5=设备上线,6=设备下线)
Type int8 `db:"type" json:"type"`
// 产品ID
ProductID sql.NullInt64 `db:"product_id" json:"product_id"`
// 任务ID
JobID sql.NullInt64 `db:"job_id" json:"job_id"`
// cron执行表达式
CronExpression string `db:"cron_expression" json:"cron_expression"`
// 是否详细corn表达式(1=是,0=否)
IsAdvance sql.NullInt32 `db:"is_advance" json:"is_advance"`
}
告警触发器
type IotDevice ¶
type IotDevice struct {
// 设备ID
ID uint64 `db:"id" json:"id"`
// 设备名称
Name string `db:"name" json:"name"`
// 产品ID
ProductID uint64 `db:"product_id" json:"product_id"`
// 用户ID
UserID uint64 `db:"user_id" json:"user_id"`
// 设备编号
SerialNumber string `db:"serial_number" json:"serial_number"`
// 子设备网关编号
GwDevCode sql.NullString `db:"gw_dev_code" json:"gw_dev_code"`
// 固件版本
FirmwareVersion float64 `db:"firmware_version" json:"firmware_version"`
// 设备状态(1-未激活,2-禁用,3-在线,4-离线)
Status int8 `db:"status" json:"status"`
// 信号强度
Rssi sql.NullInt32 `db:"rssi" json:"rssi"`
// 定位方式(1=ip自动定位,2=设备定位,3=自定义)
LocationWay int8 `db:"location_way" json:"location_way"`
// 设备所在地址
NetworkAddress sql.NullString `db:"network_address" json:"network_address"`
// 设备入网IP
NetworkIp sql.NullString `db:"network_ip" json:"network_ip"`
// 设备经度
Longitude sql.NullFloat64 `db:"longitude" json:"longitude"`
// 设备纬度
Latitude sql.NullFloat64 `db:"latitude" json:"latitude"`
// 激活时间
ActiveTime sql.NullTime `db:"active_time" json:"active_time"`
// 图片地址
ImgUrl sql.NullString `db:"img_url" json:"img_url"`
// 删除标志(0代表存在 2代表删除)
DelFlag sql.NullString `db:"del_flag" json:"del_flag"`
// 创建者
CreateBy string `db:"create_by" json:"create_by"`
// 创建时间
CreateTime time.Time `db:"create_time" json:"create_time"`
// 更新者
UpdateBy string `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime time.Time `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
设备
type IotEventLog ¶
type IotEventLog struct {
// 设备日志ID
ID uint64 `db:"id" json:"id"`
// 物模型标识符
ThingsModelID sql.NullInt64 `db:"things_model_id" json:"things_model_id"`
// 类型(3=事件上报,5=设备上线,6=设备离线)
Type uint32 `db:"type" json:"type"`
// 日志值
Value string `db:"value" json:"value"`
// 设备ID
DeviceID sql.NullInt64 `db:"device_id" json:"device_id"`
// 是否监测数据(1=是,0=否)
IsMonitor uint32 `db:"is_monitor" json:"is_monitor"`
// 模式(1=影子模式,2=在线模式,3=其他)
Mode int8 `db:"mode" json:"mode"`
// 创建者
CreateBy string `db:"create_by" json:"create_by"`
// 创建时间
CreateTime sql.NullTime `db:"create_time" json:"create_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
事件日志
type IotProduct ¶
type IotProduct struct {
// 产品ID
ID uint64 `db:"id" json:"id"`
// 产品名称
Name string `db:"name" json:"name"`
// 产品分类ID
CategoryID uint64 `db:"category_id" json:"category_id"`
// mqtt账号
MqttAccount sql.NullString `db:"mqtt_account" json:"mqtt_account"`
// mqtt密码
MqttPassword sql.NullString `db:"mqtt_password" json:"mqtt_password"`
// 产品秘钥
MqttSecret sql.NullString `db:"mqtt_secret" json:"mqtt_secret"`
// 状态(1-未发布,2-已发布)
Status int8 `db:"status" json:"status"`
// 物模型JSON(属性、功能、事件)
ThingsModelsJson json.RawMessage `db:"things_models_json" json:"things_models_json"`
// 设备类型(1-直连设备、2-网关设备、3-监控设备)
DeviceType sql.NullInt32 `db:"device_type" json:"device_type"`
// 联网方式(1=wifi、2=蜂窝(2G/3G/4G/5G)、3=以太网、4=其他)
NetworkMethod sql.NullInt32 `db:"network_method" json:"network_method"`
// 认证方式(1-简单认证、2-加密认证、3-简单+加密)
VertificateMethod int8 `db:"vertificate_method" json:"vertificate_method"`
// 图片地址
ImgUrl sql.NullString `db:"img_url" json:"img_url"`
// 删除标志(0代表存在 2代表删除)
DelFlag sql.NullString `db:"del_flag" json:"del_flag"`
// 创建者
CreateBy sql.NullString `db:"create_by" json:"create_by"`
// 创建时间
CreateTime time.Time `db:"create_time" json:"create_time"`
// 更新者
UpdateBy sql.NullString `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime time.Time `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
产品
type IotProductAuthorize ¶
type IotProductAuthorize struct {
// 授权码ID
ID uint64 `db:"id" json:"id"`
// 授权码
Code string `db:"code" json:"code"`
// 设备ID
DeviceID sql.NullInt64 `db:"device_id" json:"device_id"`
// 设备编号
SerialNumber sql.NullString `db:"serial_number" json:"serial_number"`
// 状态(1-未使用,2-使用中)
Status int8 `db:"status" json:"status"`
// 删除标志(0代表存在 2代表删除)
DelFlag string `db:"del_flag" json:"del_flag"`
// 创建者
CreateBy string `db:"create_by" json:"create_by"`
// 创建时间
CreateTime sql.NullTime `db:"create_time" json:"create_time"`
// 更新者
UpdateBy string `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime sql.NullTime `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
产品授权码表
type IotThingsModel ¶
type IotThingsModel struct {
// 物模型ID
ModelID int64 `db:"model_id" json:"model_id"`
// 物模型名称
ModelName string `db:"model_name" json:"model_name"`
// 产品ID
ProductID int64 `db:"product_id" json:"product_id"`
// 产品名称
ProductName string `db:"product_name" json:"product_name"`
// 租户ID
TenantID int64 `db:"tenant_id" json:"tenant_id"`
// 租户名称
TenantName string `db:"tenant_name" json:"tenant_name"`
// 标识符,产品下唯一
Identifier string `db:"identifier" json:"identifier"`
// 模型类别(1-属性,2-功能,3-事件)
Type int8 `db:"type" json:"type"`
// 数据类型(integer、decimal、string、bool、array、enum)
Datatype string `db:"datatype" json:"datatype"`
// 数据定义
Specs json.RawMessage `db:"specs" json:"specs"`
// 是否图表展示(0-否,1-是)
IsChart bool `db:"is_chart" json:"is_chart"`
// 是否实时监测(0-否,1-是)
IsMonitor bool `db:"is_monitor" json:"is_monitor"`
// 是否历史存储(0-否,1-是)
IsHistory sql.NullBool `db:"is_history" json:"is_history"`
// 是否只读数据(0-否,1-是)
IsReadonly sql.NullBool `db:"is_readonly" json:"is_readonly"`
// 排序,值越大,排序越靠前
ModelOrder sql.NullInt32 `db:"model_order" json:"model_order"`
// 删除标志(0代表存在 2代表删除)
DelFlag sql.NullString `db:"del_flag" json:"del_flag"`
// 创建者
CreateBy sql.NullString `db:"create_by" json:"create_by"`
// 创建时间
CreateTime sql.NullTime `db:"create_time" json:"create_time"`
// 更新者
UpdateBy sql.NullString `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime sql.NullTime `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
// 从机id
TempSlaveID sql.NullInt64 `db:"temp_slave_id" json:"temp_slave_id"`
// 计算公式
Formula sql.NullString `db:"formula" json:"formula"`
// 控制公式
ReverseFormula sql.NullString `db:"reverse_formula" json:"reverse_formula"`
// 寄存器地址值
RegAddr sql.NullInt32 `db:"reg_addr" json:"reg_addr"`
// 位定义选项
BitOption sql.NullString `db:"bit_option" json:"bit_option"`
// 解析类型 1.数值 2.选项
ValueType sql.NullString `db:"value_type" json:"value_type"`
// 是否是计算参数
IsParams sql.NullInt32 `db:"is_params" json:"is_params"`
// 读取寄存器数量
Quantity sql.NullInt32 `db:"quantity" json:"quantity"`
// modbus功能码
Code sql.NullString `db:"code" json:"code"`
}
物模型
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GetDeviceInfoByProductIdAndSerialNumber ¶
func (q *Queries) GetDeviceInfoByProductIdAndSerialNumber(ctx context.Context, arg *GetDeviceInfoByProductIdAndSerialNumberParams) (*IotDevice, error)
GetDeviceInfoByProductIdAndSerialNumber 通过产品 ID 和设备编号查询设备信息。
参数: product_id 设备 ID
参数: serial_number 设备编号
别人别修改
type SysUser ¶
type SysUser struct {
// 用户ID
UserID int64 `db:"user_id" json:"user_id"`
// 部门ID
DeptID sql.NullInt64 `db:"dept_id" json:"dept_id"`
// 用户账号
UserName string `db:"user_name" json:"user_name"`
// 用户昵称
NickName string `db:"nick_name" json:"nick_name"`
// 用户类型(00系统用户)
UserType sql.NullString `db:"user_type" json:"user_type"`
// 用户邮箱
Email sql.NullString `db:"email" json:"email"`
// 手机号码
Phonenumber sql.NullString `db:"phonenumber" json:"phonenumber"`
// 用户性别(0男 1女 2未知)
Sex sql.NullString `db:"sex" json:"sex"`
// 头像地址
Avatar sql.NullString `db:"avatar" json:"avatar"`
// 密码
Password sql.NullString `db:"password" json:"password"`
// 帐号状态(0正常 1停用)
Status sql.NullString `db:"status" json:"status"`
// 删除标志(0代表存在 2代表删除)
DelFlag sql.NullString `db:"del_flag" json:"del_flag"`
// 最后登录IP
LoginIp sql.NullString `db:"login_ip" json:"login_ip"`
// 最后登录时间
LoginDate sql.NullTime `db:"login_date" json:"login_date"`
// 创建者
CreateBy sql.NullString `db:"create_by" json:"create_by"`
// 创建时间
CreateTime sql.NullTime `db:"create_time" json:"create_time"`
// 更新者
UpdateBy sql.NullString `db:"update_by" json:"update_by"`
// 更新时间
UpdateTime sql.NullTime `db:"update_time" json:"update_time"`
// 备注
Remark sql.NullString `db:"remark" json:"remark"`
}
用户信息表
Click to show internal directories.
Click to hide internal directories.