package router import ( "go-admin/app/observe/apis" "go-admin/common/actions" "go-admin/common/middleware" "github.com/gin-gonic/gin" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" ) func init() { routerCheckRole = append(routerCheckRole, registerEventRouter) // routerNoCheckRole = append(routerNoCheckRole, registerEventRouterNoCheck) } func registerEventRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { api := apis.Event{} r := v1.Group("/event").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction()) { r.GET("", api.List) r.GET("/nums", api.ExceptionNums) r.GET("/num/:id", api.ExceptionNumByID) r.GET("/stats", api.EventStatistic) r.GET("/list", api.EventList) } } // func registerEventRouterNoCheck(v1 *gin.RouterGroup) { // api := apis.Event{} // r := v1.Group("/test/event") // { // r.GET("", api.List) // r.GET("/nums", api.ExceptionNums) // r.GET("/num/:id", api.ExceptionNumByID) // r.GET("/stats", api.EventStatistic) // r.GET("/list", api.EventList) // } // }