可以使用用户ID查询IP名单

This commit is contained in:
GoEdgeLab
2023-04-03 10:02:47 +08:00
parent ad56d7603c
commit 19bede05b8
3 changed files with 71 additions and 45 deletions

View File

@@ -3529,7 +3529,12 @@
"responseMessageName": "CreateIPItemsResponse",
"code": "rpc createIPItems(CreateIPItemsRequest) returns (CreateIPItemsResponse);",
"doc": "创建一组IP",
"roles": [],
"roles": [
"dns",
"user",
"node",
"admin"
],
"isDeprecated": false
},
{
@@ -13674,7 +13679,7 @@
},
{
"name": "CountAllEnabledIPItemsRequest",
"code": "message CountAllEnabledIPItemsRequest {\n\tstring keyword = 6;\n\tstring ip = 1;\n\tbool globalOnly = 2;\n\tbool unread = 3;\n\tstring eventLevel = 4;\n\tstring listType = 5;\n}",
"code": "message CountAllEnabledIPItemsRequest {\n\tstring keyword = 6; // 关键词\n\tstring ip = 1; // 单个IP搜索单个IP时需要\n\tbool globalOnly = 2; // 是否为自动添加的IP\n\tbool unread = 3; // 是否未读\n\tstring eventLevel = 4; // 事件级别\n\tstring listType = 5; // 列表类型black|white\n\tint64 userId = 7; // 用户ID只有管理员才有权限指定用户ID\n}",
"doc": "计算所有IP数量"
},
{
@@ -19274,7 +19279,7 @@
},
{
"name": "ListAllEnabledIPItemsRequest",
"code": "message ListAllEnabledIPItemsRequest {\n\tstring keyword = 8;\n\tstring ip = 1;\n\tbool globalOnly = 2;\n\tbool unread = 5;\n\tstring eventLevel = 6;\n\tstring listType = 7;\n\tint64 offset = 3;\n\tint64 size = 4;\n}",
"code": "message ListAllEnabledIPItemsRequest {\n\tstring keyword = 8; // 关键词\n\tstring ip = 1; // 单个IP搜索单个IP时需要\n\tbool globalOnly = 2; // 是否为自动添加的IP\n\tbool unread = 5; // 是否未读\n\tstring eventLevel = 6; // 事件级别\n\tstring listType = 7; // 列表类型black|white\n\tint64 userId = 9; // 用户ID只有管理员才有权限指定用户ID\n\tint64 offset = 3; // 读取位置从0开始\n\tint64 size = 4; // 每次读取数量\n}",
"doc": "列出所有名单中的IP"
},
{

View File

@@ -1197,12 +1197,13 @@ type CountAllEnabledIPItemsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Keyword string `protobuf:"bytes,6,opt,name=keyword,proto3" json:"keyword,omitempty"`
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"`
Unread bool `protobuf:"varint,3,opt,name=unread,proto3" json:"unread,omitempty"`
EventLevel string `protobuf:"bytes,4,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"`
ListType string `protobuf:"bytes,5,opt,name=listType,proto3" json:"listType,omitempty"`
Keyword string `protobuf:"bytes,6,opt,name=keyword,proto3" json:"keyword,omitempty"` // 关键词
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // 单个IP搜索单个IP时需要
GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"` // 是否为自动添加的IP
Unread bool `protobuf:"varint,3,opt,name=unread,proto3" json:"unread,omitempty"` // 是否未读
EventLevel string `protobuf:"bytes,4,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"` // 事件级别
ListType string `protobuf:"bytes,5,opt,name=listType,proto3" json:"listType,omitempty"` // 列表类型black|white
UserId int64 `protobuf:"varint,7,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID只有管理员才有权限指定用户ID
}
func (x *CountAllEnabledIPItemsRequest) Reset() {
@@ -1279,20 +1280,28 @@ func (x *CountAllEnabledIPItemsRequest) GetListType() string {
return ""
}
func (x *CountAllEnabledIPItemsRequest) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
// 列出所有名单中的IP
type ListAllEnabledIPItemsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Keyword string `protobuf:"bytes,8,opt,name=keyword,proto3" json:"keyword,omitempty"`
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"`
Unread bool `protobuf:"varint,5,opt,name=unread,proto3" json:"unread,omitempty"`
EventLevel string `protobuf:"bytes,6,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"`
ListType string `protobuf:"bytes,7,opt,name=listType,proto3" json:"listType,omitempty"`
Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
Keyword string `protobuf:"bytes,8,opt,name=keyword,proto3" json:"keyword,omitempty"` // 关键词
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // 单个IP搜索单个IP时需要
GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"` // 是否为自动添加的IP
Unread bool `protobuf:"varint,5,opt,name=unread,proto3" json:"unread,omitempty"` // 是否未读
EventLevel string `protobuf:"bytes,6,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"` // 事件级别
ListType string `protobuf:"bytes,7,opt,name=listType,proto3" json:"listType,omitempty"` // 列表类型black|white
UserId int64 `protobuf:"varint,9,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID只有管理员才有权限指定用户ID
Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // 读取位置从0开始
Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // 每次读取数量
}
func (x *ListAllEnabledIPItemsRequest) Reset() {
@@ -1369,6 +1378,13 @@ func (x *ListAllEnabledIPItemsRequest) GetListType() string {
return ""
}
func (x *ListAllEnabledIPItemsRequest) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *ListAllEnabledIPItemsRequest) GetOffset() int64 {
if x != nil {
return x.Offset
@@ -1872,7 +1888,7 @@ var file_service_ip_item_proto_rawDesc = []byte{
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, 0x22, 0xbd, 0x01, 0x0a,
0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0xd5, 0x01, 0x0a,
0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18,
0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
@@ -1884,19 +1900,22 @@ var file_service_ip_item_proto_rawDesc = []byte{
0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c,
0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0xe8, 0x01, 0x0a,
0x1c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49,
0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a,
0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61,
0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x67, 0x6c, 0x6f,
0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61,
0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12,
0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f,
0x28, 0x09, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x64, 0x22, 0x80, 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12,
0x1e, 0x0a, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x12,
0x16, 0x0a, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54,
0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54,
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f,
0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66,
0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74,

View File

@@ -200,24 +200,26 @@ message ExistsEnabledIPItemResponse {
// 计算所有IP数量
message CountAllEnabledIPItemsRequest {
string keyword = 6;
string ip = 1;
bool globalOnly = 2;
bool unread = 3;
string eventLevel = 4;
string listType = 5;
string keyword = 6; // 关键词
string ip = 1; // 单个IP搜索单个IP时需要
bool globalOnly = 2; // 是否为自动添加的IP
bool unread = 3; // 是否未读
string eventLevel = 4; // 事件级别
string listType = 5; // 列表类型black|white
int64 userId = 7; // 用户ID只有管理员才有权限指定用户ID
}
// 列出所有名单中的IP
message ListAllEnabledIPItemsRequest {
string keyword = 8;
string ip = 1;
bool globalOnly = 2;
bool unread = 5;
string eventLevel = 6;
string listType = 7;
int64 offset = 3;
int64 size = 4;
string keyword = 8; // 关键词
string ip = 1; // 单个IP搜索单个IP时需要
bool globalOnly = 2; // 是否为自动添加的IP
bool unread = 5; // 是否未读
string eventLevel = 6; // 事件级别
string listType = 7; // 列表类型black|white
int64 userId = 9; // 用户ID只有管理员才有权限指定用户ID
int64 offset = 3; // 读取位置从0开始
int64 size = 4; // 每次读取数量
}
message ListAllEnabledIPItemsResponse {