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

17 lines
345 B
Go
Raw Normal View History

2020-11-11 21:32:25 +08:00
package models
import (
"encoding/json"
"github.com/iwind/TeaGo/maps"
)
// 获取API参数
func (this *DNSProvider) DecodeAPIParams() (maps.Map, error) {
if len(this.ApiParams) == 0 || this.ApiParams == "null" {
return maps.Map{}, nil
}
result := maps.Map{}
err := json.Unmarshal([]byte(this.ApiParams), &result)
return result, err
}