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.
34 lines
839 B
34 lines
839 B
1 month ago
|
package common_models
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type IotaAlarm struct {
|
||
|
Id string `json:"id"`
|
||
|
Status string `json:"status"`
|
||
|
RepeatTimes int `json:"repeatTimes"`
|
||
|
StartsAt time.Time `json:"startsAt"`
|
||
|
Severity int `json:"severity"`
|
||
|
Labels Labels `json:"labels"`
|
||
|
Annotations Annotations `json:"annotations"`
|
||
|
}
|
||
|
|
||
|
func (the *IotaAlarm) R_() string {
|
||
|
return fmt.Sprintf("[t:%s][d:%s]", the.Labels.ThingId, the.Labels.DeviceId)
|
||
|
}
|
||
|
|
||
|
type Labels struct {
|
||
|
AlertName string `json:"id"`
|
||
|
DeviceId string `json:"deviceId"`
|
||
|
TaskId string `json:"taskId"`
|
||
|
DimensionId string `json:"dimensionId"`
|
||
|
ThingId string `json:"thingId"`
|
||
|
UserId string `json:"userId"`
|
||
|
}
|
||
|
type Annotations struct {
|
||
|
Summary string `json:"summary"`
|
||
|
Description string `json:"description"`
|
||
|
}
|