router.go 478 B

12345678910111213141516171819
  1. package app
  2. import (
  3. middlewares "Panel_development/app/middleware"
  4. "Panel_development/app/routers"
  5. "Panel_development/global"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func InitRouter() error {
  9. engine := gin.New()
  10. engine.Use(middlewares.LoginMiddleware())
  11. gin.SetMode(global.ServerSetting.Mode)
  12. routers.AdminRouter(engine)
  13. routers.ComponentClassRouter(engine)
  14. routers.ComponentListRouter(engine)
  15. routers.PageManageRouter(engine)
  16. return engine.Run(global.ServerSetting.Port)
  17. }