2022-10-20 18:45:47 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DatabaseRouter struct{}
|
|
|
|
|
|
|
|
func (s *DatabaseRouter) InitDatabaseRouter(Router *gin.RouterGroup) {
|
|
|
|
cmdRouter := Router.Group("databases").
|
|
|
|
Use(middleware.JwtAuth()).
|
|
|
|
Use(middleware.SessionAuth()).
|
|
|
|
Use(middleware.PasswordExpired())
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2022-12-13 18:54:28 +08:00
|
|
|
cmdRouter.POST("", baseApi.CreateMysql)
|
2023-07-27 16:07:27 +08:00
|
|
|
cmdRouter.GET("load/:from", baseApi.LoadDBFromRemote)
|
2022-12-13 18:54:28 +08:00
|
|
|
cmdRouter.POST("/change/access", baseApi.ChangeMysqlAccess)
|
|
|
|
cmdRouter.POST("/change/password", baseApi.ChangeMysqlPassword)
|
|
|
|
cmdRouter.POST("/del/check", baseApi.DeleteCheckMysql)
|
|
|
|
cmdRouter.POST("/del", baseApi.DeleteMysql)
|
2022-12-24 13:31:30 +08:00
|
|
|
cmdRouter.POST("/description/update", baseApi.UpdateMysqlDescription)
|
2022-12-13 18:54:28 +08:00
|
|
|
cmdRouter.POST("/variables/update", baseApi.UpdateMysqlVariables)
|
|
|
|
cmdRouter.POST("/conffile/update", baseApi.UpdateMysqlConfByFile)
|
2022-10-20 18:45:47 +08:00
|
|
|
cmdRouter.POST("/search", baseApi.SearchMysql)
|
2023-08-02 16:47:30 +08:00
|
|
|
cmdRouter.POST("/load/file", baseApi.LoadDatabaseFile)
|
2022-11-18 16:14:23 +08:00
|
|
|
cmdRouter.GET("/variables", baseApi.LoadVariables)
|
|
|
|
cmdRouter.GET("/status", baseApi.LoadStatus)
|
|
|
|
cmdRouter.GET("/baseinfo", baseApi.LoadBaseinfo)
|
2022-12-09 14:07:18 +08:00
|
|
|
cmdRouter.GET("/remote", baseApi.LoadRemoteAccess)
|
2022-11-30 15:47:11 +08:00
|
|
|
cmdRouter.GET("/options", baseApi.ListDBName)
|
2022-10-31 17:26:15 +08:00
|
|
|
|
2022-11-02 16:28:54 +08:00
|
|
|
cmdRouter.GET("/redis/persistence/conf", baseApi.LoadPersistenceConf)
|
|
|
|
cmdRouter.GET("/redis/status", baseApi.LoadRedisStatus)
|
|
|
|
cmdRouter.GET("/redis/conf", baseApi.LoadRedisConf)
|
2022-12-29 17:06:04 +08:00
|
|
|
cmdRouter.GET("/redis/exec", baseApi.RedisWsSsh)
|
2022-12-12 14:06:39 +08:00
|
|
|
cmdRouter.POST("/redis/password", baseApi.ChangeRedisPassword)
|
2022-12-20 18:59:26 +08:00
|
|
|
cmdRouter.POST("/redis/backup/search", baseApi.RedisBackupList)
|
2022-11-02 18:30:22 +08:00
|
|
|
cmdRouter.POST("/redis/conf/update", baseApi.UpdateRedisConf)
|
2022-12-13 18:54:28 +08:00
|
|
|
cmdRouter.POST("/redis/conffile/update", baseApi.UpdateRedisConfByFile)
|
|
|
|
cmdRouter.POST("/redis/persistence/update", baseApi.UpdateRedisPersistenceConf)
|
2023-07-20 17:51:57 +08:00
|
|
|
|
|
|
|
cmdRouter.POST("/remote", baseApi.CreateRemoteDB)
|
2023-07-27 16:07:27 +08:00
|
|
|
cmdRouter.GET("/remote/:name", baseApi.GetRemoteDB)
|
2023-07-21 18:28:45 +08:00
|
|
|
cmdRouter.GET("/remote/list/:type", baseApi.ListRemoteDB)
|
2023-07-20 17:51:57 +08:00
|
|
|
cmdRouter.POST("/remote/update", baseApi.UpdateRemoteDB)
|
|
|
|
cmdRouter.POST("/remote/search", baseApi.SearchRemoteDB)
|
|
|
|
cmdRouter.POST("/remote/del", baseApi.DeleteRemoteDB)
|
2022-10-20 18:45:47 +08:00
|
|
|
}
|
|
|
|
}
|