mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-02 20:08:03 +08:00
33 lines
996 B
Go
33 lines
996 B
Go
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())
|
|
withRecordRouter := Router.Group("databases").
|
|
Use(middleware.JwtAuth()).
|
|
Use(middleware.SessionAuth()).
|
|
Use(middleware.PasswordExpired()).
|
|
Use(middleware.OperationRecord())
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
{
|
|
withRecordRouter.POST("", baseApi.CreateMysql)
|
|
withRecordRouter.PUT("/:id", baseApi.UpdateMysql)
|
|
withRecordRouter.POST("/del", baseApi.DeleteMysql)
|
|
withRecordRouter.POST("/variables/update", baseApi.UpdateMysqlVariables)
|
|
cmdRouter.POST("/search", baseApi.SearchMysql)
|
|
cmdRouter.GET("/conf", baseApi.LoadConf)
|
|
cmdRouter.GET("/status", baseApi.LoadStatus)
|
|
}
|
|
}
|