From cfa88b5ecf106862508aefe188c5ffd762dec62b Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 24 May 2021 10:35:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor=F0=9F=8E=A8=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E5=9C=B0=E5=9D=80=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/router/sys_server_monitor.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/other/router/sys_server_monitor.go diff --git a/app/other/router/sys_server_monitor.go b/app/other/router/sys_server_monitor.go new file mode 100644 index 0000000..1287a47 --- /dev/null +++ b/app/other/router/sys_server_monitor.go @@ -0,0 +1,21 @@ +package router + +import ( + "github.com/gin-gonic/gin" + jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" + "go-admin/app/other/apis" + "go-admin/common/middleware" +) + +func init() { + routerCheckRole = append(routerCheckRole, registerSysServerMonitorRouter) +} + +// 需认证的路由代码 +func registerSysServerMonitorRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { + api := apis.ServerMonitor{} + r := v1.Group("/server-monitor").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + { + r.GET("", api.ServerInfo) + } +} \ No newline at end of file