优化代码

This commit is contained in:
GoEdgeLab
2022-07-22 14:35:17 +08:00
parent 384de90f00
commit 95e849c998
80 changed files with 462 additions and 463 deletions

View File

@@ -14,7 +14,7 @@ type NodeGroupService struct {
// CreateNodeGroup 创建分组
func (this *NodeGroupService) CreateNodeGroup(ctx context.Context, req *pb.CreateNodeGroupRequest) (*pb.CreateNodeGroupResponse, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -31,7 +31,7 @@ func (this *NodeGroupService) CreateNodeGroup(ctx context.Context, req *pb.Creat
// UpdateNodeGroup 修改分组
func (this *NodeGroupService) UpdateNodeGroup(ctx context.Context, req *pb.UpdateNodeGroupRequest) (*pb.RPCSuccess, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -49,7 +49,7 @@ func (this *NodeGroupService) UpdateNodeGroup(ctx context.Context, req *pb.Updat
// DeleteNodeGroup 删除分组
func (this *NodeGroupService) DeleteNodeGroup(ctx context.Context, req *pb.DeleteNodeGroupRequest) (*pb.RPCSuccess, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -67,7 +67,7 @@ func (this *NodeGroupService) DeleteNodeGroup(ctx context.Context, req *pb.Delet
// FindAllEnabledNodeGroupsWithNodeClusterId 查询所有分组
func (this *NodeGroupService) FindAllEnabledNodeGroupsWithNodeClusterId(ctx context.Context, req *pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest) (*pb.FindAllEnabledNodeGroupsWithNodeClusterIdResponse, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -91,7 +91,7 @@ func (this *NodeGroupService) FindAllEnabledNodeGroupsWithNodeClusterId(ctx cont
// UpdateNodeGroupOrders 修改分组排序
func (this *NodeGroupService) UpdateNodeGroupOrders(ctx context.Context, req *pb.UpdateNodeGroupOrdersRequest) (*pb.RPCSuccess, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -108,7 +108,7 @@ func (this *NodeGroupService) UpdateNodeGroupOrders(ctx context.Context, req *pb
// FindEnabledNodeGroup 查找单个分组信息
func (this *NodeGroupService) FindEnabledNodeGroup(ctx context.Context, req *pb.FindEnabledNodeGroupRequest) (*pb.FindEnabledNodeGroupResponse, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}