From 8185a69354b8ab17592e0bd010945b7925d95521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 17 Jun 2024 21:48:28 +0800 Subject: [PATCH] feat: optimize mysql api --- routes/plugin.go | 52 +----------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/routes/plugin.go b/routes/plugin.go index 5de6247c..a5b20506 100644 --- a/routes/plugin.go +++ b/routes/plugin.go @@ -19,57 +19,7 @@ func Plugin() { route.Get("errorLog", openRestyController.ErrorLog) route.Post("clearErrorLog", openRestyController.ClearErrorLog) }) - r.Prefix("mysql57").Group(func(route route.Router) { - mySQLController := plugins.NewMySQLController() - route.Get("load", mySQLController.Load) - route.Get("config", mySQLController.GetConfig) - route.Post("config", mySQLController.SaveConfig) - route.Get("errorLog", mySQLController.ErrorLog) - route.Post("clearErrorLog", mySQLController.ClearErrorLog) - route.Get("slowLog", mySQLController.SlowLog) - route.Post("clearSlowLog", mySQLController.ClearSlowLog) - route.Get("rootPassword", mySQLController.GetRootPassword) - route.Post("rootPassword", mySQLController.SetRootPassword) - route.Get("databases", mySQLController.DatabaseList) - route.Post("databases", mySQLController.AddDatabase) - route.Delete("databases", mySQLController.DeleteDatabase) - route.Get("backups", mySQLController.BackupList) - route.Post("backups", mySQLController.CreateBackup) - route.Put("backups", mySQLController.UploadBackup) - route.Delete("backups", mySQLController.DeleteBackup) - route.Post("backups/restore", mySQLController.RestoreBackup) - route.Get("users", mySQLController.UserList) - route.Post("users", mySQLController.AddUser) - route.Delete("users", mySQLController.DeleteUser) - route.Post("users/password", mySQLController.SetUserPassword) - route.Post("users/privileges", mySQLController.SetUserPrivileges) - }) - r.Prefix("mysql80").Group(func(route route.Router) { - mySQLController := plugins.NewMySQLController() - route.Get("load", mySQLController.Load) - route.Get("config", mySQLController.GetConfig) - route.Post("config", mySQLController.SaveConfig) - route.Get("errorLog", mySQLController.ErrorLog) - route.Post("clearErrorLog", mySQLController.ClearErrorLog) - route.Get("slowLog", mySQLController.SlowLog) - route.Post("clearSlowLog", mySQLController.ClearSlowLog) - route.Get("rootPassword", mySQLController.GetRootPassword) - route.Post("rootPassword", mySQLController.SetRootPassword) - route.Get("databases", mySQLController.DatabaseList) - route.Post("databases", mySQLController.AddDatabase) - route.Delete("databases", mySQLController.DeleteDatabase) - route.Get("backups", mySQLController.BackupList) - route.Post("backups", mySQLController.CreateBackup) - route.Put("backups", mySQLController.UploadBackup) - route.Delete("backups", mySQLController.DeleteBackup) - route.Post("backups/restore", mySQLController.RestoreBackup) - route.Get("users", mySQLController.UserList) - route.Post("users", mySQLController.AddUser) - route.Delete("users", mySQLController.DeleteUser) - route.Post("users/password", mySQLController.SetUserPassword) - route.Post("users/privileges", mySQLController.SetUserPrivileges) - }) - r.Prefix("mysql84").Group(func(route route.Router) { + r.Prefix("mysql").Group(func(route route.Router) { mySQLController := plugins.NewMySQLController() route.Get("load", mySQLController.Load) route.Get("config", mySQLController.GetConfig)