trace.go 929 B

1234567891011121314151617181920212223242526272829
  1. package router
  2. import (
  3. "go-admin/app/observe/apis"
  4. "go-admin/common/middleware"
  5. "github.com/gin-gonic/gin"
  6. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerTraceRouter)
  10. // routerNoCheckRole = append(routerNoCheckRole, registerTraceRouter)
  11. }
  12. func registerTraceRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. api := apis.Trace{}
  14. // r := v1.Group("/servicegraph").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
  15. r := v1.Group("/trace").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  16. {
  17. r.GET("", api.List)
  18. r.POST("/list", api.List) // 使用前面的GET代替
  19. r.GET("/tree/:trace_id", api.Detail)
  20. r.POST("/detail", api.Detail) // 使用前面的GET代替
  21. r.GET("/graph/:trace_id", api.Graph)
  22. r.GET("/dbslowtop", api.DBSlowTop)
  23. }
  24. }