Files
EdgeAPI/internal/db/models/metric_item_model_ext.go

15 lines
232 B
Go
Raw Normal View History

2021-06-30 19:59:49 +08:00
package models
2021-06-27 21:59:37 +08:00
2021-06-30 19:59:49 +08:00
import (
"encoding/json"
)
2021-06-27 21:59:37 +08:00
2021-06-30 19:59:49 +08:00
// DecodeKeys 解析Key
2021-06-27 21:59:37 +08:00
func (this *MetricItem) DecodeKeys() []string {
var result []string
if len(this.Keys) > 0 {
_ = json.Unmarshal([]byte(this.Keys), &result)
}
return result
}