diff --git a/pkg/rpc/pb/model_ip_item.pb.go b/pkg/rpc/pb/model_ip_item.pb.go index a256c0c..50b78c6 100644 --- a/pkg/rpc/pb/model_ip_item.pb.go +++ b/pkg/rpc/pb/model_ip_item.pb.go @@ -36,6 +36,8 @@ type IPItem struct { Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` ExpiredAt int64 `protobuf:"varint,5,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"` + ListId int64 `protobuf:"varint,7,opt,name=listId,proto3" json:"listId,omitempty"` + IsDeleted bool `protobuf:"varint,8,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"` } func (x *IPItem) Reset() { @@ -112,11 +114,25 @@ func (x *IPItem) GetReason() string { return "" } +func (x *IPItem) GetListId() int64 { + if x != nil { + return x.ListId + } + return 0 +} + +func (x *IPItem) GetIsDeleted() bool { + if x != nil { + return x.IsDeleted + } + return false +} + var File_model_ip_item_proto protoreflect.FileDescriptor var file_model_ip_item_proto_rawDesc = []byte{ 0x0a, 0x13, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x94, 0x01, 0x0a, 0x06, 0x49, 0x50, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xca, 0x01, 0x0a, 0x06, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, @@ -126,7 +142,11 @@ var file_model_ip_item_proto_rawDesc = []byte{ 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/pb/model_region_country.pb.go b/pkg/rpc/pb/model_region_country.pb.go index 864fdf8..40ef32a 100644 --- a/pkg/rpc/pb/model_region_country.pb.go +++ b/pkg/rpc/pb/model_region_country.pb.go @@ -32,7 +32,8 @@ type RegionCountry struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Pinyin []string `protobuf:"bytes,3,rep,name=pinyin,proto3" json:"pinyin,omitempty"` + Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"` + Pinyin []string `protobuf:"bytes,4,rep,name=pinyin,proto3" json:"pinyin,omitempty"` } func (x *RegionCountry) Reset() { @@ -81,6 +82,13 @@ func (x *RegionCountry) GetName() string { return "" } +func (x *RegionCountry) GetCodes() []string { + if x != nil { + return x.Codes + } + return nil +} + func (x *RegionCountry) GetPinyin() []string { if x != nil { return x.Pinyin @@ -93,12 +101,14 @@ var File_model_region_country_proto protoreflect.FileDescriptor var file_model_region_country_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x22, 0x4b, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x22, 0x61, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x69, 0x6e, 0x79, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x69, 0x6e, + 0x79, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/pb/model_region_province.pb.go b/pkg/rpc/pb/model_region_province.pb.go index 416287b..2667cd4 100644 --- a/pkg/rpc/pb/model_region_province.pb.go +++ b/pkg/rpc/pb/model_region_province.pb.go @@ -30,8 +30,9 @@ type RegionProvince struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Codes []string `protobuf:"bytes,3,rep,name=codes,proto3" json:"codes,omitempty"` } func (x *RegionProvince) Reset() { @@ -80,16 +81,24 @@ func (x *RegionProvince) GetName() string { return "" } +func (x *RegionProvince) GetCodes() []string { + if x != nil { + return x.Codes + } + return nil +} + var File_model_region_province_proto protoreflect.FileDescriptor var file_model_region_province_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, - 0x62, 0x22, 0x34, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x62, 0x22, 0x4a, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/rpc/pb/service_ip_item.pb.go b/pkg/rpc/pb/service_ip_item.pb.go index 1f22905..ae78352 100644 --- a/pkg/rpc/pb/service_ip_item.pb.go +++ b/pkg/rpc/pb/service_ip_item.pb.go @@ -585,6 +585,109 @@ func (x *FindEnabledIPItemResponse) GetIpItem() *IPItem { return nil } +// 根据版本列出一组IP +type ListIPItemsAfterVersionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListIPItemsAfterVersionRequest) Reset() { + *x = ListIPItemsAfterVersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIPItemsAfterVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIPItemsAfterVersionRequest) ProtoMessage() {} + +func (x *ListIPItemsAfterVersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListIPItemsAfterVersionRequest.ProtoReflect.Descriptor instead. +func (*ListIPItemsAfterVersionRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{10} +} + +func (x *ListIPItemsAfterVersionRequest) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ListIPItemsAfterVersionRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListIPItemsAfterVersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItems []*IPItem `protobuf:"bytes,1,rep,name=ipItems,proto3" json:"ipItems,omitempty"` +} + +func (x *ListIPItemsAfterVersionResponse) Reset() { + *x = ListIPItemsAfterVersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIPItemsAfterVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIPItemsAfterVersionResponse) ProtoMessage() {} + +func (x *ListIPItemsAfterVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListIPItemsAfterVersionResponse.ProtoReflect.Descriptor instead. +func (*ListIPItemsAfterVersionResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{11} +} + +func (x *ListIPItemsAfterVersionResponse) GetIpItems() []*IPItem { + if x != nil { + return x.IpItems + } + return nil +} + var File_service_ip_item_proto protoreflect.FileDescriptor var file_service_ip_item_proto_rawDesc = []byte{ @@ -643,38 +746,54 @@ var file_service_ip_item_proto_rawDesc = []byte{ 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x69, 0x70, - 0x49, 0x74, 0x65, 0x6d, 0x32, 0xe1, 0x03, 0x0a, 0x0d, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5f, 0x0a, 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, - 0x64, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, - 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, - 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x74, 0x65, 0x6d, 0x22, 0x4e, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x22, 0x47, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0xc5, 0x04, + 0x0a, 0x0d, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x49, + 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x50, 0x43, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x5f, 0x0a, 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, + 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, + 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, + 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, + 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x62, 0x0a, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x41, 0x66, 0x74, + 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -689,42 +808,47 @@ func file_service_ip_item_proto_rawDescGZIP() []byte { return file_service_ip_item_proto_rawDescData } -var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_service_ip_item_proto_goTypes = []interface{}{ - (*CreateIPItemRequest)(nil), // 0: pb.CreateIPItemRequest - (*CreateIPItemResponse)(nil), // 1: pb.CreateIPItemResponse - (*UpdateIPItemRequest)(nil), // 2: pb.UpdateIPItemRequest - (*DeleteIPItemRequest)(nil), // 3: pb.DeleteIPItemRequest - (*CountIPItemsWithListIdRequest)(nil), // 4: pb.CountIPItemsWithListIdRequest - (*CountIPItemsWithListIdResponse)(nil), // 5: pb.CountIPItemsWithListIdResponse - (*ListIPItemsWithListIdRequest)(nil), // 6: pb.ListIPItemsWithListIdRequest - (*ListIPItemsWithListIdResponse)(nil), // 7: pb.ListIPItemsWithListIdResponse - (*FindEnabledIPItemRequest)(nil), // 8: pb.FindEnabledIPItemRequest - (*FindEnabledIPItemResponse)(nil), // 9: pb.FindEnabledIPItemResponse - (*IPItem)(nil), // 10: pb.IPItem - (*RPCUpdateSuccess)(nil), // 11: pb.RPCUpdateSuccess - (*RPCDeleteSuccess)(nil), // 12: pb.RPCDeleteSuccess + (*CreateIPItemRequest)(nil), // 0: pb.CreateIPItemRequest + (*CreateIPItemResponse)(nil), // 1: pb.CreateIPItemResponse + (*UpdateIPItemRequest)(nil), // 2: pb.UpdateIPItemRequest + (*DeleteIPItemRequest)(nil), // 3: pb.DeleteIPItemRequest + (*CountIPItemsWithListIdRequest)(nil), // 4: pb.CountIPItemsWithListIdRequest + (*CountIPItemsWithListIdResponse)(nil), // 5: pb.CountIPItemsWithListIdResponse + (*ListIPItemsWithListIdRequest)(nil), // 6: pb.ListIPItemsWithListIdRequest + (*ListIPItemsWithListIdResponse)(nil), // 7: pb.ListIPItemsWithListIdResponse + (*FindEnabledIPItemRequest)(nil), // 8: pb.FindEnabledIPItemRequest + (*FindEnabledIPItemResponse)(nil), // 9: pb.FindEnabledIPItemResponse + (*ListIPItemsAfterVersionRequest)(nil), // 10: pb.ListIPItemsAfterVersionRequest + (*ListIPItemsAfterVersionResponse)(nil), // 11: pb.ListIPItemsAfterVersionResponse + (*IPItem)(nil), // 12: pb.IPItem + (*RPCUpdateSuccess)(nil), // 13: pb.RPCUpdateSuccess + (*RPCDeleteSuccess)(nil), // 14: pb.RPCDeleteSuccess } var file_service_ip_item_proto_depIdxs = []int32{ - 10, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem - 10, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem - 0, // 2: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest - 2, // 3: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest - 3, // 4: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest - 4, // 5: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest - 6, // 6: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest - 8, // 7: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest - 1, // 8: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse - 11, // 9: pb.IPItemService.updateIPItem:output_type -> pb.RPCUpdateSuccess - 12, // 10: pb.IPItemService.deleteIPItem:output_type -> pb.RPCDeleteSuccess - 5, // 11: pb.IPItemService.countIPItemsWithListId:output_type -> pb.CountIPItemsWithListIdResponse - 7, // 12: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse - 9, // 13: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse - 8, // [8:14] is the sub-list for method output_type - 2, // [2:8] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 12, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem + 12, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem + 12, // 2: pb.ListIPItemsAfterVersionResponse.ipItems:type_name -> pb.IPItem + 0, // 3: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest + 2, // 4: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest + 3, // 5: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest + 4, // 6: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest + 6, // 7: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest + 8, // 8: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest + 10, // 9: pb.IPItemService.listIPItemsAfterVersion:input_type -> pb.ListIPItemsAfterVersionRequest + 1, // 10: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse + 13, // 11: pb.IPItemService.updateIPItem:output_type -> pb.RPCUpdateSuccess + 14, // 12: pb.IPItemService.deleteIPItem:output_type -> pb.RPCDeleteSuccess + 5, // 13: pb.IPItemService.countIPItemsWithListId:output_type -> pb.CountIPItemsWithListIdResponse + 7, // 14: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse + 9, // 15: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse + 11, // 16: pb.IPItemService.listIPItemsAfterVersion:output_type -> pb.ListIPItemsAfterVersionResponse + 10, // [10:17] is the sub-list for method output_type + 3, // [3:10] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_ip_item_proto_init() } @@ -855,6 +979,30 @@ func file_service_ip_item_proto_init() { return nil } } + file_service_ip_item_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIPItemsAfterVersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_item_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIPItemsAfterVersionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -862,7 +1010,7 @@ func file_service_ip_item_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_ip_item_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, @@ -900,6 +1048,8 @@ type IPItemServiceClient interface { ListIPItemsWithListId(ctx context.Context, in *ListIPItemsWithListIdRequest, opts ...grpc.CallOption) (*ListIPItemsWithListIdResponse, error) // 查找单个IP FindEnabledIPItem(ctx context.Context, in *FindEnabledIPItemRequest, opts ...grpc.CallOption) (*FindEnabledIPItemResponse, error) + // 根据版本列出一组IP + ListIPItemsAfterVersion(ctx context.Context, in *ListIPItemsAfterVersionRequest, opts ...grpc.CallOption) (*ListIPItemsAfterVersionResponse, error) } type iPItemServiceClient struct { @@ -964,6 +1114,15 @@ func (c *iPItemServiceClient) FindEnabledIPItem(ctx context.Context, in *FindEna return out, nil } +func (c *iPItemServiceClient) ListIPItemsAfterVersion(ctx context.Context, in *ListIPItemsAfterVersionRequest, opts ...grpc.CallOption) (*ListIPItemsAfterVersionResponse, error) { + out := new(ListIPItemsAfterVersionResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/listIPItemsAfterVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IPItemServiceServer is the server API for IPItemService service. type IPItemServiceServer interface { // 创建IP @@ -978,6 +1137,8 @@ type IPItemServiceServer interface { ListIPItemsWithListId(context.Context, *ListIPItemsWithListIdRequest) (*ListIPItemsWithListIdResponse, error) // 查找单个IP FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error) + // 根据版本列出一组IP + ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error) } // UnimplementedIPItemServiceServer can be embedded to have forward compatible implementations. @@ -1002,6 +1163,9 @@ func (*UnimplementedIPItemServiceServer) ListIPItemsWithListId(context.Context, func (*UnimplementedIPItemServiceServer) FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPItem not implemented") } +func (*UnimplementedIPItemServiceServer) ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListIPItemsAfterVersion not implemented") +} func RegisterIPItemServiceServer(s *grpc.Server, srv IPItemServiceServer) { s.RegisterService(&_IPItemService_serviceDesc, srv) @@ -1115,6 +1279,24 @@ func _IPItemService_FindEnabledIPItem_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _IPItemService_ListIPItemsAfterVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIPItemsAfterVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).ListIPItemsAfterVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/ListIPItemsAfterVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).ListIPItemsAfterVersion(ctx, req.(*ListIPItemsAfterVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _IPItemService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.IPItemService", HandlerType: (*IPItemServiceServer)(nil), @@ -1143,6 +1325,10 @@ var _IPItemService_serviceDesc = grpc.ServiceDesc{ MethodName: "findEnabledIPItem", Handler: _IPItemService_FindEnabledIPItem_Handler, }, + { + MethodName: "listIPItemsAfterVersion", + Handler: _IPItemService_ListIPItemsAfterVersion_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_ip_item.proto", diff --git a/pkg/rpc/protos/model_ip_item.proto b/pkg/rpc/protos/model_ip_item.proto index f4072db..6e2fc3c 100644 --- a/pkg/rpc/protos/model_ip_item.proto +++ b/pkg/rpc/protos/model_ip_item.proto @@ -10,4 +10,6 @@ message IPItem { int64 version = 4; int64 expiredAt = 5; string reason = 6; + int64 listId = 7; + bool isDeleted = 8; } \ No newline at end of file diff --git a/pkg/rpc/protos/model_region_country.proto b/pkg/rpc/protos/model_region_country.proto index e4c1cae..16d02c3 100644 --- a/pkg/rpc/protos/model_region_country.proto +++ b/pkg/rpc/protos/model_region_country.proto @@ -6,5 +6,6 @@ package pb; message RegionCountry { int64 id = 1; string name = 2; - repeated string pinyin = 3; + repeated string codes = 3; + repeated string pinyin = 4; } \ No newline at end of file diff --git a/pkg/rpc/protos/model_region_province.proto b/pkg/rpc/protos/model_region_province.proto index 044c320..0e5f099 100644 --- a/pkg/rpc/protos/model_region_province.proto +++ b/pkg/rpc/protos/model_region_province.proto @@ -6,4 +6,5 @@ package pb; message RegionProvince { int64 id = 1; string name = 2; + repeated string codes = 3; } diff --git a/pkg/rpc/protos/service_ip_item.proto b/pkg/rpc/protos/service_ip_item.proto index b599310..3e15d14 100644 --- a/pkg/rpc/protos/service_ip_item.proto +++ b/pkg/rpc/protos/service_ip_item.proto @@ -25,6 +25,9 @@ service IPItemService { // 查找单个IP rpc findEnabledIPItem (FindEnabledIPItemRequest) returns (FindEnabledIPItemResponse); + + // 根据版本列出一组IP + rpc listIPItemsAfterVersion (ListIPItemsAfterVersionRequest) returns (ListIPItemsAfterVersionResponse); } // 创建IP @@ -81,4 +84,14 @@ message FindEnabledIPItemRequest { message FindEnabledIPItemResponse { IPItem ipItem = 1; +} + +// 根据版本列出一组IP +message ListIPItemsAfterVersionRequest { + int64 version = 1; + int64 size = 2; +} + +message ListIPItemsAfterVersionResponse { + repeated IPItem ipItems = 1; } \ No newline at end of file diff --git a/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go b/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go index 796807f..fca46e0 100644 --- a/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go +++ b/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go @@ -24,6 +24,14 @@ func (this *HTTPFirewallInboundConfig) Init() error { return err } } + + if this.Region != nil { + err := this.Region.Init() + if err != nil { + return err + } + } + return nil } diff --git a/pkg/serverconfigs/firewallconfigs/http_firewall_region_config.go b/pkg/serverconfigs/firewallconfigs/http_firewall_region_config.go index 070c967..9edcfde 100644 --- a/pkg/serverconfigs/firewallconfigs/http_firewall_region_config.go +++ b/pkg/serverconfigs/firewallconfigs/http_firewall_region_config.go @@ -4,4 +4,15 @@ type HTTPFirewallRegionConfig struct { IsOn bool `yaml:"isOn" json:"isOn"` DenyCountryIds []int64 `yaml:"denyCountryIds" json:"denyCountryIds"` // 封禁的国家|地区 DenyProvinceIds []int64 `yaml:"denyProvinceIds" json:"denyProvinceIds"` // 封禁的省或自治区 + + isNotEmpty bool +} + +func (this *HTTPFirewallRegionConfig) Init() error { + this.isNotEmpty = len(this.DenyCountryIds) > 0 || len(this.DenyProvinceIds) > 0 + return nil +} + +func (this *HTTPFirewallRegionConfig) IsNotEmpty() bool { + return this.isNotEmpty }