mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2026-03-23 08:13:59 +08:00
refactor(重构代码): 重构并保持接口兼容
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user