biz.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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, registerBizRouter)
  10. // routerNoCheckRole = append(routerNoCheckRole, registerBizRouter)
  11. }
  12. func registerBizRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. api := apis.Biz{}
  14. r := v1.Group("/biz").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  15. // r := v1.Group("/biz")
  16. {
  17. r.GET("", api.List)
  18. r.GET("/stats", api.Stats)
  19. r.GET("/digits", api.Digits)
  20. r.GET("/detail", api.Detail)
  21. r.GET("/graph", api.Graph)
  22. r.GET("/graph/stats", api.GraphStats)
  23. r.PUT("/mark/:id", api.Mark)
  24. r.PUT("/favor/:id", api.Favor)
  25. r.DELETE("/:id", api.Delete)
  26. r.GET("/gen", api.GenList)
  27. r.GET("/basic-guy", api.BasicGuy)
  28. r.GET("/node/spans", api.NodeSpans)
  29. r.GET("/node/stats", api.NodeStats)
  30. r.PUT("/node", api.NodeUpdate)
  31. r.GET("/slowtop", api.SlowTop)
  32. }
  33. }