package router import ( "Medical_OAuth/common/middleware" "github.com/gin-gonic/gin" "Medical_OAuth/app/admin/controller" jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth" ) func init() { routerCheckRole = append(routerCheckRole, registerSysConfigRouter) } // 需认证的路由代码 func registerSysConfigRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { cont := controller.SysConfig{} r := v1.Group("/config").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { r.GET("", cont.GetPage) r.GET("/:id", cont.Get) r.POST("", cont.Insert) r.PUT("/:id", cont.Update) r.DELETE("", cont.Delete) } r1 := v1.Group("/configKey").Use(authMiddleware.MiddlewareFunc()) { r1.GET("/:configKey", cont.GetSysConfigByKEYForService) } r2 := v1.Group("/app-config") { r2.GET("", cont.Get2SysApp) } r3 := v1.Group("/set-config").Use(authMiddleware.MiddlewareFunc()) { r3.PUT("", cont.Update2Set) r3.GET("", cont.Get2Set) } }