1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +08:00
1Panel/backend/router/ro_database.go
2022-11-10 10:20:36 +08:00

29 lines
779 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)
}
}