服务列表中分组信息中增加UserId字段

This commit is contained in:
GoEdgeLab
2022-04-13 15:01:45 +08:00
parent 1c334e0724
commit bc69e29f0b

View File

@@ -609,13 +609,17 @@ func (this *ServerService) CountAllEnabledServersMatch(ctx context.Context, req
// ListEnabledServersMatch 列出单页服务
func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.ListEnabledServersMatchRequest) (*pb.ListEnabledServersMatchResponse, error) {
// 校验请求
_, _, err := this.ValidateAdminAndUser(ctx, 0, req.UserId)
_, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)
if err != nil {
return nil, err
}
tx := this.NullTx()
if userId > 0 {
req.UserId = userId
}
servers, err := models.SharedServerDAO.ListEnabledServersMatch(tx, req.Offset, req.Size, req.ServerGroupId, req.Keyword, req.UserId, req.NodeClusterId, req.AuditingFlag, utils.SplitStrings(req.ProtocolFamily, ","))
if err != nil {
return nil, err
@@ -646,6 +650,7 @@ func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.
pbGroups = append(pbGroups, &pb.ServerGroup{
Id: int64(group.Id),
Name: group.Name,
UserId: int64(group.UserId),
})
}
}