优化代码

This commit is contained in:
刘祥超
2022-07-22 15:05:30 +08:00
parent 876c631c85
commit fe511ae7e5
72 changed files with 675 additions and 628 deletions

View File

@@ -112,7 +112,7 @@ func (this *NodeService) NodeStream(server pb.NodeService_NodeStreamServer) erro
//logs.Println("[RPC]accepted node '" + numberutils.FormatInt64(nodeId) + "' connection")
tx := this.NullTx()
var tx = this.NullTx()
// 标记为活跃状态
oldIsActive, err := models.SharedNodeDAO.FindNodeActive(tx, nodeId)
@@ -222,7 +222,7 @@ func (this *NodeService) NodeStream(server pb.NodeService_NodeStreamServer) erro
// SendCommandToNode 向节点发送命令
func (this *NodeService) SendCommandToNode(ctx context.Context, req *pb.NodeStreamMessage) (*pb.NodeStreamMessage, error) {
// 校验请求
_, _, err := this.ValidateAdminAndUser(ctx, 0, 0)
_, _, err := this.ValidateAdminAndUser(ctx)
if err != nil {
return nil, err
}