实现IP黑白名单、国家|地区封禁、省份封禁

This commit is contained in:
GoEdgeLab
2020-11-09 10:43:47 +08:00
parent 7d5eddd367
commit 7b9e8ff668
10 changed files with 340 additions and 79 deletions

View File

@@ -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 (