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(),
|
||||
CountryId: result.CountryId(),
|
||||
ProvinceId: result.ProvinceId(),
|
||||
CityId: result.CityId(),
|
||||
TownId: result.TownId(),
|
||||
ProviderId: result.ProviderId(),
|
||||
Summary: result.Summary(),
|
||||
}}, nil
|
||||
}
|
||||
@@ -213,12 +216,17 @@ func (this *IPLibraryService) LookupIPRegions(ctx context.Context, req *pb.Looku
|
||||
var info = iplibrary.LookupIP(ip)
|
||||
if info != nil && info.IsOk() {
|
||||
result[ip] = &pb.IPRegion{
|
||||
Country: info.CountryName(),
|
||||
Region: "",
|
||||
Province: info.ProvinceName(),
|
||||
City: info.CityName(),
|
||||
Isp: info.ProviderName(),
|
||||
Summary: info.Summary(),
|
||||
Country: info.CountryName(),
|
||||
Region: "",
|
||||
Province: info.ProvinceName(),
|
||||
City: info.CityName(),
|
||||
Isp: info.ProviderName(),
|
||||
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