12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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, registerServiceGraphRouter2)
- routerNoCheckRole = append(routerNoCheckRole, registerServiceGraphRouter)
- }
- // 接口从observe-ui发出请求,不能加权限验证
- // func registerServiceGraphRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- // api := apis.ServiceGraph{}
- // r := v1.Group("/service").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
- // {
- // r.GET("/graph", api.Show)
- // r.GET("/side", api.SpanScatterChart)
- // }
- // }
- func registerServiceGraphRouter(v1 *gin.RouterGroup) {
- api := apis.Service{}
- r := v1.Group("/service")
- {
- r.GET("/digits/gen", api.DigitsGen)
- }
- }
- func registerServiceGraphRouter2(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- // func registerServiceGraphRouter2(v1 *gin.RouterGroup) {
- api := apis.Service{}
- r := v1.Group("/service").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- // r := v1.Group("/service")
- {
- // r.POST("/show", api.Show)
- // r.POST("/side", api.SpanScatterChart)
- r.GET("", api.List)
- r.GET("/noapp", api.ListNoAppAlias)
- r.PUT("/:id", api.Update)
- r.GET("/stats", api.Stats)
- r.GET("/digits", api.Digits)
- r.GET("/graph", api.Show)
- r.GET("/side", api.SpanScatterChart)
- r.GET("/liveness", api.ServiceLiveness)
- r.GET("/spans", api.Spans)
- r.GET("/graph/gen", api.GenGraph)
- r.GET("/compare/liveness", api.CompareServiceLiveness)
- r.GET("/compare/errors", api.CompareServiceErrors)
- }
- }
|