12345678910111213141516171819202122232425262728293031323334353637 |
- 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() {
- // routerNoCheckRole = append(routerNoCheckRole, registerAppAnalystRouterTest)
- routerCheckRole = append(routerCheckRole, registerAppAnalystRouter)
- }
- // 需认证的路由代码
- func registerAppAnalystRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- api := apis.AppScore{}
- r := v1.Group("/app/analyst").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
- {
- r.GET("/:app_alias", api.CalAppLatency)
- r.GET("/:app_alias/svr", api.CalServiceLatency)
- r.GET("/:app_alias/edge", api.CalEdgeLatency)
- }
- }
- // 无需认证的路由代码
- // func registerAppAnalystRouterTest(v1 *gin.RouterGroup) {
- // api := apis.AppScore{}
- // r := v1.Group("/test/app/analyst")
- // {
- // r.GET("/:app_alias", api.CalAppLatency)
- // r.GET("/:app_alias/svr", api.CalServiceLatency)
- // r.GET("/:app_alias/edge", api.CalEdgeLatency)
- // }
- // }
|