1Panel/backend/router/ro_database.go
2022-11-10 10:20:36 +08:00

31 lines
869 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.POST("/del", baseApi.DeleteMysql)
cmdRouter.POST("/search", baseApi.SearchMysql)
cmdRouter.GET("/conf", baseApi.LoadConf)
cmdRouter.GET("/status", baseApi.LoadStatus)
}
}