数据 输入输出 处理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

package models
import (
"time"
)
type IotaData struct {
UserId string `json:"userId"`
ThingId string `json:"thingId"`
DimensionId string `json:"dimensionId"`
DimCapId string `json:"dimCapId"`
CapId string `json:"capId"`
DeviceId string `json:"deviceId"`
ScheduleId string `json:"scheduleId"`
TaskId string `json:"taskId"`
JobId int `json:"jobId"`
JobRepeatId int `json:"jobRepeatId"`
TriggerTime time.Time `json:"triggerTime"`
RealTime time.Time `json:"realTime"`
FinishTime time.Time `json:"finishTime"`
Seq int `json:"seq"`
Released bool `json:"released"`
Data Data `json:"data"`
}
type Data struct {
Type int `json:"type"`
Data map[string]any `json:"data"`
Result struct {
Code int `json:"code"`
Msg string `json:"msg"`
Detail any `json:"detail"`
ErrTimes int `json:"errTimes"`
Dropped bool `json:"dropped"`
} `json:"result"`
}
func (the *Data) Success() bool {
return the.Result.Code == 0
}
type AlarmMsg struct {
MessageMode string `json:"messageMode"`
StructureId int `json:"structureId"`
StructureName string `json:"structureName"`
SourceId string `json:"sourceId"`
SourceName string `json:"sourceName"`
AlarmTypeCode string `json:"alarmTypeCode"`
AlarmCode string `json:"alarmCode"`
Content string `json:"content"`
Time string `json:"time"`
SourceTypeId int `json:"sourceTypeId"`
Sponsor interface{} `json:"sponsor"`
Extras interface{} `json:"extras"`
}