tunnel.go 993 B

123456789101112131415161718192021222324252627
  1. package admin
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "server/api/v1"
  5. "server/middleware"
  6. )
  7. type TunnelRouter struct{}
  8. func (tr *TunnelRouter) InitTunnelRouter(Router *gin.RouterGroup) {
  9. tunnelRouter := Router.Group("tunnel").Use(middleware.OperationRecord())
  10. tunnelRouterWithoutRecord := Router.Group("tunnel")
  11. tunnelRouterApi := v1.ApiGroupApp.AdminApiGroup.TunnelApi
  12. {
  13. tunnelRouter.POST("queryTunnelList", tunnelRouterApi.QueryTunnelList)
  14. tunnelRouter.POST("createTunnel", tunnelRouterApi.CreateTunnel)
  15. tunnelRouter.PUT("updateTunnel", tunnelRouterApi.UpdateTunnel)
  16. tunnelRouter.PUT("updateTunnelsRegion", tunnelRouterApi.UpdateTunnelsRegion)
  17. tunnelRouter.PUT("updateTunnelTime", tunnelRouterApi.UpdateTunnelTime)
  18. tunnelRouter.DELETE("deleteTunnel", tunnelRouterApi.DeleteTunnel)
  19. }
  20. {
  21. tunnelRouterWithoutRecord.GET("queryAllTunnels", tunnelRouterApi.QueryAllTunnels)
  22. tunnelRouterWithoutRecord.GET("queryNoRegionTunnels", tunnelRouterApi.QueryNoRegionTunnels)
  23. }
  24. }