1234567891011121314151617181920212223242526272829303132333435363738 |
- package router
- import (
- "go-admin/app/observe/apis"
- "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, registerAppHealthRouterTest)
- routerCheckRole = append(routerCheckRole, registerAppHealthRouter)
- }
- // 需认证的路由代码
- func registerAppHealthRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- api := apis.AppScore{}
- r := v1.Group("/apps_score").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- r.POST("", api.CalAppsScore)
- r.GET("/:app_alias/svr", api.CalAppsScoreByService)
- r.GET("/:app_alias/edge", api.CalAppsScoreByEdge)
- r.GET("/:app_alias/svrs", api.CalServicesScoreByApp)
- }
- }
- // 无需认证的路由代码
- // func registerAppHealthRouterTest(v1 *gin.RouterGroup) {
- // api := apis.AppScore{}
- // r := v1.Group("/test/apps_score")
- // {
- // r.POST("", api.CalAppsScore)
- // r.GET("/:app_alias/svr", api.CalAppsScoreByService)
- // r.GET("/:app_alias/edge", api.CalAppsScoreByEdge)
- // r.GET("/:app_alias/svrs", api.CalServicesScoreByApp)
- // }
- // }
|