mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-12 14:50:25 +08:00
对服务增加基础的数据统计/部分代码分Package
This commit is contained in:
16
internal/db/models/dns/dns_provider_model_ext.go
Normal file
16
internal/db/models/dns/dns_provider_model_ext.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package dns
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user