fix search by id (#1047)

* fix search by id

* make SearchByID Public
This commit is contained in:
UUBulb authored and GitHub committed 2025-03-27 19:17:00 +08:00
1 parent 314eadafc6
commit ec44dbbd9b
5 files changed
+119 -36

No files matched your search

+1 -5
View File
@@ -73,11 +73,7 @@ func (s *Server) AfterFind(tx *gorm.DB) error {
return nil
}
// Split a sorted server list into two separate lists:
// The first list contains servers with a priority set (DisplayIndex != 0).
// The second list contains servers without a priority set (DisplayIndex == 0).
// The original slice is not modified. If no server without a priority is found, it returns nil.
func SplitList(x []*Server) ([]*Server, []*Server) {
func (s *Server) SplitList(x []*Server) ([]*Server, []*Server) {
pri := func(s *Server) bool {
return s.DisplayIndex == 0
}