数据有更改时发送通知

This commit is contained in:
GoEdgeLab
2021-08-08 15:47:48 +08:00
parent 07aa0990f8
commit e979414973
40 changed files with 548 additions and 185 deletions

View File

@@ -3,7 +3,6 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/nameservers"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
@@ -63,7 +62,7 @@ func (this *MessageService) ListUnreadMessages(ctx context.Context, req *pb.List
}
}
case nodeconfigs.NodeRoleDNS:
cluster, err := nameservers.SharedNSClusterDAO.FindEnabledNSCluster(tx, int64(message.ClusterId))
cluster, err := models.SharedNSClusterDAO.FindEnabledNSCluster(tx, int64(message.ClusterId))
if err != nil {
return nil, err
}
@@ -90,7 +89,7 @@ func (this *MessageService) ListUnreadMessages(ctx context.Context, req *pb.List
}
}
case nodeconfigs.NodeRoleDNS:
node, err := nameservers.SharedNSNodeDAO.FindEnabledNSNode(tx, int64(message.NodeId))
node, err := models.SharedNSNodeDAO.FindEnabledNSNode(tx, int64(message.NodeId))
if err != nil {
return nil, err
}