mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	IP名单API增加IP添加时间
This commit is contained in:
		@@ -281,3 +281,11 @@ func (this *NodeLogDAO) UpdateNodeLogsRead(tx *dbs.Tx, nodeLogIds []int64) error
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UpdateAllNodeLogsRead 设置所有日志为已读
 | 
			
		||||
func (this *NodeLogDAO) UpdateAllNodeLogsRead(tx *dbs.Tx) error {
 | 
			
		||||
	return this.Query(tx).
 | 
			
		||||
		Attr("isRead", false).
 | 
			
		||||
		Set("isRead", true).
 | 
			
		||||
		UpdateQuickly()
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -190,6 +190,7 @@ func (this *IPItemService) ListIPItemsWithListId(ctx context.Context, req *pb.Li
 | 
			
		||||
			IpFrom:     item.IpFrom,
 | 
			
		||||
			IpTo:       item.IpTo,
 | 
			
		||||
			Version:    int64(item.Version),
 | 
			
		||||
			CreatedAt:  int64(item.CreatedAt),
 | 
			
		||||
			ExpiredAt:  int64(item.ExpiredAt),
 | 
			
		||||
			Reason:     item.Reason,
 | 
			
		||||
			Type:       item.Type,
 | 
			
		||||
@@ -234,6 +235,7 @@ func (this *IPItemService) FindEnabledIPItem(ctx context.Context, req *pb.FindEn
 | 
			
		||||
		IpFrom:     item.IpFrom,
 | 
			
		||||
		IpTo:       item.IpTo,
 | 
			
		||||
		Version:    int64(item.Version),
 | 
			
		||||
		CreatedAt:  int64(item.CreatedAt),
 | 
			
		||||
		ExpiredAt:  int64(item.ExpiredAt),
 | 
			
		||||
		Reason:     item.Reason,
 | 
			
		||||
		Type:       item.Type,
 | 
			
		||||
@@ -272,6 +274,7 @@ func (this *IPItemService) ListIPItemsAfterVersion(ctx context.Context, req *pb.
 | 
			
		||||
			IpFrom:     item.IpFrom,
 | 
			
		||||
			IpTo:       item.IpTo,
 | 
			
		||||
			Version:    int64(item.Version),
 | 
			
		||||
			CreatedAt:  int64(item.CreatedAt),
 | 
			
		||||
			ExpiredAt:  int64(item.ExpiredAt),
 | 
			
		||||
			Reason:     "", // 这里我们不需要这个数据
 | 
			
		||||
			ListId:     int64(item.ListId),
 | 
			
		||||
@@ -332,6 +335,7 @@ func (this *IPItemService) CheckIPItemStatus(ctx context.Context, req *pb.CheckI
 | 
			
		||||
				Id:         int64(item.Id),
 | 
			
		||||
				IpFrom:     item.IpFrom,
 | 
			
		||||
				IpTo:       item.IpTo,
 | 
			
		||||
				CreatedAt:  int64(item.CreatedAt),
 | 
			
		||||
				ExpiredAt:  int64(item.ExpiredAt),
 | 
			
		||||
				Reason:     item.Reason,
 | 
			
		||||
				Type:       item.Type,
 | 
			
		||||
 
 | 
			
		||||
@@ -136,3 +136,18 @@ func (this *NodeLogService) UpdateNodeLogsRead(ctx context.Context, req *pb.Upda
 | 
			
		||||
	}
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UpdateAllNodeLogsRead 设置所有日志未已读
 | 
			
		||||
func (this *NodeLogService) UpdateAllNodeLogsRead(ctx context.Context, req *pb.UpdateAllNodeLogsReadRequest) (*pb.RPCSuccess, error) {
 | 
			
		||||
	_, err := this.ValidateAdmin(ctx, 0)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var tx = this.NullTx()
 | 
			
		||||
	err = models.SharedNodeLogDAO.UpdateAllNodeLogsRead(tx)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	return this.Success()
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user