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

19 lines
275 B
Go
Raw Permalink Normal View History

2020-12-10 15:03:03 +08:00
package models
2022-01-23 19:16:52 +08:00
import "encoding/json"
func (this *NodeRegion) DecodePriceMap() map[int64]float64 {
var m = map[int64]float64{}
if len(this.Prices) == 0 {
return m
}
2022-03-22 19:30:30 +08:00
err := json.Unmarshal(this.Prices, &m)
2022-01-23 19:16:52 +08:00
if err != nil {
// 忽略错误
return m
}
return m
}