mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 16:00:24 +08:00 
			
		
		
		
	服务列表中分组信息中增加UserId字段
This commit is contained in:
		@@ -609,13 +609,17 @@ func (this *ServerService) CountAllEnabledServersMatch(ctx context.Context, req
 | 
				
			|||||||
// ListEnabledServersMatch 列出单页服务
 | 
					// ListEnabledServersMatch 列出单页服务
 | 
				
			||||||
func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.ListEnabledServersMatchRequest) (*pb.ListEnabledServersMatchResponse, error) {
 | 
					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 {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tx := this.NullTx()
 | 
						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, ","))
 | 
						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 {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
@@ -646,6 +650,7 @@ func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.
 | 
				
			|||||||
				pbGroups = append(pbGroups, &pb.ServerGroup{
 | 
									pbGroups = append(pbGroups, &pb.ServerGroup{
 | 
				
			||||||
					Id:     int64(group.Id),
 | 
										Id:     int64(group.Id),
 | 
				
			||||||
					Name:   group.Name,
 | 
										Name:   group.Name,
 | 
				
			||||||
 | 
										UserId: int64(group.UserId),
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user