增加城市/ISP查询接口

This commit is contained in:
刘祥超
2022-01-06 16:25:23 +08:00
parent e7b0f0df90
commit d35db163ae
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 *RegionProvider) 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
}