mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-08 19:20:25 +08:00
v1.4.1
This commit is contained in:
@@ -4,6 +4,11 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models/dns"
|
||||
dbutils "github.com/TeaOSLab/EdgeAPI/internal/db/utils"
|
||||
@@ -23,10 +28,6 @@ import (
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
timeutil "github.com/iwind/TeaGo/utils/time"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -3178,3 +3179,15 @@ func (this *ServerDAO) NotifyUserClustersChange(tx *dbs.Tx, userId int64) error
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FindUserServerByServerName 根据域名查找Server
|
||||
func (this *ServerDAO) FindUserServerByServerName(tx *dbs.Tx, serverName string) (result []*Server, err error) {
|
||||
_, err = this.Query(tx).
|
||||
State(ServerStateEnabled).
|
||||
Where("(JSON_CONTAINS(serverNames, :jsonQuery1) OR JSON_CONTAINS(serverNames, :jsonQuery2))").
|
||||
Param("jsonQuery1", maps.Map{"name": serverName}.AsJSON()).
|
||||
Param("jsonQuery2", maps.Map{"subNames": serverName}.AsJSON()).
|
||||
Slice(&result).
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user