diff --git a/pkg/rpc/pb/model_ip_list.pb.go b/pkg/rpc/pb/model_ip_list.pb.go index 278fd63..f17d57f 100644 --- a/pkg/rpc/pb/model_ip_list.pb.go +++ b/pkg/rpc/pb/model_ip_list.pb.go @@ -36,6 +36,8 @@ type IPList struct { Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` Code string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"` TimeoutJSON []byte `protobuf:"bytes,6,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"` + IsPublic bool `protobuf:"varint,7,opt,name=isPublic,proto3" json:"isPublic,omitempty"` + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` } func (x *IPList) Reset() { @@ -112,12 +114,26 @@ func (x *IPList) GetTimeoutJSON() []byte { return nil } +func (x *IPList) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +func (x *IPList) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + var File_models_model_ip_list_proto protoreflect.FileDescriptor var file_models_model_ip_list_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x22, 0xc8, 0x01, 0x0a, 0x06, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, @@ -125,8 +141,12 @@ var file_models_model_ip_list_proto_rawDesc = []byte{ 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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 dabdb0e..c2764ce 100644 --- a/pkg/rpc/pb/service_ip_item.pb.go +++ b/pkg/rpc/pb/service_ip_item.pb.go @@ -673,6 +673,236 @@ func (x *ListIPItemsAfterVersionResponse) GetIpItems() []*IPItem { return nil } +// 检查IP状态 +type CheckIPItemStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` +} + +func (x *CheckIPItemStatusRequest) Reset() { + *x = CheckIPItemStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckIPItemStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckIPItemStatusRequest) ProtoMessage() {} + +func (x *CheckIPItemStatusRequest) 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 CheckIPItemStatusRequest.ProtoReflect.Descriptor instead. +func (*CheckIPItemStatusRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{11} +} + +func (x *CheckIPItemStatusRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +func (x *CheckIPItemStatusRequest) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type CheckIPItemStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"` // 是否查询成功 + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + IsFound bool `protobuf:"varint,3,opt,name=isFound,proto3" json:"isFound,omitempty"` // 是否找到 + IsAllowed bool `protobuf:"varint,4,opt,name=isAllowed,proto3" json:"isAllowed,omitempty"` // 是否允许 + IpItem *IPItem `protobuf:"bytes,5,opt,name=ipItem,proto3" json:"ipItem,omitempty"` // 匹配的IPItem +} + +func (x *CheckIPItemStatusResponse) Reset() { + *x = CheckIPItemStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckIPItemStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckIPItemStatusResponse) ProtoMessage() {} + +func (x *CheckIPItemStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[12] + 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 CheckIPItemStatusResponse.ProtoReflect.Descriptor instead. +func (*CheckIPItemStatusResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{12} +} + +func (x *CheckIPItemStatusResponse) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *CheckIPItemStatusResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *CheckIPItemStatusResponse) GetIsFound() bool { + if x != nil { + return x.IsFound + } + return false +} + +func (x *CheckIPItemStatusResponse) GetIsAllowed() bool { + if x != nil { + return x.IsAllowed + } + return false +} + +func (x *CheckIPItemStatusResponse) GetIpItem() *IPItem { + if x != nil { + return x.IpItem + } + return nil +} + +// 检查IP是否存在 +type ExistsEnabledIPItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"` +} + +func (x *ExistsEnabledIPItemRequest) Reset() { + *x = ExistsEnabledIPItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExistsEnabledIPItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExistsEnabledIPItemRequest) ProtoMessage() {} + +func (x *ExistsEnabledIPItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[13] + 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 ExistsEnabledIPItemRequest.ProtoReflect.Descriptor instead. +func (*ExistsEnabledIPItemRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{13} +} + +func (x *ExistsEnabledIPItemRequest) GetIpItemId() int64 { + if x != nil { + return x.IpItemId + } + return 0 +} + +type ExistsEnabledIPItemResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (x *ExistsEnabledIPItemResponse) Reset() { + *x = ExistsEnabledIPItemResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExistsEnabledIPItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExistsEnabledIPItemResponse) ProtoMessage() {} + +func (x *ExistsEnabledIPItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[14] + 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 ExistsEnabledIPItemResponse.ProtoReflect.Descriptor instead. +func (*ExistsEnabledIPItemResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{14} +} + +func (x *ExistsEnabledIPItemResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + var File_service_ip_item_proto protoreflect.FileDescriptor var file_service_ip_item_proto_rawDesc = []byte{ @@ -744,43 +974,75 @@ var file_service_ip_item_proto_rawDesc = []byte{ 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, 0xab, 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, 0x37, 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, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x37, 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, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x12, 0x51, 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, - 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 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, + 0x65, 0x6d, 0x52, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x46, 0x0a, 0x18, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x70, 0x22, 0xa1, 0x01, 0x0a, 0x19, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, + 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x69, + 0x73, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, + 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x38, 0x0a, 0x1a, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, + 0x64, 0x22, 0x35, 0x0a, 0x1b, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0xd5, 0x05, 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, 0x37, 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, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x37, 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, + 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, + 0x51, 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, 0x14, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 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, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, + 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x65, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 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, } var ( @@ -795,7 +1057,7 @@ 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, 11) +var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_service_ip_item_proto_goTypes = []interface{}{ (*CreateIPItemRequest)(nil), // 0: pb.CreateIPItemRequest (*CreateIPItemResponse)(nil), // 1: pb.CreateIPItemResponse @@ -808,33 +1070,42 @@ var file_service_ip_item_proto_goTypes = []interface{}{ (*FindEnabledIPItemResponse)(nil), // 8: pb.FindEnabledIPItemResponse (*ListIPItemsAfterVersionRequest)(nil), // 9: pb.ListIPItemsAfterVersionRequest (*ListIPItemsAfterVersionResponse)(nil), // 10: pb.ListIPItemsAfterVersionResponse - (*IPItem)(nil), // 11: pb.IPItem - (*RPCSuccess)(nil), // 12: pb.RPCSuccess - (*RPCCountResponse)(nil), // 13: pb.RPCCountResponse + (*CheckIPItemStatusRequest)(nil), // 11: pb.CheckIPItemStatusRequest + (*CheckIPItemStatusResponse)(nil), // 12: pb.CheckIPItemStatusResponse + (*ExistsEnabledIPItemRequest)(nil), // 13: pb.ExistsEnabledIPItemRequest + (*ExistsEnabledIPItemResponse)(nil), // 14: pb.ExistsEnabledIPItemResponse + (*IPItem)(nil), // 15: pb.IPItem + (*RPCSuccess)(nil), // 16: pb.RPCSuccess + (*RPCCountResponse)(nil), // 17: pb.RPCCountResponse } var file_service_ip_item_proto_depIdxs = []int32{ - 11, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem - 11, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem - 11, // 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 - 5, // 7: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest - 7, // 8: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest - 9, // 9: pb.IPItemService.listIPItemsAfterVersion:input_type -> pb.ListIPItemsAfterVersionRequest - 1, // 10: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse - 12, // 11: pb.IPItemService.updateIPItem:output_type -> pb.RPCSuccess - 12, // 12: pb.IPItemService.deleteIPItem:output_type -> pb.RPCSuccess - 13, // 13: pb.IPItemService.countIPItemsWithListId:output_type -> pb.RPCCountResponse - 6, // 14: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse - 8, // 15: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse - 10, // 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 + 15, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem + 15, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem + 15, // 2: pb.ListIPItemsAfterVersionResponse.ipItems:type_name -> pb.IPItem + 15, // 3: pb.CheckIPItemStatusResponse.ipItem:type_name -> pb.IPItem + 0, // 4: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest + 2, // 5: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest + 3, // 6: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest + 4, // 7: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest + 5, // 8: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest + 7, // 9: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest + 9, // 10: pb.IPItemService.listIPItemsAfterVersion:input_type -> pb.ListIPItemsAfterVersionRequest + 11, // 11: pb.IPItemService.checkIPItemStatus:input_type -> pb.CheckIPItemStatusRequest + 13, // 12: pb.IPItemService.existsEnabledIPItem:input_type -> pb.ExistsEnabledIPItemRequest + 1, // 13: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse + 16, // 14: pb.IPItemService.updateIPItem:output_type -> pb.RPCSuccess + 16, // 15: pb.IPItemService.deleteIPItem:output_type -> pb.RPCSuccess + 17, // 16: pb.IPItemService.countIPItemsWithListId:output_type -> pb.RPCCountResponse + 6, // 17: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse + 8, // 18: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse + 10, // 19: pb.IPItemService.listIPItemsAfterVersion:output_type -> pb.ListIPItemsAfterVersionResponse + 12, // 20: pb.IPItemService.checkIPItemStatus:output_type -> pb.CheckIPItemStatusResponse + 14, // 21: pb.IPItemService.existsEnabledIPItem:output_type -> pb.ExistsEnabledIPItemResponse + 13, // [13:22] is the sub-list for method output_type + 4, // [4:13] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_service_ip_item_proto_init() } @@ -977,6 +1248,54 @@ func file_service_ip_item_proto_init() { return nil } } + file_service_ip_item_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckIPItemStatusRequest); 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[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckIPItemStatusResponse); 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[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExistsEnabledIPItemRequest); 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[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExistsEnabledIPItemResponse); 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{ @@ -984,7 +1303,7 @@ func file_service_ip_item_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_ip_item_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, @@ -1024,6 +1343,10 @@ type IPItemServiceClient interface { FindEnabledIPItem(ctx context.Context, in *FindEnabledIPItemRequest, opts ...grpc.CallOption) (*FindEnabledIPItemResponse, error) // 根据版本列出一组IP ListIPItemsAfterVersion(ctx context.Context, in *ListIPItemsAfterVersionRequest, opts ...grpc.CallOption) (*ListIPItemsAfterVersionResponse, error) + // 检查IP状态 + CheckIPItemStatus(ctx context.Context, in *CheckIPItemStatusRequest, opts ...grpc.CallOption) (*CheckIPItemStatusResponse, error) + // 检查IP是否存在 + ExistsEnabledIPItem(ctx context.Context, in *ExistsEnabledIPItemRequest, opts ...grpc.CallOption) (*ExistsEnabledIPItemResponse, error) } type iPItemServiceClient struct { @@ -1097,6 +1420,24 @@ func (c *iPItemServiceClient) ListIPItemsAfterVersion(ctx context.Context, in *L return out, nil } +func (c *iPItemServiceClient) CheckIPItemStatus(ctx context.Context, in *CheckIPItemStatusRequest, opts ...grpc.CallOption) (*CheckIPItemStatusResponse, error) { + out := new(CheckIPItemStatusResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/checkIPItemStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) ExistsEnabledIPItem(ctx context.Context, in *ExistsEnabledIPItemRequest, opts ...grpc.CallOption) (*ExistsEnabledIPItemResponse, error) { + out := new(ExistsEnabledIPItemResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/existsEnabledIPItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IPItemServiceServer is the server API for IPItemService service. type IPItemServiceServer interface { // 创建IP @@ -1113,6 +1454,10 @@ type IPItemServiceServer interface { FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error) // 根据版本列出一组IP ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error) + // 检查IP状态 + CheckIPItemStatus(context.Context, *CheckIPItemStatusRequest) (*CheckIPItemStatusResponse, error) + // 检查IP是否存在 + ExistsEnabledIPItem(context.Context, *ExistsEnabledIPItemRequest) (*ExistsEnabledIPItemResponse, error) } // UnimplementedIPItemServiceServer can be embedded to have forward compatible implementations. @@ -1140,6 +1485,12 @@ func (*UnimplementedIPItemServiceServer) FindEnabledIPItem(context.Context, *Fin func (*UnimplementedIPItemServiceServer) ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListIPItemsAfterVersion not implemented") } +func (*UnimplementedIPItemServiceServer) CheckIPItemStatus(context.Context, *CheckIPItemStatusRequest) (*CheckIPItemStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckIPItemStatus not implemented") +} +func (*UnimplementedIPItemServiceServer) ExistsEnabledIPItem(context.Context, *ExistsEnabledIPItemRequest) (*ExistsEnabledIPItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExistsEnabledIPItem not implemented") +} func RegisterIPItemServiceServer(s *grpc.Server, srv IPItemServiceServer) { s.RegisterService(&_IPItemService_serviceDesc, srv) @@ -1271,6 +1622,42 @@ func _IPItemService_ListIPItemsAfterVersion_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } +func _IPItemService_CheckIPItemStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckIPItemStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).CheckIPItemStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/CheckIPItemStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).CheckIPItemStatus(ctx, req.(*CheckIPItemStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_ExistsEnabledIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExistsEnabledIPItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).ExistsEnabledIPItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/ExistsEnabledIPItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).ExistsEnabledIPItem(ctx, req.(*ExistsEnabledIPItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _IPItemService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.IPItemService", HandlerType: (*IPItemServiceServer)(nil), @@ -1303,6 +1690,14 @@ var _IPItemService_serviceDesc = grpc.ServiceDesc{ MethodName: "listIPItemsAfterVersion", Handler: _IPItemService_ListIPItemsAfterVersion_Handler, }, + { + MethodName: "checkIPItemStatus", + Handler: _IPItemService_CheckIPItemStatus_Handler, + }, + { + MethodName: "existsEnabledIPItem", + Handler: _IPItemService_ExistsEnabledIPItem_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_ip_item.proto", diff --git a/pkg/rpc/pb/service_ip_list.pb.go b/pkg/rpc/pb/service_ip_list.pb.go index 73deee5..12bc7b1 100644 --- a/pkg/rpc/pb/service_ip_list.pb.go +++ b/pkg/rpc/pb/service_ip_list.pb.go @@ -39,6 +39,8 @@ type CreateIPListRequest struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` TimeoutJSON []byte `protobuf:"bytes,4,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"` + IsPublic bool `protobuf:"varint,5,opt,name=isPublic,proto3" json:"isPublic,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` } func (x *CreateIPListRequest) Reset() { @@ -101,6 +103,20 @@ func (x *CreateIPListRequest) GetTimeoutJSON() []byte { return nil } +func (x *CreateIPListRequest) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +func (x *CreateIPListRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + type CreateIPListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -158,6 +174,7 @@ type UpdateIPListRequest struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` TimeoutJSON []byte `protobuf:"bytes,4,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` } func (x *UpdateIPListRequest) Reset() { @@ -220,7 +237,14 @@ func (x *UpdateIPListRequest) GetTimeoutJSON() []byte { return nil } -// 查找IP列表 +func (x *UpdateIPListRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// 查找IP列表信息 type FindEnabledIPListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -315,6 +339,340 @@ func (x *FindEnabledIPListResponse) GetIpList() *IPList { return nil } +// 计算名单数量 +type CountAllEnabledIPListsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + IsPublic bool `protobuf:"varint,2,opt,name=isPublic,proto3" json:"isPublic,omitempty"` + Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` +} + +func (x *CountAllEnabledIPListsRequest) Reset() { + *x = CountAllEnabledIPListsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledIPListsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledIPListsRequest) ProtoMessage() {} + +func (x *CountAllEnabledIPListsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[5] + 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 CountAllEnabledIPListsRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledIPListsRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{5} +} + +func (x *CountAllEnabledIPListsRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CountAllEnabledIPListsRequest) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +func (x *CountAllEnabledIPListsRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +// 列出单页名单 +type ListEnabledIPListsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + IsPublic bool `protobuf:"varint,2,opt,name=isPublic,proto3" json:"isPublic,omitempty"` + Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` + Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledIPListsRequest) Reset() { + *x = ListEnabledIPListsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledIPListsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledIPListsRequest) ProtoMessage() {} + +func (x *ListEnabledIPListsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[6] + 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 ListEnabledIPListsRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledIPListsRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{6} +} + +func (x *ListEnabledIPListsRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ListEnabledIPListsRequest) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +func (x *ListEnabledIPListsRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *ListEnabledIPListsRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledIPListsRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledIPListsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpLists []*IPList `protobuf:"bytes,1,rep,name=ipLists,proto3" json:"ipLists,omitempty"` +} + +func (x *ListEnabledIPListsResponse) Reset() { + *x = ListEnabledIPListsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledIPListsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledIPListsResponse) ProtoMessage() {} + +func (x *ListEnabledIPListsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[7] + 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 ListEnabledIPListsResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledIPListsResponse) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnabledIPListsResponse) GetIpLists() []*IPList { + if x != nil { + return x.IpLists + } + return nil +} + +// 删除IP名单 +type DeleteIPListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` +} + +func (x *DeleteIPListRequest) Reset() { + *x = DeleteIPListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIPListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIPListRequest) ProtoMessage() {} + +func (x *DeleteIPListRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[8] + 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 DeleteIPListRequest.ProtoReflect.Descriptor instead. +func (*DeleteIPListRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteIPListRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +// 检查IPList是否存在 +type ExistsEnabledIPListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` +} + +func (x *ExistsEnabledIPListRequest) Reset() { + *x = ExistsEnabledIPListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExistsEnabledIPListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExistsEnabledIPListRequest) ProtoMessage() {} + +func (x *ExistsEnabledIPListRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[9] + 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 ExistsEnabledIPListRequest.ProtoReflect.Descriptor instead. +func (*ExistsEnabledIPListRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{9} +} + +func (x *ExistsEnabledIPListRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +type ExistsEnabledIPListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (x *ExistsEnabledIPListResponse) Reset() { + *x = ExistsEnabledIPListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExistsEnabledIPListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExistsEnabledIPListResponse) ProtoMessage() {} + +func (x *ExistsEnabledIPListResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_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 ExistsEnabledIPListResponse.ProtoReflect.Descriptor instead. +func (*ExistsEnabledIPListResponse) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{10} +} + +func (x *ExistsEnabledIPListResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + var File_service_ip_list_proto protoreflect.FileDescriptor var file_service_ip_list_proto_rawDesc = []byte{ @@ -323,17 +681,21 @@ var file_service_ip_list_proto_rawDesc = []byte{ 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x73, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x22, 0x7b, 0x0a, 0x13, 0x55, + 0x74, 0x6f, 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x12, @@ -341,30 +703,82 @@ var file_service_ip_list_proto_rawDesc = []byte{ 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, - 0x22, 0x3f, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, - 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, - 0x06, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x06, 0x69, 0x70, 0x4c, 0x69, 0x73, - 0x74, 0x32, 0xdd, 0x01, 0x0a, 0x0d, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x22, 0x0a, 0x06, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x06, 0x69, 0x70, 0x4c, + 0x69, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x91, + 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, + 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, + 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x22, 0x42, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x24, 0x0a, 0x07, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x69, + 0x70, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x1a, 0x45, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x1b, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0x96, 0x04, 0x0a, 0x0d, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, - 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, + 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 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, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, + 0x69, 0x73, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, + 0x12, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, + 0x73, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, 0x13, 0x65, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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 ( @@ -379,29 +793,45 @@ func file_service_ip_list_proto_rawDescGZIP() []byte { return file_service_ip_list_proto_rawDescData } -var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_service_ip_list_proto_goTypes = []interface{}{ - (*CreateIPListRequest)(nil), // 0: pb.CreateIPListRequest - (*CreateIPListResponse)(nil), // 1: pb.CreateIPListResponse - (*UpdateIPListRequest)(nil), // 2: pb.UpdateIPListRequest - (*FindEnabledIPListRequest)(nil), // 3: pb.FindEnabledIPListRequest - (*FindEnabledIPListResponse)(nil), // 4: pb.FindEnabledIPListResponse - (*IPList)(nil), // 5: pb.IPList - (*RPCSuccess)(nil), // 6: pb.RPCSuccess + (*CreateIPListRequest)(nil), // 0: pb.CreateIPListRequest + (*CreateIPListResponse)(nil), // 1: pb.CreateIPListResponse + (*UpdateIPListRequest)(nil), // 2: pb.UpdateIPListRequest + (*FindEnabledIPListRequest)(nil), // 3: pb.FindEnabledIPListRequest + (*FindEnabledIPListResponse)(nil), // 4: pb.FindEnabledIPListResponse + (*CountAllEnabledIPListsRequest)(nil), // 5: pb.CountAllEnabledIPListsRequest + (*ListEnabledIPListsRequest)(nil), // 6: pb.ListEnabledIPListsRequest + (*ListEnabledIPListsResponse)(nil), // 7: pb.ListEnabledIPListsResponse + (*DeleteIPListRequest)(nil), // 8: pb.DeleteIPListRequest + (*ExistsEnabledIPListRequest)(nil), // 9: pb.ExistsEnabledIPListRequest + (*ExistsEnabledIPListResponse)(nil), // 10: pb.ExistsEnabledIPListResponse + (*IPList)(nil), // 11: pb.IPList + (*RPCSuccess)(nil), // 12: pb.RPCSuccess + (*RPCCountResponse)(nil), // 13: pb.RPCCountResponse } var file_service_ip_list_proto_depIdxs = []int32{ - 5, // 0: pb.FindEnabledIPListResponse.ipList:type_name -> pb.IPList - 0, // 1: pb.IPListService.createIPList:input_type -> pb.CreateIPListRequest - 2, // 2: pb.IPListService.updateIPList:input_type -> pb.UpdateIPListRequest - 3, // 3: pb.IPListService.findEnabledIPList:input_type -> pb.FindEnabledIPListRequest - 1, // 4: pb.IPListService.createIPList:output_type -> pb.CreateIPListResponse - 6, // 5: pb.IPListService.updateIPList:output_type -> pb.RPCSuccess - 4, // 6: pb.IPListService.findEnabledIPList:output_type -> pb.FindEnabledIPListResponse - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 11, // 0: pb.FindEnabledIPListResponse.ipList:type_name -> pb.IPList + 11, // 1: pb.ListEnabledIPListsResponse.ipLists:type_name -> pb.IPList + 0, // 2: pb.IPListService.createIPList:input_type -> pb.CreateIPListRequest + 2, // 3: pb.IPListService.updateIPList:input_type -> pb.UpdateIPListRequest + 3, // 4: pb.IPListService.findEnabledIPList:input_type -> pb.FindEnabledIPListRequest + 5, // 5: pb.IPListService.countAllEnabledIPLists:input_type -> pb.CountAllEnabledIPListsRequest + 6, // 6: pb.IPListService.listEnabledIPLists:input_type -> pb.ListEnabledIPListsRequest + 8, // 7: pb.IPListService.deleteIPList:input_type -> pb.DeleteIPListRequest + 9, // 8: pb.IPListService.existsEnabledIPList:input_type -> pb.ExistsEnabledIPListRequest + 1, // 9: pb.IPListService.createIPList:output_type -> pb.CreateIPListResponse + 12, // 10: pb.IPListService.updateIPList:output_type -> pb.RPCSuccess + 4, // 11: pb.IPListService.findEnabledIPList:output_type -> pb.FindEnabledIPListResponse + 13, // 12: pb.IPListService.countAllEnabledIPLists:output_type -> pb.RPCCountResponse + 7, // 13: pb.IPListService.listEnabledIPLists:output_type -> pb.ListEnabledIPListsResponse + 12, // 14: pb.IPListService.deleteIPList:output_type -> pb.RPCSuccess + 10, // 15: pb.IPListService.existsEnabledIPList:output_type -> pb.ExistsEnabledIPListResponse + 9, // [9:16] is the sub-list for method output_type + 2, // [2:9] 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 } func init() { file_service_ip_list_proto_init() } @@ -472,6 +902,78 @@ func file_service_ip_list_proto_init() { return nil } } + file_service_ip_list_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledIPListsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledIPListsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledIPListsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIPListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExistsEnabledIPListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExistsEnabledIPListResponse); 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{ @@ -479,7 +981,7 @@ func file_service_ip_list_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_ip_list_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, @@ -509,8 +1011,16 @@ type IPListServiceClient interface { CreateIPList(ctx context.Context, in *CreateIPListRequest, opts ...grpc.CallOption) (*CreateIPListResponse, error) // 修改IP列表 UpdateIPList(ctx context.Context, in *UpdateIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error) - // 查找IP列表 + // 查找IP列表信息 FindEnabledIPList(ctx context.Context, in *FindEnabledIPListRequest, opts ...grpc.CallOption) (*FindEnabledIPListResponse, error) + // 计算名单数量 + CountAllEnabledIPLists(ctx context.Context, in *CountAllEnabledIPListsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页名单 + ListEnabledIPLists(ctx context.Context, in *ListEnabledIPListsRequest, opts ...grpc.CallOption) (*ListEnabledIPListsResponse, error) + // 删除IP名单 + DeleteIPList(ctx context.Context, in *DeleteIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 检查IPList是否存在 + ExistsEnabledIPList(ctx context.Context, in *ExistsEnabledIPListRequest, opts ...grpc.CallOption) (*ExistsEnabledIPListResponse, error) } type iPListServiceClient struct { @@ -548,14 +1058,58 @@ func (c *iPListServiceClient) FindEnabledIPList(ctx context.Context, in *FindEna return out, nil } +func (c *iPListServiceClient) CountAllEnabledIPLists(ctx context.Context, in *CountAllEnabledIPListsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/countAllEnabledIPLists", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPListServiceClient) ListEnabledIPLists(ctx context.Context, in *ListEnabledIPListsRequest, opts ...grpc.CallOption) (*ListEnabledIPListsResponse, error) { + out := new(ListEnabledIPListsResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/listEnabledIPLists", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPListServiceClient) DeleteIPList(ctx context.Context, in *DeleteIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.IPListService/deleteIPList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPListServiceClient) ExistsEnabledIPList(ctx context.Context, in *ExistsEnabledIPListRequest, opts ...grpc.CallOption) (*ExistsEnabledIPListResponse, error) { + out := new(ExistsEnabledIPListResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/existsEnabledIPList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IPListServiceServer is the server API for IPListService service. type IPListServiceServer interface { // 创建IP列表 CreateIPList(context.Context, *CreateIPListRequest) (*CreateIPListResponse, error) // 修改IP列表 UpdateIPList(context.Context, *UpdateIPListRequest) (*RPCSuccess, error) - // 查找IP列表 + // 查找IP列表信息 FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error) + // 计算名单数量 + CountAllEnabledIPLists(context.Context, *CountAllEnabledIPListsRequest) (*RPCCountResponse, error) + // 列出单页名单 + ListEnabledIPLists(context.Context, *ListEnabledIPListsRequest) (*ListEnabledIPListsResponse, error) + // 删除IP名单 + DeleteIPList(context.Context, *DeleteIPListRequest) (*RPCSuccess, error) + // 检查IPList是否存在 + ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error) } // UnimplementedIPListServiceServer can be embedded to have forward compatible implementations. @@ -571,6 +1125,18 @@ func (*UnimplementedIPListServiceServer) UpdateIPList(context.Context, *UpdateIP func (*UnimplementedIPListServiceServer) FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPList not implemented") } +func (*UnimplementedIPListServiceServer) CountAllEnabledIPLists(context.Context, *CountAllEnabledIPListsRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledIPLists not implemented") +} +func (*UnimplementedIPListServiceServer) ListEnabledIPLists(context.Context, *ListEnabledIPListsRequest) (*ListEnabledIPListsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledIPLists not implemented") +} +func (*UnimplementedIPListServiceServer) DeleteIPList(context.Context, *DeleteIPListRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIPList not implemented") +} +func (*UnimplementedIPListServiceServer) ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExistsEnabledIPList not implemented") +} func RegisterIPListServiceServer(s *grpc.Server, srv IPListServiceServer) { s.RegisterService(&_IPListService_serviceDesc, srv) @@ -630,6 +1196,78 @@ func _IPListService_FindEnabledIPList_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _IPListService_CountAllEnabledIPLists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledIPListsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).CountAllEnabledIPLists(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/CountAllEnabledIPLists", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).CountAllEnabledIPLists(ctx, req.(*CountAllEnabledIPListsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPListService_ListEnabledIPLists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledIPListsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).ListEnabledIPLists(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/ListEnabledIPLists", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).ListEnabledIPLists(ctx, req.(*ListEnabledIPListsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPListService_DeleteIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIPListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).DeleteIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/DeleteIPList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).DeleteIPList(ctx, req.(*DeleteIPListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPListService_ExistsEnabledIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExistsEnabledIPListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).ExistsEnabledIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/ExistsEnabledIPList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).ExistsEnabledIPList(ctx, req.(*ExistsEnabledIPListRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _IPListService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.IPListService", HandlerType: (*IPListServiceServer)(nil), @@ -646,6 +1284,22 @@ var _IPListService_serviceDesc = grpc.ServiceDesc{ MethodName: "findEnabledIPList", Handler: _IPListService_FindEnabledIPList_Handler, }, + { + MethodName: "countAllEnabledIPLists", + Handler: _IPListService_CountAllEnabledIPLists_Handler, + }, + { + MethodName: "listEnabledIPLists", + Handler: _IPListService_ListEnabledIPLists_Handler, + }, + { + MethodName: "deleteIPList", + Handler: _IPListService_DeleteIPList_Handler, + }, + { + MethodName: "existsEnabledIPList", + Handler: _IPListService_ExistsEnabledIPList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_ip_list.proto", diff --git a/pkg/rpc/protos/models/model_ip_list.proto b/pkg/rpc/protos/models/model_ip_list.proto index 4af1011..3ec631f 100644 --- a/pkg/rpc/protos/models/model_ip_list.proto +++ b/pkg/rpc/protos/models/model_ip_list.proto @@ -10,4 +10,6 @@ message IPList { string name = 4; string code = 5; bytes timeoutJSON = 6; + bool isPublic = 7; + string description = 8; } \ No newline at end of file diff --git a/pkg/rpc/protos/service_ip_item.proto b/pkg/rpc/protos/service_ip_item.proto index f61abfc..064fed4 100644 --- a/pkg/rpc/protos/service_ip_item.proto +++ b/pkg/rpc/protos/service_ip_item.proto @@ -28,6 +28,12 @@ service IPItemService { // 根据版本列出一组IP rpc listIPItemsAfterVersion (ListIPItemsAfterVersionRequest) returns (ListIPItemsAfterVersionResponse); + + // 检查IP状态 + rpc checkIPItemStatus (CheckIPItemStatusRequest) returns (CheckIPItemStatusResponse); + + // 检查IP是否存在 + rpc existsEnabledIPItem (ExistsEnabledIPItemRequest) returns (ExistsEnabledIPItemResponse); } // 创建IP @@ -94,4 +100,27 @@ message ListIPItemsAfterVersionRequest { message ListIPItemsAfterVersionResponse { repeated IPItem ipItems = 1; +} + +// 检查IP状态 +message CheckIPItemStatusRequest { + int64 ipListId = 1; + string ip = 2; +} + +message CheckIPItemStatusResponse { + bool isOk = 1; // 是否查询成功 + string error = 2; + bool isFound = 3; // 是否找到 + bool isAllowed = 4; // 是否允许 + IPItem ipItem = 5; // 匹配的IPItem +} + +// 检查IP是否存在 +message ExistsEnabledIPItemRequest { + int64 ipItemId = 1; +} + +message ExistsEnabledIPItemResponse { + bool exists = 1; } \ No newline at end of file diff --git a/pkg/rpc/protos/service_ip_list.proto b/pkg/rpc/protos/service_ip_list.proto index 694f98b..3706760 100644 --- a/pkg/rpc/protos/service_ip_list.proto +++ b/pkg/rpc/protos/service_ip_list.proto @@ -14,8 +14,20 @@ service IPListService { // 修改IP列表 rpc updateIPList (UpdateIPListRequest) returns (RPCSuccess); - // 查找IP列表 + // 查找IP列表信息 rpc findEnabledIPList (FindEnabledIPListRequest) returns (FindEnabledIPListResponse); + + // 计算名单数量 + rpc countAllEnabledIPLists (CountAllEnabledIPListsRequest) returns (RPCCountResponse); + + // 列出单页名单 + rpc listEnabledIPLists (ListEnabledIPListsRequest) returns (ListEnabledIPListsResponse); + + // 删除IP名单 + rpc deleteIPList (DeleteIPListRequest) returns (RPCSuccess); + + // 检查IPList是否存在 + rpc existsEnabledIPList (ExistsEnabledIPListRequest) returns (ExistsEnabledIPListResponse); } // 创建IP列表 @@ -24,6 +36,8 @@ message CreateIPListRequest { string name = 2; string code = 3; bytes timeoutJSON = 4; + bool isPublic = 5; + string description = 6; } message CreateIPListResponse { @@ -36,13 +50,48 @@ message UpdateIPListRequest { string name = 2; string code = 3; bytes timeoutJSON = 4; + string description = 5; } -// 查找IP列表 +// 查找IP列表信息 message FindEnabledIPListRequest { int64 ipListId = 1; } message FindEnabledIPListResponse { IPList ipList = 1; +} + +// 计算名单数量 +message CountAllEnabledIPListsRequest { + string type = 1; + bool isPublic = 2; + string keyword = 3; +} + +// 列出单页名单 +message ListEnabledIPListsRequest { + string type = 1; + bool isPublic = 2; + string keyword = 3; + int64 offset = 4; + int64 size = 5; +} + +message ListEnabledIPListsResponse { + repeated IPList ipLists = 1; +} + +// 删除IP名单 +message DeleteIPListRequest { + int64 ipListId = 1; +} + +// 检查IPList是否存在 +message ExistsEnabledIPListRequest { + int64 ipListId = 1; +} + +message ExistsEnabledIPListResponse { + bool exists = 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 b520793..6611b75 100644 --- a/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go +++ b/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go @@ -2,6 +2,7 @@ package firewallconfigs import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ipconfigs" +// HTTPFirewallInboundConfig HTTP防火墙入口配置 type HTTPFirewallInboundConfig struct { IsOn bool `yaml:"isOn" json:"isOn"` GroupRefs []*HTTPFirewallRuleGroupRef `yaml:"groupRefs" json:"groupRefs"` @@ -14,9 +15,16 @@ type HTTPFirewallInboundConfig struct { AllowListRef *ipconfigs.IPListRef `yaml:"whiteListRef" json:"whiteListRef"` DenyListRef *ipconfigs.IPListRef `yaml:"blackListRef" json:"blackListRef"` GreyListRef *ipconfigs.IPListRef `yaml:"greyListRef" json:"greyListRef"` + + // 绑定的IP名单 + PublicAllowListRefs []*ipconfigs.IPListRef `yaml:"publicWhiteListRefs" json:"publicWhiteListRefs"` + PublicDenyListRefs []*ipconfigs.IPListRef `yaml:"publicBlackListRefs" json:"publicBlackListRefs"` + + allAllowListRefs []*ipconfigs.IPListRef + allDenyListRefs []*ipconfigs.IPListRef } -// 初始化 +// Init 初始化 func (this *HTTPFirewallInboundConfig) Init() error { for _, group := range this.Groups { err := group.Init() @@ -32,10 +40,26 @@ func (this *HTTPFirewallInboundConfig) Init() error { } } + this.allAllowListRefs = []*ipconfigs.IPListRef{} + if this.AllowListRef != nil { + this.allAllowListRefs = append(this.allAllowListRefs, this.AllowListRef) + } + if len(this.PublicAllowListRefs) > 0 { + this.allAllowListRefs = append(this.allAllowListRefs, this.PublicAllowListRefs...) + } + + this.allDenyListRefs = []*ipconfigs.IPListRef{} + if this.DenyListRef != nil { + this.allDenyListRefs = append(this.allDenyListRefs, this.DenyListRef) + } + if len(this.PublicAllowListRefs) > 0 { + this.allDenyListRefs = append(this.allDenyListRefs, this.PublicDenyListRefs...) + } + return nil } -// 根据Code查找Group +// FindGroupWithCode 根据Code查找Group func (this *HTTPFirewallInboundConfig) FindGroupWithCode(code string) *HTTPFirewallRuleGroup { for _, group := range this.Groups { if group.Code == code { @@ -45,7 +69,7 @@ func (this *HTTPFirewallInboundConfig) FindGroupWithCode(code string) *HTTPFirew return nil } -// 删除某个分组 +// RemoveRuleGroup 删除某个分组 func (this *HTTPFirewallInboundConfig) RemoveRuleGroup(groupId int64) { groups := []*HTTPFirewallRuleGroup{} refs := []*HTTPFirewallRuleGroupRef{} @@ -64,3 +88,68 @@ func (this *HTTPFirewallInboundConfig) RemoveRuleGroup(groupId int64) { this.Groups = groups this.GroupRefs = refs } + +// AddPublicList 绑定公用的IP名单 +func (this *HTTPFirewallInboundConfig) AddPublicList(listId int64, listType string) { + var refs []*ipconfigs.IPListRef + switch listType { + case ipconfigs.IPListTypeBlack: + refs = this.PublicDenyListRefs + case ipconfigs.IPListTypeWhite: + refs = this.PublicAllowListRefs + } + var found = false + for _, ref := range refs { + if ref.ListId == listId { + found = true + ref.IsOn = true + break + } + } + if !found { + refs = append(refs, &ipconfigs.IPListRef{ + IsOn: true, + ListId: listId, + }) + } + switch listType { + case ipconfigs.IPListTypeBlack: + this.PublicDenyListRefs = refs + case ipconfigs.IPListTypeWhite: + this.PublicAllowListRefs = refs + } +} + +// RemovePublicList 解绑公用的IP名单 +func (this *HTTPFirewallInboundConfig) RemovePublicList(listId int64, listType string) { + var refs []*ipconfigs.IPListRef + switch listType { + case ipconfigs.IPListTypeBlack: + refs = this.PublicDenyListRefs + case ipconfigs.IPListTypeWhite: + refs = this.PublicAllowListRefs + } + var newRefs = []*ipconfigs.IPListRef{} + for _, ref := range refs { + if ref.ListId == listId { + continue + } + newRefs = append(newRefs, ref) + } + switch listType { + case ipconfigs.IPListTypeBlack: + this.PublicDenyListRefs = newRefs + case ipconfigs.IPListTypeWhite: + this.PublicAllowListRefs = newRefs + } +} + +// AllAllowListRefs 获取所有允许的IP名单 +func (this *HTTPFirewallInboundConfig) AllAllowListRefs() []*ipconfigs.IPListRef { + return this.allAllowListRefs +} + +// AllDenyListRefs 获取所有禁止的IP名单 +func (this *HTTPFirewallInboundConfig) AllDenyListRefs() []*ipconfigs.IPListRef { + return this.allDenyListRefs +}