1234567891011121314151617181920212223242526272829 |
- package router
- import (
- "Medical_OAuth/app/admin/controller"
- "Medical_OAuth/common/actions"
- "Medical_OAuth/common/middleware"
- "github.com/gin-gonic/gin"
- jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
- )
- func init() {
- routerCheckRole = append(routerCheckRole, registerSysDeptRouter)
- }
- // 需认证的路由代码
- func registerSysDeptRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- cont := controller.SysDeptController{}
- r := v1.Group("/dept").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
- {
- r.GET("", cont.GetPage)
- r.GET("/:id", cont.Get)
- r.POST("", cont.Insert)
- r.PUT("", cont.Update)
- r.DELETE("", cont.Delete)
- r.POST("/enter", cont.Enter)
- }
- }
|