1234567891011121314151617181920212223242526272829 |
- 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() {
- routerCheckRole = append(routerCheckRole, registerTraceRouter)
- // routerNoCheckRole = append(routerNoCheckRole, registerTraceRouter)
- }
- func registerTraceRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- api := apis.Trace{}
- // r := v1.Group("/servicegraph").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
- r := v1.Group("/trace").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- r.GET("", api.List)
- r.POST("/list", api.List) // 使用前面的GET代替
- r.GET("/tree/:trace_id", api.Detail)
- r.POST("/detail", api.Detail) // 使用前面的GET代替
- r.GET("/graph/:trace_id", api.Graph)
- r.GET("/dbslowtop", api.DBSlowTop)
- }
- }
|