diff --git a/build/rpc.json b/build/rpc.json index c84470d..0dd120b 100644 --- a/build/rpc.json +++ b/build/rpc.json @@ -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信息" }, { diff --git a/pkg/rpc/pb/service_ip_library.pb.go b/pkg/rpc/pb/service_ip_library.pb.go index f1362b7..a9ff9ee 100644 --- a/pkg/rpc/pb/service_ip_library.pb.go +++ b/pkg/rpc/pb/service_ip_library.pb.go @@ -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, diff --git a/pkg/rpc/protos/service_ip_library.proto b/pkg/rpc/protos/service_ip_library.proto index 65a6e6f..eec4d83 100644 --- a/pkg/rpc/protos/service_ip_library.proto +++ b/pkg/rpc/protos/service_ip_library.proto @@ -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; // 完整的地区组合 }