mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-29 03:20:24 +08:00
优化数据库节点管理
This commit is contained in:
@@ -176,3 +176,15 @@ func (this *DBNodeDAO) DecodePassword(password string) string {
|
||||
}
|
||||
return string(encrypt.MagicKeyDecode(data))
|
||||
}
|
||||
|
||||
// CheckNodeIsOn 检查节点是否已经启用
|
||||
func (this *DBNodeDAO) CheckNodeIsOn(tx *dbs.Tx, nodeId int64) (bool, error) {
|
||||
isOn, err := this.Query(tx).
|
||||
Pk(nodeId).
|
||||
Result("isOn").
|
||||
FindIntCol(0)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return isOn == 1, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user