mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-11 04:50:25 +08:00
IP库查询提供更多信息
This commit is contained in:
@@ -195,6 +195,9 @@ func (this *IPLibraryService) LookupIPRegion(ctx context.Context, req *pb.Lookup
|
|||||||
Isp: result.ProviderName(),
|
Isp: result.ProviderName(),
|
||||||
CountryId: result.CountryId(),
|
CountryId: result.CountryId(),
|
||||||
ProvinceId: result.ProvinceId(),
|
ProvinceId: result.ProvinceId(),
|
||||||
|
CityId: result.CityId(),
|
||||||
|
TownId: result.TownId(),
|
||||||
|
ProviderId: result.ProviderId(),
|
||||||
Summary: result.Summary(),
|
Summary: result.Summary(),
|
||||||
}}, nil
|
}}, nil
|
||||||
}
|
}
|
||||||
@@ -213,12 +216,17 @@ func (this *IPLibraryService) LookupIPRegions(ctx context.Context, req *pb.Looku
|
|||||||
var info = iplibrary.LookupIP(ip)
|
var info = iplibrary.LookupIP(ip)
|
||||||
if info != nil && info.IsOk() {
|
if info != nil && info.IsOk() {
|
||||||
result[ip] = &pb.IPRegion{
|
result[ip] = &pb.IPRegion{
|
||||||
Country: info.CountryName(),
|
Country: info.CountryName(),
|
||||||
Region: "",
|
Region: "",
|
||||||
Province: info.ProvinceName(),
|
Province: info.ProvinceName(),
|
||||||
City: info.CityName(),
|
City: info.CityName(),
|
||||||
Isp: info.ProviderName(),
|
Isp: info.ProviderName(),
|
||||||
Summary: info.Summary(),
|
CountryId: info.CountryId(),
|
||||||
|
ProvinceId: info.ProvinceId(),
|
||||||
|
CityId: info.CityId(),
|
||||||
|
TownId: info.TownId(),
|
||||||
|
ProviderId: info.ProviderId(),
|
||||||
|
Summary: info.Summary(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user