mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-03 22:06:36 +08:00
阶段性提交
This commit is contained in:
@@ -13,22 +13,24 @@ type OrderMethod struct {
|
||||
Url string `field:"url"` // URL
|
||||
Secret string `field:"secret"` // 密钥
|
||||
Params dbs.JSON `field:"params"` // 参数
|
||||
ClientType string `field:"clientType"` // 客户端类型
|
||||
Order uint32 `field:"order"` // 排序
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type OrderMethodOperator struct {
|
||||
Id interface{} // ID
|
||||
Name interface{} // 名称
|
||||
IsOn interface{} // 是否启用
|
||||
Description interface{} // 描述
|
||||
ParentCode interface{} // 内置的父级代号
|
||||
Code interface{} // 代号
|
||||
Url interface{} // URL
|
||||
Secret interface{} // 密钥
|
||||
Params interface{} // 参数
|
||||
Order interface{} // 排序
|
||||
State interface{} // 状态
|
||||
Id any // ID
|
||||
Name any // 名称
|
||||
IsOn any // 是否启用
|
||||
Description any // 描述
|
||||
ParentCode any // 内置的父级代号
|
||||
Code any // 代号
|
||||
Url any // URL
|
||||
Secret any // 密钥
|
||||
Params any // 参数
|
||||
ClientType any // 客户端类型
|
||||
Order any // 排序
|
||||
State any // 状态
|
||||
}
|
||||
|
||||
func NewOrderMethodOperator() *OrderMethodOperator {
|
||||
|
||||
@@ -300,7 +300,7 @@ func (this *UserNodeDAO) CountAllEnabledUserNodesWithSSLPolicyIds(tx *dbs.Tx, ss
|
||||
if len(sslPolicyIds) == 0 {
|
||||
return
|
||||
}
|
||||
policyStringIds := []string{}
|
||||
var policyStringIds = []string{}
|
||||
for _, policyId := range sslPolicyIds {
|
||||
policyStringIds = append(policyStringIds, strconv.FormatInt(policyId, 10))
|
||||
}
|
||||
@@ -310,3 +310,21 @@ func (this *UserNodeDAO) CountAllEnabledUserNodesWithSSLPolicyIds(tx *dbs.Tx, ss
|
||||
Param("policyIds", strings.Join(policyStringIds, ",")).
|
||||
Count()
|
||||
}
|
||||
|
||||
// FindUserNodeAccessAddr 获取用户节点访问地址
|
||||
func (this *UserNodeDAO) FindUserNodeAccessAddr(tx *dbs.Tx) (string, error) {
|
||||
nodes, err := this.ListEnabledUserNodes(tx, 0, 100)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
for _, node := range nodes {
|
||||
addrs, err := node.DecodeAccessAddrStrings()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if len(addrs) > 0 {
|
||||
return addrs[0], nil
|
||||
}
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
@@ -22,21 +22,21 @@ type UserNode struct {
|
||||
}
|
||||
|
||||
type UserNodeOperator struct {
|
||||
Id interface{} // ID
|
||||
IsOn interface{} // 是否启用
|
||||
UniqueId interface{} // 唯一ID
|
||||
Secret interface{} // 密钥
|
||||
Name interface{} // 名称
|
||||
Description interface{} // 描述
|
||||
Http interface{} // 监听的HTTP配置
|
||||
Https interface{} // 监听的HTTPS配置
|
||||
AccessAddrs interface{} // 外部访问地址
|
||||
Order interface{} // 排序
|
||||
State interface{} // 状态
|
||||
CreatedAt interface{} // 创建时间
|
||||
AdminId interface{} // 管理员ID
|
||||
Weight interface{} // 权重
|
||||
Status interface{} // 运行状态
|
||||
Id any // ID
|
||||
IsOn any // 是否启用
|
||||
UniqueId any // 唯一ID
|
||||
Secret any // 密钥
|
||||
Name any // 名称
|
||||
Description any // 描述
|
||||
Http any // 监听的HTTP配置
|
||||
Https any // 监听的HTTPS配置
|
||||
AccessAddrs any // 外部访问地址
|
||||
Order any // 排序
|
||||
State any // 状态
|
||||
CreatedAt any // 创建时间
|
||||
AdminId any // 管理员ID
|
||||
Weight any // 权重
|
||||
Status any // 运行状态
|
||||
}
|
||||
|
||||
func NewUserNodeOperator() *UserNodeOperator {
|
||||
|
||||
Reference in New Issue
Block a user