mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-02 14:00:26 +08:00
refactor: 获取数据库连接调整
This commit is contained in:
@@ -86,12 +86,6 @@ func (d *Instance) DeleteInstance(rc *req.Ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
func getInstanceId(g *gin.Context) uint64 {
|
||||
instanceId, _ := strconv.Atoi(g.Param("instanceId"))
|
||||
biz.IsTrue(instanceId > 0, "instanceId 错误")
|
||||
return uint64(instanceId)
|
||||
}
|
||||
|
||||
// 获取数据库实例的所有数据库名
|
||||
func (d *Instance) GetDatabaseNames(rc *req.Ctx) {
|
||||
instanceId := getInstanceId(rc.GinCtx)
|
||||
@@ -100,3 +94,9 @@ func (d *Instance) GetDatabaseNames(rc *req.Ctx) {
|
||||
instance.PwdDecrypt()
|
||||
rc.ResData = d.InstanceApp.GetDatabases(instance)
|
||||
}
|
||||
|
||||
func getInstanceId(g *gin.Context) uint64 {
|
||||
instanceId, _ := strconv.Atoi(g.Param("instanceId"))
|
||||
biz.IsTrue(instanceId > 0, "instanceId 错误")
|
||||
return uint64(instanceId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user