package router import ( "Medical_OAuth/app/admin/controller" "Medical_OAuth/common/middleware" "github.com/gin-gonic/gin" jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth" ) func init() { routerCheckRole = append(routerCheckRole, registerSyPostRouter) } // 需认证的路由代码 func registerSyPostRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { cont := controller.SysPostController{} r := v1.Group("/post").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) } }