增加城市/ISP查询接口

This commit is contained in:
GoEdgeLab
2022-01-06 16:25:23 +08:00
parent f1190623f1
commit 6eddcbcbb6
12 changed files with 251 additions and 31 deletions

View File

@@ -1 +1,18 @@
package regions
import (
"encoding/json"
"github.com/iwind/TeaGo/logs"
)
func (this *RegionCity) DecodeCodes() []string {
if len(this.Codes) == 0 {
return []string{}
}
result := []string{}
err := json.Unmarshal([]byte(this.Codes), &result)
if err != nil {
logs.Error(err)
}
return result
}