mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-27 00:51:55 +08:00
feat(ftp): support receive ftp connection (#6)
Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/li4n0/revsuit/frontend"
|
||||
"github.com/li4n0/revsuit/pkg/dns"
|
||||
"github.com/li4n0/revsuit/pkg/ftp"
|
||||
"github.com/li4n0/revsuit/pkg/mysql"
|
||||
"github.com/li4n0/revsuit/pkg/rhttp"
|
||||
"github.com/li4n0/revsuit/pkg/rmi"
|
||||
@@ -15,6 +16,11 @@ import (
|
||||
|
||||
func (revsuit *Revsuit) registerRouter() {
|
||||
revsuit.http.Router = gin.Default()
|
||||
if revsuit.logLevel != log.LevelTrace {
|
||||
revsuit.http.Router = gin.New()
|
||||
revsuit.http.Router.Use(gin.Recovery())
|
||||
}
|
||||
|
||||
revsuit.registerPlatformRouter()
|
||||
revsuit.registerHttpRouter()
|
||||
}
|
||||
@@ -61,6 +67,9 @@ func (revsuit *Revsuit) registerHttpRouter() {
|
||||
rmiGroup := recordGroup.Group("/rmi")
|
||||
rmiGroup.GET("", rmi.ListRecords)
|
||||
|
||||
ftpGroup := recordGroup.Group("/ftp")
|
||||
ftpGroup.GET("", ftp.ListRecords)
|
||||
|
||||
// init rule router group
|
||||
ruleGroup := revsuit.http.ApiGroup.Group("/rule")
|
||||
|
||||
@@ -84,6 +93,11 @@ func (revsuit *Revsuit) registerHttpRouter() {
|
||||
rmiGroup.POST("", rmi.UpsertRules)
|
||||
rmiGroup.DELETE("", rmi.DeleteRules)
|
||||
|
||||
ftpGroup = ruleGroup.Group("/ftp")
|
||||
ftpGroup.GET("", ftp.ListRules)
|
||||
ftpGroup.POST("", ftp.UpsertRules)
|
||||
ftpGroup.DELETE("", ftp.DeleteRules)
|
||||
|
||||
// init file router group
|
||||
fileGroup := revsuit.http.ApiGroup.Group("/file")
|
||||
fileGroup.GET("/mysql/:id", mysql.GetFile)
|
||||
|
||||
Reference in New Issue
Block a user