event.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package router
  2. import (
  3. "go-admin/app/observe/apis"
  4. "go-admin/common/actions"
  5. "go-admin/common/middleware"
  6. "github.com/gin-gonic/gin"
  7. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  8. )
  9. func init() {
  10. routerCheckRole = append(routerCheckRole, registerEventRouter)
  11. // routerNoCheckRole = append(routerNoCheckRole, registerEventRouterNoCheck)
  12. }
  13. func registerEventRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  14. api := apis.Event{}
  15. r := v1.Group("/event").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
  16. {
  17. r.GET("", api.List)
  18. r.GET("/nums", api.ExceptionNums)
  19. r.GET("/num/:id", api.ExceptionNumByID)
  20. r.GET("/stats", api.EventStatistic)
  21. r.GET("/list", api.EventList)
  22. }
  23. }
  24. // func registerEventRouterNoCheck(v1 *gin.RouterGroup) {
  25. // api := apis.Event{}
  26. // r := v1.Group("/test/event")
  27. // {
  28. // r.GET("", api.List)
  29. // r.GET("/nums", api.ExceptionNums)
  30. // r.GET("/num/:id", api.ExceptionNumByID)
  31. // r.GET("/stats", api.EventStatistic)
  32. // r.GET("/list", api.EventList)
  33. // }
  34. // }