Skip to content

Commit

Permalink
feat: optimize mysql api
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Jun 17, 2024
1 parent d41862f commit 8185a69
Showing 1 changed file with 1 addition and 51 deletions.
52 changes: 1 addition & 51 deletions routes/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8185a69

Please sign in to comment.