refactor(重构代码): 重构并保持接口兼容

This commit is contained in:
2026-01-08 11:14:24 +08:00
parent cc141ac4f5
commit 999c6f1442
11 changed files with 511 additions and 261 deletions

13
qqwry_ipdb.go Normal file
View File

@@ -0,0 +1,13 @@
package qqwry
// queryIPIpdb 从IPDB数据库查询IP
// 入参: ip IP地址
// 返回: location 位置信息, err 错误信息
func (c *Client) queryIPIpdb(ip string) (location *Location, err error) {
ret, err := c.ipdbCity.Find(ip, "CN")
if err != nil {
return
}
location = SplitResult(ret[0], ret[1], ip)
return location, nil
}