mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-10 04:00:24 +08:00
IP名单增加是否全局
This commit is contained in:
@@ -332,10 +332,18 @@ func (this *IPItemService) ListIPItemsAfterVersion(ctx context.Context, req *pb.
|
||||
}
|
||||
|
||||
// List类型
|
||||
listType, err := models.SharedIPListDAO.FindIPListTypeCacheable(tx, int64(item.ListId))
|
||||
list, err := models.SharedIPListDAO.FindIPListCacheable(tx, int64(item.ListId))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if list == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// 如果已经删除
|
||||
if list.State != models.IPListStateEnabled {
|
||||
item.State = models.IPItemStateDisabled
|
||||
}
|
||||
|
||||
result = append(result, &pb.IPItem{
|
||||
Id: int64(item.Id),
|
||||
@@ -349,7 +357,8 @@ func (this *IPItemService) ListIPItemsAfterVersion(ctx context.Context, req *pb.
|
||||
IsDeleted: item.State == 0,
|
||||
Type: item.Type,
|
||||
EventLevel: item.EventLevel,
|
||||
ListType: listType,
|
||||
ListType: list.Type,
|
||||
IsGlobal: list.IsPublic == 1 && list.IsGlobal == 1,
|
||||
NodeId: int64(item.NodeId),
|
||||
ServerId: int64(item.ServerId),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user