IP库查询增加更多信息

This commit is contained in:
刘祥超
2023-04-19 18:20:34 +08:00
parent 753552d4a4
commit 4e80f62837
3 changed files with 50 additions and 18 deletions

View File

@@ -19263,7 +19263,7 @@
},
{
"name": "IPRegion",
"code": "message IPRegion {\n\tstring country = 1;\n\tstring region = 2;\n\tstring province = 3;\n\tstring city = 4;\n\tstring isp = 5;\n\tint64 countryId = 6;\n\tint64 provinceId = 7;\n\tstring summary = 8; // 完整的地区组合\n}",
"code": "message IPRegion {\n\tstring country = 1; // 国家/地区名称\n\tstring region = 2; // 区域名称\n\tstring province = 3; // 省份名称\n\tstring city = 4; // 城市名称\n\tstring isp = 5; // 运营商名称\n\tint64 countryId = 6; // 国家/地区ID\n\tint64 provinceId = 7; // 省份ID\n\tint64 cityId = 9; // 城市ID\n\tint64 townId = 10; // 区县ID\n\tint64 providerId = 11; // 运营商ID\n\tstring summary = 8; // 完整的地区组合\n}",
"doc": "IP信息"
},
{

View File

@@ -661,14 +661,17 @@ type IPRegion struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Country string `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"`
Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
Province string `protobuf:"bytes,3,opt,name=province,proto3" json:"province,omitempty"`
City string `protobuf:"bytes,4,opt,name=city,proto3" json:"city,omitempty"`
Isp string `protobuf:"bytes,5,opt,name=isp,proto3" json:"isp,omitempty"`
CountryId int64 `protobuf:"varint,6,opt,name=countryId,proto3" json:"countryId,omitempty"`
ProvinceId int64 `protobuf:"varint,7,opt,name=provinceId,proto3" json:"provinceId,omitempty"`
Summary string `protobuf:"bytes,8,opt,name=summary,proto3" json:"summary,omitempty"` // 完整的地区组合
Country string `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"` // 国家/地区名称
Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` // 区域名称
Province string `protobuf:"bytes,3,opt,name=province,proto3" json:"province,omitempty"` // 省份名称
City string `protobuf:"bytes,4,opt,name=city,proto3" json:"city,omitempty"` // 城市名称
Isp string `protobuf:"bytes,5,opt,name=isp,proto3" json:"isp,omitempty"` // 运营商名称
CountryId int64 `protobuf:"varint,6,opt,name=countryId,proto3" json:"countryId,omitempty"` // 国家/地区ID
ProvinceId int64 `protobuf:"varint,7,opt,name=provinceId,proto3" json:"provinceId,omitempty"` // 省份ID
CityId int64 `protobuf:"varint,9,opt,name=cityId,proto3" json:"cityId,omitempty"` // 城市ID
TownId int64 `protobuf:"varint,10,opt,name=townId,proto3" json:"townId,omitempty"` // 区县ID
ProviderId int64 `protobuf:"varint,11,opt,name=providerId,proto3" json:"providerId,omitempty"` // 运营商ID
Summary string `protobuf:"bytes,8,opt,name=summary,proto3" json:"summary,omitempty"` // 完整的地区组合
}
func (x *IPRegion) Reset() {
@@ -752,6 +755,27 @@ func (x *IPRegion) GetProvinceId() int64 {
return 0
}
func (x *IPRegion) GetCityId() int64 {
if x != nil {
return x.CityId
}
return 0
}
func (x *IPRegion) GetTownId() int64 {
if x != nil {
return x.TownId
}
return 0
}
func (x *IPRegion) GetProviderId() int64 {
if x != nil {
return x.ProviderId
}
return 0
}
func (x *IPRegion) GetSummary() string {
if x != nil {
return x.Summary
@@ -828,7 +852,7 @@ var file_service_ip_library_proto_rawDesc = []byte{
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd6, 0x01, 0x0a, 0x08, 0x49,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa6, 0x02, 0x0a, 0x08, 0x49,
0x50, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
@@ -840,7 +864,12 @@ var file_service_ip_library_proto_rawDesc = []byte{
0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
0x76, 0x69, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70,
0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d,
0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x69, 0x74,
0x79, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x69, 0x74, 0x79, 0x49,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x74, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70,
0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d,
0x6d, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d,
0x61, 0x72, 0x79, 0x32, 0x99, 0x05, 0x0a, 0x10, 0x49, 0x50, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72,
0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61,

View File

@@ -102,12 +102,15 @@ message LookupIPRegionsResponse {
// IP信息
message IPRegion {
string country = 1;
string region = 2;
string province = 3;
string city = 4;
string isp = 5;
int64 countryId = 6;
int64 provinceId = 7;
string country = 1; // 国家/地区名称
string region = 2; // 区域名称
string province = 3; // 省份名称
string city = 4; // 城市名称
string isp = 5; // 运营商名称
int64 countryId = 6; // 国家/地区ID
int64 provinceId = 7; // 省份ID
int64 cityId = 9; // 城市ID
int64 townId = 10; // 区县ID
int64 providerId = 11; // 运营商ID
string summary = 8; // 完整的地区组合
}